Package org.eclipse.team.ui.mapping
Class SynchronizationActionProvider
- java.lang.Object
-
- org.eclipse.ui.actions.ActionGroup
-
- org.eclipse.ui.navigator.CommonActionProvider
-
- org.eclipse.team.ui.mapping.SynchronizationActionProvider
-
- All Implemented Interfaces:
IMementoAware
- Direct Known Subclasses:
RefactoringSynchronizationActionProvider
public class SynchronizationActionProvider extends CommonActionProvider
An action group that can be used by models to contribute actions to a team synchronization viewer. Subclasses should override theinitialize()method in order to register handlers for the following merge actions if they want custom merge behavior: They may also add other actions to the context menu or register action handlers in thefillActionBars(IActionBars)method.This class may be subclasses by clients.
- Since:
- 3.2
- See Also:
MergeActionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringMARK_AS_MERGE_ACTION_IDAction id constant for the mark-as-merge action.static StringMERGE_ACTION_IDAction id constant for the merge action.static StringOVERWRITE_ACTION_IDAction id constant for the merge action.
-
Constructor Summary
Constructors Constructor Description SynchronizationActionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()This method is called by the user of an action group to signal that the group is no longer needed.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.ICommonActionExtensionSitegetExtensionSite()Return the extension site for this action provider.protected IExtensionStateModelgetExtensionStateModel()Return the extension state model for the content provider associated with action provider.protected ISynchronizationContextgetSynchronizationContext()Return the synchronization context to which the actions of this provider apply.protected ISynchronizePageConfigurationgetSynchronizePageConfiguration()Return the configuration from the synchronize page that contains the common viewer.voidinit(ICommonActionExtensionSite site)Initialize the current ICommonActionProvider with the supplied information.protected voidinitialize()Method called during action provider initialization.protected voidinitializeOpenActions()Method called frominitialize()to initialize the Open/Open With actions.protected voidregisterHandler(String actionId, IHandler handler)Register the handler as the handler for the given action id when a merge action is performed on elements that match this groups enablement.voidsetContext(ActionContext context)Sets the context used to determine which actions are added, and what their enabled state should be.voidupdateActionBars()Updates the state of the actions added to the action bars, including any global action handlers, based on the state of theActionContext.-
Methods inherited from class org.eclipse.ui.navigator.CommonActionProvider
filterAction, getActionSite, restoreState, saveState
-
Methods inherited from class org.eclipse.ui.actions.ActionGroup
getContext
-
-
-
-
Field Detail
-
MERGE_ACTION_ID
public static final String MERGE_ACTION_ID
Action id constant for the merge action.
-
OVERWRITE_ACTION_ID
public static final String OVERWRITE_ACTION_ID
Action id constant for the merge action.
-
MARK_AS_MERGE_ACTION_ID
public static final String MARK_AS_MERGE_ACTION_ID
Action id constant for the mark-as-merge action.
-
-
Method Detail
-
init
public void init(ICommonActionExtensionSite site)
Description copied from class:CommonActionProviderInitialize the current ICommonActionProvider with the supplied information.
init() is guaranteed to be called before any other method of the ActionGroup super class.
- Overrides:
initin classCommonActionProvider- Parameters:
site- The configuration information for the instantiated Common Action Provider.
-
initialize
protected void initialize()
Method called during action provider initialization. It is invoked from theinit(ICommonActionExtensionSite)after after the configuration has been recorded. Subclasses may override. Subclasses that want to provide there own merge actions handlers can register them in this method.
-
initializeOpenActions
protected void initializeOpenActions()
Method called frominitialize()to initialize the Open/Open With actions. This method will add an Open item and Open With menu for single selections that adapt to IResource. Subclasses may override. They may still call this method, in which case they only need to handle providing open for non-files. Otherwise, if they do not call this method, they must provide all non-compare related open items.
-
getSynchronizePageConfiguration
protected final ISynchronizePageConfiguration getSynchronizePageConfiguration()
Return the configuration from the synchronize page that contains the common viewer.- Returns:
- the configuration from the synchronize page that contains the common viewer
-
getExtensionStateModel
protected final IExtensionStateModel getExtensionStateModel()
Return the extension state model for the content provider associated with action provider.- Returns:
- the extension state model for the content provider associated with action provider
-
getSynchronizationContext
protected final ISynchronizationContext getSynchronizationContext()
Return the synchronization context to which the actions of this provider apply.- Returns:
- the synchronization context to which the actions of this provider apply
-
registerHandler
protected void registerHandler(String actionId, IHandler handler)
Register the handler as the handler for the given action id when a merge action is performed on elements that match this groups enablement.- Parameters:
actionId- the id of the merge actionhandler- the handler for elements of the model that provided this group
-
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 classActionGroup- Parameters:
menu- the context menu manager
-
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 classActionGroup- Parameters:
actionBars- the part's action bars
-
updateActionBars
public void updateActionBars()
Description copied from class:ActionGroupUpdates the state of the actions added to the action bars, including any global action handlers, based on the state of theActionContext.The default implementation does nothing. Subclasses may override or extend this method.
- Overrides:
updateActionBarsin classActionGroup
-
setContext
public void setContext(ActionContext context)
Description copied from class:ActionGroupSets the context used to determine which actions are added, and what their enabled state should be.- Overrides:
setContextin classActionGroup- Parameters:
context- the context to use
-
dispose
public void dispose()
Description copied from class:ActionGroupThis method is called by the user of an action group to signal that the group is no longer needed. Subclasses typically implement this method to deregister any listeners or to free other resources.The default implementation calls
setContext(null). Subclasses may extend this method.- Overrides:
disposein classActionGroup
-
getExtensionSite
public ICommonActionExtensionSite getExtensionSite()
Return the extension site for this action provider. This method just callsCommonActionProvider.getActionSite().- Returns:
- the extension site for this action provider
-
-