|
Re: How do you group checked items in a menu subgroup? [message #500874 is a reply to message #500863] |
Sun, 29 November 2009 20:38  |
Eclipse User |
|
|
|
This si the code I wrote and it didn't work. The run method never gets
called.
IMenuManager menu1 = new MenuManager( "Instruction Set" );
final Action twelveBitAction = new Action() {
public void run() {
this.setChecked( true );
fourteenBitAction.setChecked( false );
sixteenBitAction.setChecked( false );
thirtytwoBitAction.setChecked( false );
}
};
twelveBitAction.setText( "12 bit" );
twelveBitAction.setChecked( true );
final Action fourteenBitAction = new Action() {
public void run() {
this.setChecked( true );
twelveBitAction.setChecked( false );
sixteenBitAction.setChecked( false );
thirtytwoBitAction.setChecked( false );
}
};
fourteenBitAction.setText( "14 bit" );
final Action sixteenBitAction = new Action() {
public void run() {
this.setChecked( true );
twelveBitAction.setChecked( false );
fourteenBitAction.setChecked( false );
thirtytwoBitAction.setChecked( false );
}
};
sixteenBitAction.setText( "16 bit" );
final Action thirtytwoBitAction = new Action() {
public void run() {
this.setChecked( true );
twelveBitAction.setChecked( false );
fourteenBitAction.setChecked( false );
sixteenBitAction.setChecked( false );
}
};
thirtytwoBitAction.setText( "32 bit" );
menu1.add( twelveBitAction );
menu1.add( fourteenBitAction );
menu1.add( sixteenBitAction ) ;
menu1.add( thirtytwoBitAction );
menu.add(menu1);
Ray
Ray Hurst wrote:
> I've created a sub menu with four items that can be checked.
> How do i only aloow one of the items to be checked at a one time?
> Ray
|
|
|
Powered by
FUDForum. Page generated in 0.03147 seconds