Re: Inner classes for NetRexx

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Inner classes for NetRexx

dIon Gillard/Multitask Consulting/AU
I'm having problems with 1.132's inner class support. Specifically, it doesn't seem to be recognising inner classes when
being returned.

I have the following code:
=======================
package vnr.ide.actions

import com.sun.java.swing.Action
import com.sun.java.swing.UIManager
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import vnr.ide.Desktop
import vnr.util.Log

/**
  * Look And feel changers change the L&F of the desktop and other windows to the
  * class that matches their name
  */
class LookAndFeelChange extends DesktopAction

/**
  * create a look and feel changer with the given desktop and name
  */
method LookAndFeelChange(d=Desktop, name=String)
        super(d, name)

/**
  * Change the look and feel for the desktop (and coordinated windows)
  * to be the class that corresponds to the name of the action
  */
method actionPerformed(ae=ActionEvent)
        lafs = UIManager.getInstalledLookAndFeels()
        loop i = 0 for lafs.length
                if lafs[i].getName() = getValue(Action.NAME) then do
                        UIManager.setLookAndFeel(lafs[i].getClassName())
                        getDesktop().getCoordinator().updateLookAndFeel()
                        leave
                        end
                catch e=Exception
                        Log.logIt("Error changing look and feel", Log.ERROR)
                        Log.logException(e, Log.ERROR)
                end
=======================
And the following output from compiling (in VNR):
=======================
 NetRexx portable processor, version 1.132
Copyright (c) IBM Corporation, 1998.
 All rights reserved.
Program LookAndFeelChange.nrx
   === class vnr.ide.actions.LookAndFeelChange ===
     constructor LookAndFeelChange(Desktop,String)       overrides DesktopAction(Desktop,String)
     method actionPerformed(ActionEvent)
27 +++  lafs = UIManager.getInstalledLookAndFeels()
     +++         ^^^^^^^^^
     +++ Error: The class 'com.sun.java.swing.UIManager$LookAndFeelInfo' cannot be found
28 +++  loop i = 0 for lafs.length
     +++                 ^^^^
     +++ Error: Variable or type expected
29 +++   if lafs[i].getName() = getValue(Action.NAME) then do
     +++      ^^^^
     +++ Error: Variable or type expected
30 +++    UIManager.setLookAndFeel(lafs[i].getClassName())
     +++                             ^^^^
     +++ Error: Variable or type expected
       implements DesktopAction.actionPerformed(ActionEvent)
Compilation of 'LookAndFeelChange.nrx' failed [4 errors]

Any suggestions???


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: Inner classes for NetRexx

dIon Gillard/Multitask Consulting/AU
Changing my previous code to declare the type has the following effect:


NetRexx portable processor, version 1.132
Copyright (c) IBM Corporation, 1998.
All rights reserved.
Program LookAndFeelChange.nrx
   === class vnr.ide.actions.LookAndFeelChange ===
     constructor LookAndFeelChange(Desktop,String)
       overrides DesktopAction(Desktop,String)
     method actionPerformed(ActionEvent)
27 +++  lafs = UIManager.LookAndFeelInfos[]
     +++                   ^^^^^^^^^^^^^^^^
     +++ Error: The property 'LookAndFeelInfos' cannot be found in class 'com.sun.java.swing.UIManager' or a superclass
Compilation of 'LookAndFeelChange.nrx' failed [one error]

Most of the examples and text on minor classes show how to develop them. But not much on using non-dependent minor
classes. It seems NetRexxC is treating this as a property on the definition of the field, rather than as a minor class.

Also in the previous example, it is not taking '$' and treating the left to be the 'major' and the right portion to be the 'minor'
class names.

Please tell me the code posted should be treated as valid by the compiler....?!?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>