public class SynchronizationActionProvider extends CommonActionProvider
initialize()
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 the fillActionBars(IActionBars)
method.
This class may be subclasses by clients.
MergeActionHandler
Modifier and Type | Field and Description |
---|---|
static String |
MARK_AS_MERGE_ACTION_ID
Action id constant for the mark-as-merge action.
|
static String |
MERGE_ACTION_ID
Action id constant for the merge action.
|
static String |
OVERWRITE_ACTION_ID
Action id constant for the merge action.
|
Constructor and Description |
---|
SynchronizationActionProvider() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This method is called by the user of an action group to signal that the group is
no longer needed.
|
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 . |
ICommonActionExtensionSite |
getExtensionSite()
Return the extension site for this action provider.
|
protected IExtensionStateModel |
getExtensionStateModel()
Return the extension state model for the content provider associated with
action provider.
|
protected ISynchronizationContext |
getSynchronizationContext()
Return the synchronization context to which the actions of this provider
apply.
|
protected ISynchronizePageConfiguration |
getSynchronizePageConfiguration()
Return the configuration from the synchronize page that contains
the common viewer.
|
void |
init(ICommonActionExtensionSite site)
Initialize the current ICommonActionProvider with the supplied
information.
|
protected void |
initialize()
Method called during action provider initialization.
|
protected void |
initializeOpenActions()
Method called from
initialize() to initialize the Open/Open With
actions. |
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.
|
void |
setContext(ActionContext context)
Sets the context used to determine which actions are added,
and what their enabled state should be.
|
void |
updateActionBars()
Updates the state of the actions added to the action bars,
including any global action handlers,
based on the state of the
ActionContext . |
filterAction, getActionSite, restoreState, saveState
getContext
public static final String MERGE_ACTION_ID
public static final String OVERWRITE_ACTION_ID
public static final String MARK_AS_MERGE_ACTION_ID
public void init(ICommonActionExtensionSite site)
CommonActionProvider
Initialize the current ICommonActionProvider with the supplied information.
init() is guaranteed to be called before any other method of the ActionGroup super class.
init
in class CommonActionProvider
site
- The configuration information for the instantiated Common
Action Provider.protected void initialize()
init(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.protected void initializeOpenActions()
initialize()
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.protected final ISynchronizePageConfiguration getSynchronizePageConfiguration()
protected final IExtensionStateModel getExtensionStateModel()
protected final ISynchronizationContext getSynchronizationContext()
protected void registerHandler(String actionId, IHandler handler)
actionId
- the id of the merge actionhandler
- the handler for elements of the model that provided this grouppublic 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 barspublic void updateActionBars()
ActionGroup
ActionContext
.
The default implementation does nothing. Subclasses may override or extend this method.
updateActionBars
in class ActionGroup
public void setContext(ActionContext context)
ActionGroup
setContext
in class ActionGroup
context
- the context to usepublic void dispose()
ActionGroup
The default implementation calls setContext(null)
.
Subclasses may extend this method.
dispose
in class ActionGroup
public ICommonActionExtensionSite getExtensionSite()
CommonActionProvider.getActionSite()
.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.