|
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.runtime.PlatformObject
org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant
org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant
Synchronize participant that obtains it's synchronization state from
a ISynchronizationContext
.
This class may be subclassed by clients.
Field Summary | |
---|---|
static String |
ALL_MODEL_PROVIDERS_VISIBLE
Constant used with the P_ACTIVE_MODEL_PROVIDER property to indicate
that all enabled model providers are active. |
static String |
P_VISIBLE_MODEL_PROVIDER
Property constant used to store and retrieve the id of the active ModelProvider from an ISynchronizePageConfiguration . |
static String |
PROP_ACTIVE_SAVEABLE
Property constant used during property change notification to indicate that the active model of this participant has changed. |
static String |
PROP_DIRTY
Property constant used during property change notification to indicate that the dirty state for the active saveable model of this participant has changed. |
static String |
PROP_ENABLED_MODEL_PROVIDERS
Property constant used during property change notification to indicate that the enabled model providers for this participant have changed. |
protected org.eclipse.team.internal.ui.synchronize.SubscriberRefreshSchedule |
refreshSchedule
|
Fields inherited from class org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant |
---|
configElement, P_PINNED, P_SCHEDULED |
Constructor Summary | |
---|---|
ModelSynchronizeParticipant()
Create a participant in order to restore it from saved state. |
|
ModelSynchronizeParticipant(SynchronizationContext context)
Create a participant for the given context |
Method Summary | |
---|---|
ICompareInput |
asCompareInput(Object object)
Return a compare input for the given model object or null
if the object is not eligible for comparison. |
boolean |
checkForBufferChange(Shell shell,
ISynchronizationCompareInput input,
boolean cancelAllowed,
IProgressMonitor monitor)
Convenience method for switching the active saveable of this participant to the saveable of the given input. |
protected ModelSynchronizeParticipantActionGroup |
createMergeActionGroup()
Create the merge action group for this participant. |
IPageBookViewPage |
createPage(ISynchronizePageConfiguration configuration)
Creates and returns a new page for this synchronize participant. |
static ModelSynchronizeParticipant |
createParticipant(SynchronizationContext context,
String name)
Create a participant for the given context |
protected ISynchronizationScopeManager |
createScopeManager(ResourceMapping[] mappings)
Create and return a scope manager that can be used to build the scope of this participant when it is restored after a restart. |
void |
dispose()
Disposes of this synchronize participant and is called to free the resources associated with a participant. |
SaveableComparison |
getActiveSaveable()
Return the active saveable for this participant. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. |
ISynchronizationContext |
getContext()
Return the synchronization context for this participant. |
ModelProvider[] |
getEnabledModelProviders()
Return the list of model providers that are enabled for the participant. |
protected String |
getLongTaskName(ResourceMapping[] mappings)
Returns the long task name to describe the behavior of the refresh operation to the user. |
String |
getName()
Returns the name of this synchronize participant. |
PreferencePage[] |
getPreferencePages()
Return the list of preference pages that are associated with this participant |
protected String |
getShortName()
Return the name of the participant as specified in the plugin manifest file. |
protected String |
getShortTaskName()
Returns the short task name (e.g. no more than 25 characters) to describe the behavior of the refresh operation to the user. |
boolean |
hasCompareInputFor(Object object)
Return whether their is a compare input associated with the given object. |
void |
init(String secondaryId,
IMemento memento)
Classes that are persisted must override this method and perform the following initialization. |
protected void |
initializeConfiguration(ISynchronizePageConfiguration configuration)
This method is invoked after a page configuration is created but before it is returned by the createPageConfiguration method. |
protected void |
initializeContext(SynchronizationContext context)
Set the context of this participant. |
boolean |
isMergingEnabled()
Return whether merge capabilities are enabled for this participant. |
void |
refresh(IWorkbenchSite site,
ResourceMapping[] mappings)
Refresh a participant in the background the result of the refresh are shown in the progress view. |
protected MergeContext |
restoreContext(ISynchronizationScopeManager manager)
Recreate the context for this participant. |
void |
run(IWorkbenchPart part)
Runs the participants action. |
void |
saveState(IMemento memento)
Saves the participants object state within the memento. |
void |
setActiveSaveable(SaveableComparison activeSaveable)
Set the active saveable of this participant. |
void |
setMergingEnabled(boolean mergingEnabled)
Set whether merge capabilities should be enabled for this participant. |
Methods inherited from class org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant |
---|
addPropertyChangeListener, createPageConfiguration, doesSupportSynchronize, equals, firePropertyChange, getId, getImageDescriptor, getSecondaryId, hashCode, isPinned, isViewerContributionsSupported, pinned, prepareCompareInput, removePropertyChangeListener, setImageDescriptor, setInitializationData, setInitializationData, setName, setPinned, setSecondaryId |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String P_VISIBLE_MODEL_PROVIDER
ModelProvider
from an ISynchronizePageConfiguration
. The
active model provider will be the only one visible in the page. If
null
or ALL_MODEL_PROVIDERS_ACTIVE
is
returned, all model providers are considered active and are visible.
public static final String ALL_MODEL_PROVIDERS_VISIBLE
P_ACTIVE_MODEL_PROVIDER
property to indicate
that all enabled model providers are active.
public static final String PROP_ENABLED_MODEL_PROVIDERS
public static final String PROP_ACTIVE_SAVEABLE
public static final String PROP_DIRTY
protected org.eclipse.team.internal.ui.synchronize.SubscriberRefreshSchedule refreshSchedule
Constructor Detail |
public ModelSynchronizeParticipant(SynchronizationContext context)
context
- the synchronization contextpublic ModelSynchronizeParticipant()
Method Detail |
public static ModelSynchronizeParticipant createParticipant(SynchronizationContext context, String name)
context
- the synchronization contextname
- the name of the participant
public String getName()
ISynchronizeParticipant
getName
in interface ISynchronizeParticipant
getName
in class AbstractSynchronizeParticipant
protected final String getShortName()
getName()
method defined in this class.
protected void initializeConfiguration(ISynchronizePageConfiguration configuration)
AbstractSynchronizeParticipant
createPageConfiguration
method. Subclasses can implement this method to
tailor the configuration in ways appropriate to the participant.
initializeConfiguration
in class AbstractSynchronizeParticipant
configuration
- the newly create page configurationprotected ModelSynchronizeParticipantActionGroup createMergeActionGroup()
public final IPageBookViewPage createPage(ISynchronizePageConfiguration configuration)
ISynchronizeParticipant
ISynchronizePageSite
.
configuration
- used to initialize the page
public void run(IWorkbenchPart part)
ISynchronizeParticipant
part
- the part in which the action is run or null
if the action
is not being run in a workbench part.public final void refresh(IWorkbenchSite site, ResourceMapping[] mappings)
site
- the workbench site the synchronize is running from. This can be used to notify the site
that a job is running.mappings
- the resource mappings to be refreshedpublic void dispose()
ISynchronizeParticipant
ISynchronizeManager
this method is called when the
manager is shutdown or the participant is removed from the manager.
Within this method a participant may release any resources, fonts, images, etc. held by this part. It is also very important to remove all listeners.
Clients should not call this method (the synchronize manager calls this method at appropriate times).
protected void initializeContext(SynchronizationContext context)
context
- the context for this participantpublic ISynchronizationContext getContext()
public ICompareInput asCompareInput(Object object)
null
if the object is not eligible for comparison.
object
- the model object
null
public boolean hasCompareInputFor(Object object)
true
if asCompareInput(Object)
would return a value and false
if it would return null
.
object
- the object.
public boolean isMergingEnabled()
public void setMergingEnabled(boolean mergingEnabled)
mergingEnabled
- whether merge capabilities should be enabled for this participantprotected String getShortTaskName()
protected String getLongTaskName(ResourceMapping[] mappings)
mappings
- the mappings being refreshed
public Object getAdapter(Class adapter)
IAdaptable
null
if
no such object can be found.
getAdapter
in interface IAdaptable
getAdapter
in class PlatformObject
adapter
- the class to adapt to
null
IAdaptable.getAdapter(Class)
,
Platform.getAdapterManager()
public void saveState(IMemento memento)
ISynchronizeParticipant
init
.
This method can be called multiple times during the lifetime of the participant object.
saveState
in interface ISynchronizeParticipant
saveState
in class AbstractSynchronizeParticipant
public void init(String secondaryId, IMemento memento) throws PartInitException
AbstractSynchronizeParticipant
super.init(secondaryId, memento); try { ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(PARTICIPANT_ID); setInitializationData(descriptor); } catch (CoreException e) { TeamUIPlugin.log(e); }where
PARTICIPANT_ID
is the id of the particant as defined in the plugin manifest.
init
in interface ISynchronizeParticipant
init
in class AbstractSynchronizeParticipant
PartInitException
ISynchronizeParticipant.init(String, org.eclipse.ui.IMemento)
protected MergeContext restoreContext(ISynchronizationScopeManager manager) throws CoreException
manager
- the restored scope
CoreException
protected ISynchronizationScopeManager createScopeManager(ResourceMapping[] mappings)
mappings
- the restored mappings
public SaveableComparison getActiveSaveable()
null
public void setActiveSaveable(SaveableComparison activeSaveable)
activeSaveable
- the active saveable (may be null
)public boolean checkForBufferChange(Shell shell, ISynchronizationCompareInput input, boolean cancelAllowed, IProgressMonitor monitor) throws CoreException
shell
- a shellinput
- the compare input about to be displayedcancelAllowed
- whether the display of the compare input can be canceledmonitor
- a progress monitor or null
if progress reporting is not required
CoreException
public ModelProvider[] getEnabledModelProviders()
public PreferencePage[] getPreferencePages()
ISynchronizeParticipant
getPreferencePages
in interface ISynchronizeParticipant
getPreferencePages
in class AbstractSynchronizeParticipant
|
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.