Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Scout/Concepts/Menu
Scout |
Wiki Home |
Website |
Download • Git |
Community |
Forums • Blog • Twitter • G+ |
Bugzilla |
Bugzilla |
The menu component include all links, functionalities, etc... available within the application.
Contents
Description
Screenshot
A context menu rendered in SWT.
Properties
Defined with getConfiguredXxxxxx() methods.
Events
Defined with execXxxxxx() methods.
Advanced topics
In some cases a menu should change its behavior depending on the table column where the menu gets requested.
Do the following steps to get there:
-
AbstractMenu.execInitAciton
: add a property listener to theCONTEXT_COLUMN
property of the table. - set the context column relative properties in the
propertyChange
method.
Example
@Order(30.0) public class ColumnContextSenitiveMenu extends AbstractExtensibleMenu { @Override protected void execInitAction() throws ProcessingException { // add a property listener to the tables property CONTEXT_COLUMN. getTable().addPropertyChangeListener(ITable.PROP_CONTEXT_COLUMN, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { // set here the column relative properties // e.g. disable menu if the context menu is not opened over the tables name column setEnabled(CompareUtility.equals(getTable().getNameColumn(), evt.getNewValue())); } }); } @Override protected String getConfiguredText() { return TEXTS.get("ContextSenitive"); } }