Package org.eclipse.team.ui.synchronize
Class ModelSynchronizeParticipantActionGroup
java.lang.Object
org.eclipse.ui.actions.ActionGroup
org.eclipse.team.ui.synchronize.SynchronizePageActionGroup
org.eclipse.team.ui.synchronize.ModelSynchronizeParticipantActionGroup
Action group that contributes the merge actions to the model
synchronize participant. The groups adds the following:
- A toolbar action for attempting an auto-merge
- Context menu merge actions that delegate to the model's merge action handlers.
- TODO a merge all and overwrite all menu item?
Subclasses can configure the label and icons used for the merge actions
by overriding configureMergeAction(String, Action)
and can
configure where in the context menu the actions appear by overriding
addToContextMenu(String, Action, IMenuManager)
.
- Since:
- 3.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The id of the merge action group that determines where the merge actions (e.g. merge and overwrite) appear in the context menu or toolbar.protected static final String
The id used to identify the Merge All action.static final String
The id of the action group that determines where the other actions (e.g. mark-as-merged) appear in the context menu. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addToContextMenu
(String mergeActionId, Action action, IMenuManager manager) Add the merge action to the context menu manager.protected void
configureMergeAction
(String mergeActionId, Action action) Configure the merge action to have appropriate label, image, etc.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 theActionContext
.void
initialize
(ISynchronizePageConfiguration configuration) Initialize the actions of this contribution.Methods inherited from class org.eclipse.team.ui.synchronize.SynchronizePageActionGroup
appendToGroup, appendToGroup, appendToGroup, appendToGroup, findGroup, getConfiguration, getVisibleRootsSelectionProvider, modelChanged
Methods inherited from class org.eclipse.ui.actions.ActionGroup
getContext, setContext, updateActionBars
-
Field Details
-
MERGE_ACTION_GROUP
The id of the merge action group that determines where the merge actions (e.g. merge and overwrite) appear in the context menu or toolbar.- See Also:
-
OTHER_ACTION_GROUP
The id of the action group that determines where the other actions (e.g. mark-as-merged) appear in the context menu.- See Also:
-
MERGE_ALL_ACTION_ID
The id used to identify the Merge All action.- See Also:
-
-
Constructor Details
-
ModelSynchronizeParticipantActionGroup
public ModelSynchronizeParticipantActionGroup()Create a merge action group.
-
-
Method Details
-
initialize
Description copied from class:SynchronizePageActionGroup
Initialize the actions of this contribution. This method will be invoked once before any calls are made tofilleContextMenu
orsetActionBars
but after the control for the page has been created. As a result of this, the site of the configuration can be accessed. Subclasses may override this method but must invoke the overridden method.- Overrides:
initialize
in classSynchronizePageActionGroup
- Parameters:
configuration
- the configuration for the part to which the contribution is associated
-
fillActionBars
Description copied from class:ActionGroup
Adds the applicable actions to a part's action bars, including setting any global action handlers.The default implementation does nothing. Subclasses may override or extend this method.
- Overrides:
fillActionBars
in classSynchronizePageActionGroup
- Parameters:
actionBars
- the part's action bars
-
fillContextMenu
Description copied from class:ActionGroup
Adds the applicable actions to a context menu, based on the state of theActionContext
.The default implementation does nothing. Subclasses may override or extend this method.
- Overrides:
fillContextMenu
in classSynchronizePageActionGroup
- Parameters:
menu
- the context menu manager
-
configureMergeAction
Configure the merge action to have appropriate label, image, etc. Subclasses may override but should invoke the overridden method for unrecognized ids in order to support future additions.- Parameters:
mergeActionId
- the id of the merge action (one ofSynchronizationActionProvider.MERGE_ACTION_ID
,SynchronizationActionProvider.OVERWRITE_ACTION_ID
orSynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID
)action
- the action for the given id
-
addToContextMenu
Add the merge action to the context menu manager. Subclasses may override but should invoke the overridden method for unrecognized ids in order to support future additions.- Parameters:
mergeActionId
- the id of the merge action (one ofSynchronizationActionProvider.MERGE_ACTION_ID
,SynchronizationActionProvider.OVERWRITE_ACTION_ID
orSynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID
)action
- the action for the given idmanager
- the context menu manager
-
dispose
public void dispose()Description copied from class:SynchronizePageActionGroup
Dispose of the action group. Subclasses may override but must invoke the overridden method.- Overrides:
dispose
in classSynchronizePageActionGroup
-