|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.actions.ActionGroup
org.eclipse.team.ui.synchronize.SynchronizePageActionGroup
Used to add one or more actions to the context menu, toolbar or view menu
of an ISynchronizePage
. An action group is added to a synchronize
page by adding the group to the ISynchronizePageConfiguration
after
configuration has been created by the page but before the page is created.
The life cycle of an action group is:
initialize(ISynchronizePageConfiguration}
method is
invoked before the methods to populate menus. This is done to give clients
a change to create and initialize the actions of the action group.
fillActionBars(IActionBars)
method is invoked
to populate the page's action bars (view menu and toolbar). It is
possible for the action bars to be missing one or more components
so clients are expected to check for null
when accessing
the menus from the action bars.
fillContextMenu(IMenuManager)
method is invoked each time
the context menu is shown. Before this method is called, the
action group will be provided with an ActionContext
containing the view selection. Clients can access the context using
getContext()
.
updateActionBars()
method is invoked whenever the
page's selection changes. Before this method is called, the
action group will be provided with an ActionContext
containing the view selection. Clients can access the context using
getContext()
.
modelChanged(ISynchronizeModelElement)
method is
invoked whenever the model being displayed is changed. This gives clients
a chance to adjust the input to actions that operate on all visible elements.
dispose()
method is called when the page is disposed.
Constructor Summary | |
SynchronizePageActionGroup()
|
Method Summary | |
protected boolean |
appendToGroup(IContributionManager manager,
String groupId,
IAction action)
Helper method to add an action to a group in a menu. |
protected boolean |
appendToGroup(IContributionManager manager,
String groupId,
IContributionItem item)
Helper method to add a contribution item to a group in a menu. |
protected void |
appendToGroup(String menuId,
String groupId,
IAction action)
Helper method that can be invoked during initialization to add an action to a particular menu (one of P_TOOLBAR_MENU, P_VIEW_MENU, P_CONTEXT_MENU from ISynchronizePageConfiguration). |
protected void |
appendToGroup(String menuId,
String groupId,
IContributionItem item)
Helper method that can be invoked during initialization to add an item to a particular menu (one of P_TOOLBAR_MENU, P_VIEW_MENU, P_CONTEXT_MENU from ISynchronizePageConfiguration). |
void |
dispose()
Dispose of the action group. |
void |
fillActionBars(IActionBars actionBars)
Adds the applicable actions to a part's action bars, including setting any global action handlers. |
void |
fillContextMenu(IMenuManager menu)
Adds the applicable actions to a context menu, based on the state of the ActionContext .
|
protected IContributionItem |
findGroup(IContributionManager menu,
String groupId)
Helper method to find the group of the given id for the page associated with the configuration of this action group. |
protected ISelectionProvider |
getVisibleRootsSelectionProvider()
Return a selection provider whose selection includes all roots of the elements visible in the page. |
void |
initialize(ISynchronizePageConfiguration configuration)
Initialize the actions of this contribution. |
void |
modelChanged(ISynchronizeModelElement root)
This method is invoked whenever the model being displayed in the view changes. |
Methods inherited from class org.eclipse.ui.actions.ActionGroup |
getContext, setContext, updateActionBars |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SynchronizePageActionGroup()
Method Detail |
public void initialize(ISynchronizePageConfiguration configuration)
filleContextMenu
or
setActionBars
but after the control for the page has been
created. As a result of this, the site of the configuration can be
accessed. Sublcasses may override this method but must invoke the
overriden method.
configuration
- the configuration for the part to which the
contribution is associatedpublic void modelChanged(ISynchronizeModelElement root)
root
- the root of the model being viewedpublic void dispose()
dispose
in class ActionGroup
protected IContributionItem findGroup(IContributionManager menu, String groupId)
menu
- the menugroupId
- the id of the group being searched for
null
protected boolean appendToGroup(IContributionManager manager, String groupId, IAction action)
null
.
manager
- the menu managergroupId
- the group to append the action toaction
- the action to add
true
if the group exists and the action was added
and false
if the action was not addedprotected boolean appendToGroup(IContributionManager manager, String groupId, IContributionItem item)
null
.
manager
- the menu managergroupId
- the group to append the action toitem
- the item to add
true
if the group exists and the action was added
and false
if the action was not addedprotected void appendToGroup(String menuId, String groupId, IAction action)
menuId
- the menu id (one of P_TOOLBAR_MENU, P_VIEW_MENU,
P_CONTEXT_MENU from ISynchronizePageConfiguration)groupId
- the group id in the menu to which the action is to be
addedaction
- the action to be addedprotected void appendToGroup(String menuId, String groupId, IContributionItem item)
menuId
- the menu id (one of P_TOOLBAR_MENU, P_VIEW_MENU,
P_CONTEXT_MENU from ISynchronizePageConfiguration)groupId
- the group id in the menu to which the item is to be addeditem
- the item to be addedprotected ISelectionProvider getVisibleRootsSelectionProvider()
public void fillContextMenu(IMenuManager menu)
ActionGroup
ActionContext
.
The default implementation does nothing. Subclasses may override or extend this method.
fillContextMenu
in class ActionGroup
menu
- the context menu managerpublic void fillActionBars(IActionBars actionBars)
ActionGroup
The default implementation does nothing. Subclasses may override or extend this method.
fillActionBars
in class ActionGroup
actionBars
- the part's action bars
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.