action.putValue( "InstrumentableData", child );
JMenu menu = new LargeMenu( action );
// Set up a Listener to handle the selected event.
menu.addMenuListener( new MenuListener()
{
public void menuSelected( MenuEvent event )
{
JMenu menu = (JMenu)event.getSource();
Action action = menu.getAction();
rebuildInstrumentableMenu(
menu,
(InstrumentManagerConnection)action.getValue(
"InstrumentManagerConnection" ),
(InstrumentableData)action.getValue(
"InstrumentableData" ) );
}
public void menuDeselected( MenuEvent event )
{
}
public void menuCanceled( MenuEvent event )
{
}
} );
instrumentableMenu.add( menu );
}
}
// Instruments
InstrumentData[] instruments = instrumentable.getInstruments();
for( int i = 0; i < instruments.length; i++ )
{
InstrumentData instrument = instruments[ i ];
if( showAll || instrument.isConfigured() )
{
String description = instrument.getDescription();
Action action = new AbstractAction( description )
{
public void actionPerformed( ActionEvent event )
{
}
};
action.putValue( "InstrumentManagerConnection", connection );
action.putValue( "InstrumentableData", instrumentable );
action.putValue( "InstrumentData", instrument );
JMenu menu = new LargeMenu( action );
// Set up a Listener to handle the selected event.
menu.addMenuListener( new MenuListener()
{
public void menuSelected( MenuEvent event )
{
JMenu menu = (JMenu)event.getSource();
Action action = menu.getAction();