|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.ui.actions.BaseSelectionListenerAction
org.eclipse.team.ui.synchronize.ModelParticipantAction
Model provider actions for use with a ModelSynchronizeParticipant
.
Field Summary |
---|
Fields inherited from interface org.eclipse.jface.action.IAction |
---|
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT |
Constructor Summary | |
---|---|
ModelParticipantAction(String text,
ISynchronizePageConfiguration configuration)
Create the model participant action. |
Method Summary | |
---|---|
protected SaveableComparison |
getActiveSaveable()
Return the currently active saveable. |
protected ISynchronizePageConfiguration |
getConfiguration()
Return the page configuration. |
protected ISynchronizationContext |
getSynchronizationContext()
Return the synchronization context associated with this action. |
protected SaveableComparison |
getTargetSaveable()
Return the saveable that is the target of this operation. |
protected void |
handleTargetSaveableChange()
Check to see if the target saveable differs from the currently active saveable. |
static void |
handleTargetSaveableChange(Shell shell,
SaveableComparison targetSaveable,
SaveableComparison activeSaveable,
boolean allowCancel,
IProgressMonitor monitor)
Convenience method that prompts if the currently active saveable is dirty and either saves or reverts the saveable depending on the users input. |
protected abstract boolean |
isEnabledForSelection(IStructuredSelection selection)
Return whether the action is enabled for the given selection |
protected boolean |
isVisible(IDiff node)
Return whether the given node is visible in the page based on the mode in the configuration. |
static boolean |
promptToSaveChanges(Shell shell,
SaveableComparison saveable,
boolean allowCancel)
Convenience method that prompts to save changes in the given dirty model. |
void |
selectionChanged(ISelection selection)
Set the selection of this action to the given selection |
protected void |
setActiveSaveable(SaveableComparison saveable)
Set the active saveable. |
void |
updateEnablement()
Method called when the action is about to be shown in a context menu. |
protected boolean |
updateSelection(IStructuredSelection selection)
Updates this action in response to the given selection. |
Methods inherited from class org.eclipse.ui.actions.BaseSelectionListenerAction |
---|
clearCache, getStructuredSelection, runWithEvent, selectionChanged, selectionChanged |
Methods inherited from class org.eclipse.jface.action.AbstractAction |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener |
Methods inherited from class org.eclipse.core.commands.common.EventManager |
---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.action.IAction |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
public ModelParticipantAction(String text, ISynchronizePageConfiguration configuration)
text
- the label of the action or null
configuration
- the configuration for the page that is surfacing the actionMethod Detail |
protected ISynchronizePageConfiguration getConfiguration()
public void selectionChanged(ISelection selection)
selection
- the selectionprotected boolean updateSelection(IStructuredSelection selection)
BaseSelectionListenerAction
The BaseSelectionListenerAction
implementation of this method
returns true
. Subclasses may extend to react to selection
changes; however, if the super method returns false
, the
overriding method must also return false
.
updateSelection
in class BaseSelectionListenerAction
selection
- the new selection
true
if the action should be enabled for this selection,
and false
otherwiseprotected abstract boolean isEnabledForSelection(IStructuredSelection selection)
selection
- the selection
protected ISynchronizationContext getSynchronizationContext()
protected boolean isVisible(IDiff node)
node
- a diff node
protected void handleTargetSaveableChange() throws InvocationTargetException, InterruptedException
InterruptedException
InvocationTargetException
public static void handleTargetSaveableChange(Shell shell, SaveableComparison targetSaveable, SaveableComparison activeSaveable, boolean allowCancel, IProgressMonitor monitor) throws CoreException, InterruptedException
shell
- a parent shelltargetSaveable
- the new saveableactiveSaveable
- the current saveableallowCancel
- whether canceling the action is an optionmonitor
- a progress monitor
CoreException
InterruptedException
public static boolean promptToSaveChanges(Shell shell, SaveableComparison saveable, boolean allowCancel) throws InterruptedException
shell
- a shellsaveable
- a dirty saveable modelallowCancel
- whether canceling the action is an option
true
) or revert (false
() the model
InterruptedException
- thrown if the user choose to cancelprotected SaveableComparison getActiveSaveable()
null
if
no buffer is active).protected void setActiveSaveable(SaveableComparison saveable)
saveable
- the saveable that is now active (or null
if
no saveable is active).protected SaveableComparison getTargetSaveable()
null
is returned.
public void updateEnablement()
|
Eclipse Platform Release 3.2 |
|||||||||||
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, 2006. All rights reserved.