SWT/JFACE - How to set a selection on a pop-up menu [message #198708] |
Fri, 09 March 2007 08:21 |
Eclipse User |
|
|
|
Originally posted by: baiyf99.yahoo.com
Sorry, this is post transferred from foundation forum.
I hope someone could help me on this issue.
Just to add on, I have a viewer (inherited from TreeViewer),
and upon right mouse click, it will display a pop-up menu.
I would like to programmatically set the options on this pop-up
menu.
---------------------------------------
Subject: Re: SWT/JFACE - How to set a selection on a pop-up menu
From: merks@xxxxxxxxxxxx (Ed Merks)
Newsgroups: eclipse.foundation
Organization: EclipseCorner
Date: Mar 09 2007 03:12:47
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); }
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.08635 seconds