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
-
public class ModelSynchronizeParticipantActionGroup extends SynchronizePageActionGroup
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 overridingaddToContextMenu(String, Action, IMenuManager).- Since:
- 3.2
-
-
Field Summary
Fields Modifier and Type Field Description static StringMERGE_ACTION_GROUPThe 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 StringMERGE_ALL_ACTION_IDThe id used to identify the Merge All action.static StringOTHER_ACTION_GROUPThe id of the action group that determines where the other actions (e.g. mark-as-merged) appear in the context menu.
-
Constructor Summary
Constructors Constructor Description ModelSynchronizeParticipantActionGroup()Create a merge action group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToContextMenu(String mergeActionId, Action action, IMenuManager manager)Add the merge action to the context menu manager.protected voidconfigureMergeAction(String mergeActionId, Action action)Configure the merge action to have appropriate label, image, etc.voiddispose()Dispose of the action group.voidfillActionBars(IActionBars actionBars)Adds the applicable actions to a part's action bars, including setting any global action handlers.voidfillContextMenu(IMenuManager menu)Adds the applicable actions to a context menu, based on the state of theActionContext.voidinitialize(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 Detail
-
MERGE_ACTION_GROUP
public static final String 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:
- Constant Field Values
-
OTHER_ACTION_GROUP
public static final String 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:
- Constant Field Values
-
MERGE_ALL_ACTION_ID
protected static final String MERGE_ALL_ACTION_ID
The id used to identify the Merge All action.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(ISynchronizePageConfiguration configuration)
Description copied from class:SynchronizePageActionGroupInitialize the actions of this contribution. This method will be invoked once before any calls are made tofilleContextMenuorsetActionBarsbut 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:
initializein classSynchronizePageActionGroup- Parameters:
configuration- the configuration for the part to which the contribution is associated
-
fillActionBars
public void fillActionBars(IActionBars actionBars)
Description copied from class:ActionGroupAdds 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:
fillActionBarsin classSynchronizePageActionGroup- Parameters:
actionBars- the part's action bars
-
fillContextMenu
public void fillContextMenu(IMenuManager menu)
Description copied from class:ActionGroupAdds 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:
fillContextMenuin classSynchronizePageActionGroup- Parameters:
menu- the context menu manager
-
configureMergeAction
protected void configureMergeAction(String mergeActionId, Action action)
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_IDorSynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID)action- the action for the given id
-
addToContextMenu
protected void addToContextMenu(String mergeActionId, Action action, IMenuManager manager)
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_IDorSynchronizationActionProvider.MARK_AS_MERGE_ACTION_ID)action- the action for the given idmanager- the context menu manager
-
dispose
public void dispose()
Description copied from class:SynchronizePageActionGroupDispose of the action group. Subclasses may override but must invoke the overridden method.- Overrides:
disposein classSynchronizePageActionGroup
-
-