|
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 ISaveableCompareModel |
getActiveModel()
Return the currently active buffer. |
protected ISynchronizePageConfiguration |
getConfiguration()
Return the page configuration. |
protected ISynchronizationContext |
getSynchronizationContext()
Return the synchronization context associated with this action. |
protected ISaveableCompareModel |
getTargetModel()
Return the buffer that is the target of this operation. |
static void |
handleBufferChange(Shell shell,
ISaveableCompareModel targetModel,
ISaveableCompareModel activeModel,
boolean allowCancel,
IProgressMonitor monitor)
Convenience method that prompts if the currently active model is dirty and either saves or reverts the model depending on the users input. |
protected void |
handleModelChange()
Check to see if the target saveable mode; differs from the currently active model. |
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,
ISaveableCompareModel saveableModel,
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 |
setActiveModel(ISaveableCompareModel buffer)
Set the active buffer. |
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 nullconfiguration - the configuration for the page that is surfacing the action| Method 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 BaseSelectionListenerActionselection - 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 handleModelChange()
throws InvocationTargetException,
InterruptedException
InterruptedException
InvocationTargetException
public static void handleBufferChange(Shell shell,
ISaveableCompareModel targetModel,
ISaveableCompareModel activeModel,
boolean allowCancel,
IProgressMonitor monitor)
throws CoreException,
InterruptedException
shell - a parent shelltargetModel - the new modelactiveModel - the current modelallowCancel - whether canceling the action is an optionmonitor - a progress monitor
CoreException
InterruptedException
public static boolean promptToSaveChanges(Shell shell,
ISaveableCompareModel saveableModel,
boolean allowCancel)
throws InterruptedException
shell - a shellsaveableModel - 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 ISaveableCompareModel getActiveModel()
null if
no buffer is active).protected void setActiveModel(ISaveableCompareModel buffer)
buffer - the buffer that is now active (or null if
no buffer is active).protected ISaveableCompareModel getTargetModel()
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.