com.levigo.util.swing.menu
Interface ContributionContext

All Known Subinterfaces:
TreeContributionContext

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.

Author:
Carolin Koehler

Field Summary
static String TYPE_CONTEXT_MENU
          The predefined menu-type for a context popup-menu
static String TYPE_CONTEXT_TOOLBAR
          The predefined menu-type for a context toolbar (like jadice's hover toolbars)
static String TYPE_MAIN_MENU
          The predefined menu-type for an application's main (drop-down) menu
static String TYPE_TOOLBAR
          The predefined menu-type for an application's main toolbar
 
Method Summary
 Context getContext()
          Returns a Context object.
 EventObject getEvent()
          Returns the originating event which causes the contribution.
 String getMenuType()
          Return the type of menu currently under construction.
 

Field Detail

TYPE_MAIN_MENU

static final String TYPE_MAIN_MENU
The predefined menu-type for an application's main (drop-down) menu

See Also:
Constant Field Values

TYPE_TOOLBAR

static final String TYPE_TOOLBAR
The predefined menu-type for an application's main toolbar

See Also:
Constant Field Values

TYPE_CONTEXT_MENU

static final String TYPE_CONTEXT_MENU
The predefined menu-type for a context popup-menu

See Also:
Constant Field Values

TYPE_CONTEXT_TOOLBAR

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

See Also:
Constant Field Values
Method Detail

getEvent

EventObject getEvent()
Returns the originating event which causes the contribution.

Returns:
the event

getContext

Context getContext()
Returns a Context object. It can be used to create CommandAction as contributions.

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:
TYPE_MAIN_MENU, TYPE_TOOLBAR, TYPE_CONTEXT_MENU, TYPE_CONTEXT_TOOLBAR


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.