Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How do you group checked items in a menu subgroup?
How do you group checked items in a menu subgroup? [message #500863] Sun, 29 November 2009 20:28 Go to next message
Ray Hurst is currently offline Ray HurstFriend
Messages: 121
Registered: July 2009
Senior Member
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
Re: How do you group checked items in a menu subgroup? [message #500874 is a reply to message #500863] Mon, 30 November 2009 01:38 Go to previous message
Ray Hurst is currently offline Ray HurstFriend
Messages: 121
Registered: July 2009
Senior Member
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
Previous Topic:problem with AggregateValidationStatus
Next Topic:Annotation Model Usage
Goto Forum:
  


Current Time: Wed Sep 25 13:37:21 GMT 2024

Powered by FUDForum. Page generated in 0.03777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top