Class AbstractSynchronizeParticipant
- All Implemented Interfaces:
- IAdaptable,- IExecutableExtension,- ISynchronizeParticipant
- Direct Known Subclasses:
- ModelSynchronizeParticipant,- SubscriberParticipant
ISynchronizeParticipant.
 This class provides lifecycle support and hooks for configuration of synchronize view pages.
- Since:
- 3.0
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected IConfigurationElementstatic final StringProperty key used in the property change event fired when the pinned state of a participant changes.static final StringProperty key used in the property change event fired when the participants refresh schedule changes.Fields inherited from interface org.eclipse.team.ui.synchronize.ISynchronizeParticipantP_CONTENT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a listener for changes to properties of this synchronize participant.Creates the configuration for the participant page.booleanReturn whether this participant can be refreshed.booleanvoidfirePropertyChange(Object source, String property, Object oldValue, Object newValue) Notify all listeners that the given property has changed.Returns the help context id of this participant or value ofIHelpContextIds.SYNC_VIEWwhen no specific id has been provided.getId()Returns the unique id that identified the type of this synchronize participant.Returns an image descriptor for this synchronize participant, ornullif none.getName()Returns the name of this synchronize participant.Return the list of preference pages that are associated with this participantReturns the instance id that identified the unique instance of this participant.inthashCode()voidClasses that are persisted must override this method and perform the following initialization.protected abstract voidinitializeConfiguration(ISynchronizePageConfiguration configuration) This method is invoked after a page configuration is created but before it is returned by thecreatePageConfigurationmethod.final booleanisPinned()Returns if this participant is pinned.protected booleanReturn whether this participant supports the contribution of actions to the context menu by contributing aviewerContributionto theorg.eclipse.ui.popupMenusextension point.protected voidpinned(boolean pinned) Called when the pinned state is changed.voidprepareCompareInput(ISynchronizeModelElement element, CompareConfiguration config, IProgressMonitor monitor) Default implementation will update the labels in the given configuration using information from the provided element if it adapts toSyncInfo.voidRemoves the given property listener from this synchronize participant.voidSaves the participants object state within the memento.protected voidsetImageDescriptor(ImageDescriptor imageDescriptor) Sets the image descriptor for this participant to the specified value and notifies property listeners of the change.voidsetInitializationData(IConfigurationElement config, String propertyName, Object data) This method is called by the implementation of the methodIConfigurationElement.createExecutableExtensionon a newly constructed extension, passing it its relevant configuration information.protected voidprotected voidSets the name of this participant to the specified value and notifies property listeners of the change.final voidsetPinned(boolean pinned) Sets whether this participant is pinned.protected voidsetSecondaryId(String secondaryId) Sets the secondary id for this participant.Methods inherited from class org.eclipse.core.runtime.PlatformObjectgetAdapterMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptablegetAdapterMethods inherited from interface org.eclipse.team.ui.synchronize.ISynchronizeParticipantcreatePage, dispose, run
- 
Field Details- 
P_PINNEDProperty key used in the property change event fired when the pinned state of a participant changes.- See Also:
 
- 
P_SCHEDULEDProperty key used in the property change event fired when the participants refresh schedule changes.- Since:
- 3.2
- See Also:
 
- 
configElement
 
- 
- 
Constructor Details- 
AbstractSynchronizeParticipantpublic AbstractSynchronizeParticipant()Default constructor is a no-op. Subclasses that are persistable must support a no-arg constructor and
 
- 
- 
Method Details- 
getNameDescription copied from interface:ISynchronizeParticipantReturns the name of this synchronize participant. This name is displayed to the user.- Specified by:
- getNamein interface- ISynchronizeParticipant
- Returns:
- the name of this synchronize participant
 
- 
getImageDescriptorDescription copied from interface:ISynchronizeParticipantReturns an image descriptor for this synchronize participant, ornullif none.- Specified by:
- getImageDescriptorin interface- ISynchronizeParticipant
- Returns:
- an image descriptor for this synchronize participant, or nullif none
 
- 
getIdDescription copied from interface:ISynchronizeParticipantReturns the unique id that identified the type of this synchronize participant. The synchronize manager supports registering several instances of the same participant type.- Specified by:
- getIdin interface- ISynchronizeParticipant
- Returns:
- the unique id that identified the type of this synchronize participant.
 
- 
getSecondaryIdDescription copied from interface:ISynchronizeParticipantReturns the instance id that identified the unique instance of this participant. The synchronize manager supports registering several instances of the same participant type and this id is used to differentiate between them.- Specified by:
- getSecondaryIdin interface- ISynchronizeParticipant
- Returns:
- the instance id that identified the unique instance of this
 participant or nullif this participant doesn't support multiple instances.
 
- 
getHelpContextIdReturns the help context id of this participant or value ofIHelpContextIds.SYNC_VIEWwhen no specific id has been provided.- Specified by:
- getHelpContextIdin interface- ISynchronizeParticipant
- Returns:
- the help context id of this participant
- Since:
- 3.5
- See Also:
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
 
- 
setPinnedpublic final void setPinned(boolean pinned) Description copied from interface:ISynchronizeParticipantSets whether this participant is pinned.- Specified by:
- setPinnedin interface- ISynchronizeParticipant
- Parameters:
- pinned- sets if the participant is pinned.
 
- 
isPinnedpublic final boolean isPinned()Description copied from interface:ISynchronizeParticipantReturns if this participant is pinned. Pinned participants will only be removed from the synchronize manager until they are un-pinned.- Specified by:
- isPinnedin interface- ISynchronizeParticipant
- Returns:
- trueif this participant is pinned and- falseotherwise.
 
- 
pinnedprotected void pinned(boolean pinned) Called when the pinned state is changed. Allows subclasses to react to pin state changes.- Parameters:
- pinned- whether the participant is pinned.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
doesSupportSynchronizepublic boolean doesSupportSynchronize()Return whether this participant can be refreshed. Participants that can be refreshed may have a Synchronize menu item contributed to their context menu and can also be refreshed from the Synchronize drop-down toolbar item. When refreshed from the toolbar item, theISynchronizeParticipant.run(org.eclipse.ui.IWorkbenchPart)method is called.- Returns:
- whether this participant can be refreshed
 
- 
addPropertyChangeListenerDescription copied from interface:ISynchronizeParticipantAdds a listener for changes to properties of this synchronize participant. Has no effect if an identical listener is already registered.The changes supported by the synchronize view are as follows: - IBasicPropertyConstants.P_TEXT- indicates the name of a synchronize participant has changed
- IBasicPropertyConstants.P_IMAGE- indicates the image of a synchronize participant has changed
 Clients may define additional properties as required. - Specified by:
- addPropertyChangeListenerin interface- ISynchronizeParticipant
- Parameters:
- listener- a property change listener
 
- 
removePropertyChangeListenerDescription copied from interface:ISynchronizeParticipantRemoves the given property listener from this synchronize participant. Has no effect if an identical listener is not already registered.- Specified by:
- removePropertyChangeListenerin interface- ISynchronizeParticipant
- Parameters:
- listener- a property listener
 
- 
firePropertyChangeNotify all listeners that the given property has changed.- Parameters:
- source- the object on which a property has changed
- property- identifier of the property that has changed
- oldValue- the old value of the property, or- null
- newValue- the new value of the property, or- null
 
- 
setInitializationDatapublic void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException Description copied from interface:IExecutableExtensionThis method is called by the implementation of the methodIConfigurationElement.createExecutableExtensionon a newly constructed extension, passing it its relevant configuration information. Most executable extensions only make use of the first two call arguments.Regular executable extensions specify their Java implementation class name as an attribute of the configuration element for the extension. For example <action run="com.example.BaseAction"/>In the above example, this method would be called with a reference to the <action>element (first argument), and"run"as the name of the attribute that defined this executable extension (second argument).The last parameter is for the specific use of extension adapters and is typically not used by regular executable extensions. There are two supported ways of associating additional adapter-specific data with the configuration in a way that is transparent to the extension point implementor: (1) by specifying adapter data as part of the implementation class attribute value. The Java class name can be followed by a ":" separator, followed by any adapter data in string form. For example, if the extension point specifies an attribute "run"to contain the name of the extension implementation, an adapter can be configured as<action run="com.example.ExternalAdapter:./cmds/util.exe -opt 3"/>(2) by converting the attribute used to specify the executable extension to a child element of the original configuration element, and specifying the adapter data in the form of xml markup. Using this form, the example above would become <action> <run class="com.xyz.ExternalAdapter"> <parameter name="exec" value="./cmds/util.exe"/> <parameter name="opt" value="3"/> </run> </action>Form (2) will typically only be used for extension points that anticipate the majority of extensions configured into it will in fact be in the form of adapters. In either case, the specified adapter class is instantiated using its 0-argument public constructor. The adapter data is passed as the last argument of this method. The data argument is defined as Object. It can have the following values: - null, if no adapter data was supplied
- in case (1), the initialization data string is passed as a
 String
- in case (2), the initialization data is passed as a
 Hashtablecontaining the actual parameter names and values (bothStrings)
 - Specified by:
- setInitializationDatain interface- IExecutableExtension
- Parameters:
- config- the configuration element used to trigger this execution. It can be queried by the executable extension for specific configuration properties
- propertyName- the name of an attribute of the configuration element used on the- createExecutableExtension(String)call. This argument can be used in the cases where a single configuration element is used to define multiple executable extensions.
- data- adapter data in the form of a- String, a- Hashtable, or- null.
- Throws:
- CoreException- if error(s) detected during initialization processing
- See Also:
 
- 
setInitializationDataprotected void setInitializationData(ISynchronizeParticipantDescriptor descriptor) throws CoreException - Throws:
- CoreException
 
- 
setNameSets the name of this participant to the specified value and notifies property listeners of the change.- Parameters:
- name- the new name
 
- 
setImageDescriptorSets the image descriptor for this participant to the specified value and notifies property listeners of the change.- Parameters:
- imageDescriptor- the new image descriptor
 
- 
setSecondaryIdSets the secondary id for this participant.- Parameters:
- secondaryId- the secondary id for this participant.
 
- 
initClasses that are persisted must override this method and perform the following initialization.super.init(secondaryId, memento); try { ISynchronizeParticipantDescriptor descriptor = TeamUI.getSynchronizeManager().getParticipantDescriptor(PARTICIPANT_ID); setInitializationData(descriptor); } catch (CoreException e) { TeamUIPlugin.log(e); }wherePARTICIPANT_IDis the id of the participant as defined in the plugin manifest.- Specified by:
- initin interface- ISynchronizeParticipant
- Parameters:
- secondaryId- the secondayId of this participant instance or- nullif this participant doesn't support multiple instances.
- memento- the participant state or- nullif there is no previous saved state
- Throws:
- PartInitException- if this participant was not initialized successfully
- See Also:
 
- 
saveStateDescription copied from interface:ISynchronizeParticipantSaves the participants object state within the memento. This state will be available when the participant is restored viainit.This method can be called multiple times during the lifetime of the participant object. - Specified by:
- saveStatein interface- ISynchronizeParticipant
- Parameters:
- memento- a memento to receive the object state
 
- 
createPageConfigurationDescription copied from interface:ISynchronizeParticipantCreates the configuration for the participant page. The configuration controls the options for displaying the participant. The configuration used to initialize the page whenISynchronizeParticipant.createPage(ISynchronizePageConfiguration)is called and as such can be used to pre-configure visual properties of the displayed page.- Specified by:
- createPageConfigurationin interface- ISynchronizeParticipant
- Returns:
- the configuration for the participant page.
 
- 
initializeConfigurationThis method is invoked after a page configuration is created but before it is returned by thecreatePageConfigurationmethod. Subclasses can implement this method to tailor the configuration in ways appropriate to the participant.- Parameters:
- configuration- the newly create page configuration
 
- 
prepareCompareInputpublic void prepareCompareInput(ISynchronizeModelElement element, CompareConfiguration config, IProgressMonitor monitor) throws TeamException Default implementation will update the labels in the given configuration using information from the provided element if it adapts toSyncInfo. It will also cache the contents for the remote and base if the element is sync info based.- Specified by:
- prepareCompareInputin interface- ISynchronizeParticipant
- Parameters:
- element- the sync model element whose contents are about to be displayed to the user in a compare editor or compare dialog
- config- the compare configuration that will be used to configure the compare editor or dialog
- monitor- a progress monitor that can be used if contacting a server to prepare the element and configuration
- Throws:
- TeamException- if an error occurred that should prevent the display of the compare editor containing the element
- Since:
- 3.1
- See Also:
 
- 
getPreferencePagesDescription copied from interface:ISynchronizeParticipantReturn the list of preference pages that are associated with this participant- Specified by:
- getPreferencePagesin interface- ISynchronizeParticipant
- Returns:
- the list of preference pages that are associated with this participant
 
- 
isViewerContributionsSupportedprotected boolean isViewerContributionsSupported()Return whether this participant supports the contribution of actions to the context menu by contributing aviewerContributionto theorg.eclipse.ui.popupMenusextension point. By default,falseis returned. If a subclasses overrides to returntrue, theidof the participant is used as thetargetId. Here is an extension that could be added to the plugin manifest to contribute an action to the context menu for a participant<extension point="org.eclipse.ui.popupMenus"> <viewerContribution id="org.eclipse.team.cvs.ui.viewContributionId" targetID="org.eclipse.team.cvs.ui.cvsworkspace-participant"> <action label="Add" menubarPath="additions" tooltip="Add a file to CVS version control" class="org.eclipse.team.internal.ccvs.ui.actions.AddAction" helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_add" id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.add"> </action> </viewerContribution> </extension>- Returns:
- whether this participant supports the contribution of actions to
 the context menu using the org.eclipse.ui.popupMenusextension point
- Since:
- 3.1
 
 
-