Home » Eclipse Projects » Remote Application Platform (RAP) » Menu not showin Radio or Check option.(DropDownMenuButton Menu bug?)
Menu not showin Radio or Check option. [message #544769] |
Mon, 05 July 2010 13:18 |
|
Good day,
I'm playing with dropdownButton as in the toolbar in a composite. And now i discoverd somting weard I use the folowing code:
public void createPartControl(Composite parent) {
Composite controllComposite = new Composite(parent, SWT.NONE);
controllComposite.setLayout(new GridLayout(3, false));
searchBox = new Text(controllComposite, SWT.BORDER | SWT.SEARCH | SWT.CANCEL);
final ToolBar tool = new ToolBar(controllComposite, SWT.NONE);
search = new ToolItem(tool, SWT.DROP_DOWN);
search.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("com.remainsoftware.universalviewers",
"img/Search-icon16.png").createImage());
Menu menu = new Menu(getSite().getShell(), SWT.POP_UP);
final MenuItem exact = new MenuItem(menu, SWT.RADIO);
exact.setText("Exact Search");
exact.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
System.out.println(exact.getSelection());
if (exact.getSelection())
System.out.println("Exact search");
}
});
final MenuItem detail = new MenuItem(menu, SWT.CHECK);
detail.setText("Include Detail Headsers");
detail.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
System.out.println(detail.getSelection());
if (detail.getSelection())
System.out.println("detail search");
}
});
search.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
if (event.detail == SWT.ARROW) {
// Shoe menu
menu = tableSorter.getMenuOptions(getSite().getShell());
Rectangle rect = search.getBounds();
Point pt = new Point(rect.x, rect.y + rect.height);
pt = tool.toDisplay(pt);
menu.setLocation(pt.x, pt.y);
menu.setVisible(true);
} else {
// Do somting
}
});
}
Now the menu shows up nicly however I dont see tha radio button nor the Checkbox I am expecting in the MenuItems. Or am I doing somting wrong?
hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
|
|
|
Re: Menu not showin Radio or Check option. [message #544781 is a reply to message #544769] |
Mon, 05 July 2010 13:44 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Martijn,
I've just checked your snippet with RAP from CVS HEAD ant it works fine
- menu is there, radio and checkbox items too. Initially, when the menu
is shown, both radio and check menu items are not selected. Select them
and you will see the checkmark and the small circle in front the radio
button.
Best,
Ivan
On 07/05/2010 4:18 PM, Martijn Cremer wrote:
> Good day,
>
> I'm playing with dropdownButton as in the toolbar in a composite. And
> now i discoverd somting weard I use the folowing code:
>
>
> public void createPartControl(Composite parent) {
>
> Composite controllComposite = new Composite(parent, SWT.NONE);
> controllComposite.setLayout(new GridLayout(3, false));
> searchBox = new Text(controllComposite, SWT.BORDER |
> SWT.SEARCH | SWT.CANCEL);
>
> final ToolBar tool = new ToolBar(controllComposite, SWT.NONE);
>
> search = new ToolItem(tool, SWT.DROP_DOWN);
>
> search.setImage(AbstractUIPlugin.imageDescriptorFromPlugin("com.remainsoftware.universalviewers ",
> "img/Search-icon16.png").createImage());
>
>
> Menu menu = new Menu(getSite().getShell(), SWT.POP_UP);
>
> final MenuItem exact = new MenuItem(menu, SWT.RADIO);
> exact.setText("Exact Search");
> exact.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent event) {
> System.out.println(exact.getSelection());
> if (exact.getSelection())
> System.out.println("Exact search");
> }
> });
> final MenuItem detail = new MenuItem(menu, SWT.CHECK);
> detail.setText("Include Detail Headsers");
> detail.addSelectionListener(new SelectionAdapter() {
> public void widgetSelected(SelectionEvent event) {
> System.out.println(detail.getSelection());
> if (detail.getSelection())
> System.out.println("detail search");
> }
> });
>
> search.addListener(SWT.Selection, new Listener() {
>
> @Override
> public void handleEvent(Event event) {
> if (event.detail == SWT.ARROW) {
> // Shoe menu menu =
> tableSorter.getMenuOptions(getSite().getShell());
>
> Rectangle rect = search.getBounds();
> Point pt = new Point(rect.x, rect.y +
> rect.height);
> pt = tool.toDisplay(pt);
> menu.setLocation(pt.x, pt.y);
> menu.setVisible(true);
>
> } else {
> // Do somting
>
> }
> });
> }
>
>
> Now the menu shows up nicly however I dont see tha radio button nor
> the Checkbox I am expecting in the MenuItems. Or am I doing somting
> wrong?
|
|
|
Re: Menu not showin Radio or Check option. [message #544788 is a reply to message #544781] |
Mon, 05 July 2010 14:09 |
|
Ivan Furnadjiev wrote on Mon, 05 July 2010 15:44 | Hi Martijn,
I've just checked your snippet with RAP from CVS HEAD ant it works fine
- menu is there, radio and checkbox items too. Initially, when the menu
is shown, both radio and check menu items are not selected. Select them
and you will see the checkmark and the small circle in front the radio
button.
Best,
Ivan
|
That's weird I am using the business theme (I forgot to mention that).
I clicked on them but they do not pop-up (i thought maybe rap was late rendering the items). So this is weard il try outside the business theme.
So after reading your post I tried it without the busness theme same result.
I must note the snippet is simplyfied, the menu is generated under sertain conditions. (meaning when the view loads the menu does not exsist and is created at runtime) could this be maybe the problem?
hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
|
|
|
Re: Menu not showin Radio or Check option. [message #544798 is a reply to message #544788] |
Mon, 05 July 2010 14:38 |
|
Just to be sure i created a standalone app (not in my project) same result..
Im using:
Rich Ajax Platform (RAP) Tooling 1.3.0.20100615-1734 org.eclipse.rap.tooling.feature.group
Thats the stable 1.3 release as far as I know.
hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
|
|
|
Re: Menu not showin Radio or Check option. [message #544812 is a reply to message #544788] |
Mon, 05 July 2010 14:52 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Martijn,
if you can provide a complete snippet/project to reproduce the issue
please feel free to open a bugzilla. For me, the attached snippet in
first post works fine with/without business theme.
Best,
Ivan
On 07/05/2010 5:09 PM, Martijn Cremer wrote:
> Ivan Furnadjiev wrote on Mon, 05 July 2010 15:44
>> Hi Martijn,
>>
>> I've just checked your snippet with RAP from CVS HEAD ant it works
>> fine - menu is there, radio and checkbox items too. Initially, when
>> the menu is shown, both radio and check menu items are not selected.
>> Select them and you will see the checkmark and the small circle in
>> front the radio button.
>>
>> Best,
>> Ivan
>
>
> That's weird I am using the business theme (I forgot to mention that).
>
> I clicked on them but they do not pop-up (i thought maybe rap was late
> rendering the items). So this is weard il try outside the business theme.
>
> So after reading your post I tried it without the busness theme same
> result.
>
> I must note the snippet is simplyfied, the menu is generated under
> sertain conditions. (meaning when the view loads the menu does not
> exsist and is created at runtime) could this be maybe the problem?
|
|
|
Re: Menu not showin Radio or Check option. [message #544979 is a reply to message #544812] |
Tue, 06 July 2010 09:14 |
|
Ivan Furnadjiev wrote on Mon, 05 July 2010 16:52 | Hi Martijn,
if you can provide a complete snippet/project to reproduce the issue
please feel free to open a bugzilla. For me, the attached snippet in
first post works fine with/without business theme.
Best,
Ivan
On 07/05/2010 5:09 PM, Martijn Cremer wrote:
> Ivan Furnadjiev wrote on Mon, 05 July 2010 15:44
>> Hi Martijn,
>>
>> I've just checked your snippet with RAP from CVS HEAD ant it works
>> fine - menu is there, radio and checkbox items too. Initially, when
>> the menu is shown, both radio and check menu items are not selected.
>> Select them and you will see the checkmark and the small circle in
>> front the radio button.
>>
>> Best,
>> Ivan
>
>
> That's weird I am using the business theme (I forgot to mention that).
>
> I clicked on them but they do not pop-up (i thought maybe rap was late
> rendering the items). So this is weard il try outside the business theme.
>
> So after reading your post I tried it without the busness theme same
> result.
>
> I must note the snippet is simplyfied, the menu is generated under
> sertain conditions. (meaning when the view loads the menu does not
> exsist and is created at runtime) could this be maybe the problem?
|
Never mind, this morning I discoverd that I forgot to keep track of one of the dynamic parameters and because of that the menu got initialised constantly and there for it did run the actions, but never showed the next state. (how dumb can you get).
hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
|
|
|
Goto Forum:
Current Time: Wed Apr 24 18:43:05 GMT 2024
Powered by FUDForum. Page generated in 0.04056 seconds
|