Interface ContributionContext


public interface ContributionContext
A ContributionContext accompanies a MenuContributor.contribute(ContributionContext, MenuBuilder) call. It provides context information for the current contribute call.

Caveat: levigo reserves the right to amend this interface in future releases. Therefore we strongly discourage independent implementations of it.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The predefined menu-type for a annotation menu
    static final String
    The predefined menu-type for a context popup-menu
    static final String
    The predefined menu-type for a context toolbar (like jadice's hover toolbars)
    static final String
    The predefined menu-type for an application's main (drop-down) menu
    static final String
    The predefined menu-type for an application's main toolbar
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a Context object.
    Returns the originating event which causes the contribution.
    Return the type of menu currently under construction.
  • Field Details

    • TYPE_MAIN_MENU

      static final String TYPE_MAIN_MENU
      The predefined menu-type for an application's main (drop-down) menu
      See Also:
    • TYPE_TOOLBAR

      static final String TYPE_TOOLBAR
      The predefined menu-type for an application's main toolbar
      See Also:
    • TYPE_CONTEXT_MENU

      static final String TYPE_CONTEXT_MENU
      The predefined menu-type for a context popup-menu
      See Also:
    • TYPE_CONTEXT_TOOLBAR

      static final String TYPE_CONTEXT_TOOLBAR
      The predefined menu-type for a context toolbar (like jadice's hover toolbars)
      See Also:
    • TYPE_ANNOTATION_MENU

      static final String TYPE_ANNOTATION_MENU
      The predefined menu-type for a annotation menu
      See Also:
  • Method Details

    • getEvent

      Object getEvent()
      Returns the originating event which causes the contribution.
      Returns:
      the event
    • getContext

      Context getContext()
      Returns a Context object.
      Returns:
      the context
    • getMenuType

      String getMenuType()
      Return the type of menu currently under construction. This enables MenuContributors to supply different contributions for different situations. The menu type can be one of the predefined types (TYPE_MAIN_MENU etc.) or an application-dependent type (that's why the type isn't an enum).
      Returns:
      the type of menu
      See Also: