Jump to: navigation, search

Scout/Concepts/Menu


Scout
Wiki Home
Website
DownloadGit
Community
ForumsBlogTwitter
Bugzilla
Bugzilla


The menu component include all links, functionalities, etc... available within the application.

  • implements: I obj.pngIMenu
  • extends: C obj.pngAbstractMenu

Description

Note.png
TODO
Add a description


HG Menu.png


Screenshot

Scout ContextMenu SWT.png A context menu rendered in SWT.

Properties

Defined with getConfiguredXxxxxx() methods.

Note.png
TODO
Add a description of important properties. The idea is not to recreate the JavaDoc of the getConfiguredXxxxxx() methods but to provide explanations, best practice, example... Group the properties by domain.


Events

Defined with execXxxxxx() methods.

Note.png
TODO
Add a description of important events. The idea is not to recreate the JavaDoc of the execXxxxxx() methods but to provide explanations, best practice, example... Group the events by domain.


Advanced topics

Table menus: Access the column context in a menu

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:

  1. AbstractMenu.execInitAciton: add a property listener to the CONTEXT_COLUMN property of the table.
  2. 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");
  }
}

See Also