Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » General (non-technical) » Eclipse Foundation » SWT/JFACE - How to set a selection on a pop-up menu
SWT/JFACE - How to set a selection on a pop-up menu [message #44885] Fri, 09 March 2007 02:10 Go to next message
Eclipse User
Originally posted by: baiyf99.yahoo.com

Hi,

Hope someone could advise me on the above issue.
I have written a pop-up menu using MenuManager.
For example, MenuItems are "Save" and "Cancel"
I would like to program using a timer to set a selection on one of
the menu items (for example, Save in this case), so that a save operation
is done at certain time intervals.

Please advise how (preferably with some java coding) on how to set the
selection to that particular menu item.

I have written a simple method. viewer in this case, is a Tree Viewer.
I am not sure what/how to pass in the selection parameter, in this case to
set the selection to Save MenuItem.

Pls advise, thanks.
Sally


//Set by the timer in certain time intervals to set Save MenuItem
public void setSelection(IStructuredSelection selection) {
if ((viewer != null) && (viewer.getSelection() == null)) {
viewer.setSelection(selection);
}
}
Re: SWT/JFACE - How to set a selection on a pop-up menu [message #44921 is a reply to message #44885] Fri, 09 March 2007 03:12 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

Sally,

This newsgroup is for discussion the operations of the Eclipse
organization itself. Please use the platform or newcomers newsgroup for
questions like this. (You're question totally confuses me. I don't
understand how the menu item is related to a selection in a viewer.)

sally wrote:
> Hi,
>
> Hope someone could advise me on the above issue.
> I have written a pop-up menu using MenuManager.
> For example, MenuItems are "Save" and "Cancel"
> I would like to program using a timer to set a selection on one of
> the menu items (for example, Save in this case), so that a save
> operation is done at certain time intervals.
> Please advise how (preferably with some java coding) on how to set the
> selection to that particular menu item.
>
> I have written a simple method. viewer in this case, is a Tree Viewer.
> I am not sure what/how to pass in the selection parameter, in this
> case to set the selection to Save MenuItem.
>
> Pls advise, thanks.
> Sally
>
>
> //Set by the timer in certain time intervals to set Save MenuItem
> public void setSelection(IStructuredSelection selection) { if
> ((viewer != null) && (viewer.getSelection() == null)) {
> viewer.setSelection(selection); }
> }
>
>
>
>
Previous Topic:how remove unneeded tag
Next Topic:Help request about Eclipse TEST
Goto Forum:
  


Current Time: Wed Apr 16 03:21:50 EDT 2014

Powered by FUDForum. Page generated in 0.03509 seconds