public interface ISynchronizeParticipant extends IExecutableExtension, IAdaptable
This class does not mandate how the synchronization state is displayed, but instead provides the accessors that clients would use to create a visual instance of the this participant.
A participant can display multiple instances of its synchronization state to the user via the creation
of a page createPage(ISynchronizePageConfiguration)
and
clients can decide where to display the page. For example, the synchronize view is an example
of a client that displays a participant in a view. However, you can imagine that a client may
also want to display this state in a wizard or dialog instead.
When a participant is registered with the ISynchronizeManager
it will automatically display
in the Synchronize View and if the participant extension point
enabled synchronizeWizards
it will also appear in the global synchronize action
toolbar.
A participant is added to the workbench as follows:
synchronizeParticipant
extension is contributed to
the team registry. This extension defines the participant id, name, icon, type, and
participant class.
synchronizeWizards
extension point
or client code, creates a participant instance and registers it with the
synchronize manager. It then appears in the synchronize view.
Once a participant is added to the synchronize manager its lifecycle will be managed. On shutdown if
the participant is persistable, the participant will be asked to persist state via
the saveState()
method. At startup the init()
method is called
with a handle to the state that was saved. The dispose method is called when the participant is
removed from the manager and at shutdown.
ISynchronizeView
,
ISynchronizeManager
,
AbstractSynchronizeParticipant
AbstractSynchronizeParticipant
.Modifier and Type | Field and Description |
---|---|
static String |
P_CONTENT
A property constant that can be used to indicate that the content of this participant
has changed.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(IPropertyChangeListener listener)
Adds a listener for changes to properties of this synchronize
participant.
|
IPageBookViewPage |
createPage(ISynchronizePageConfiguration configuration)
Creates and returns a new page for this synchronize participant.
|
ISynchronizePageConfiguration |
createPageConfiguration()
Creates the configuration for the participant page.
|
void |
dispose()
Disposes of this synchronize participant and is called to free the
resources associated with a participant.
|
String |
getHelpContextId()
Returns the help context id of this participant.
|
String |
getId()
Returns the unique id that identified the type of this
synchronize participant.
|
ImageDescriptor |
getImageDescriptor()
Returns an image descriptor for this synchronize participant, or
null
if none. |
String |
getName()
Returns the name of this synchronize participant.
|
PreferencePage[] |
getPreferencePages()
Return the list of preference pages that are associated with this participant
|
String |
getSecondaryId()
Returns the instance id that identified the unique instance of this
participant.
|
void |
init(String secondaryId,
IMemento memento)
Initializes this participant with the given participant state.
|
boolean |
isPinned()
Returns if this participant is pinned.
|
void |
prepareCompareInput(ISynchronizeModelElement element,
CompareConfiguration configuration,
IProgressMonitor monitor)
Prepare the given element and compare configuration for use with a compare editor
input.
|
void |
removePropertyChangeListener(IPropertyChangeListener listener)
Removes the given property listener from this synchronize participant.
|
void |
run(IWorkbenchPart part)
Runs the participants action.
|
void |
saveState(IMemento memento)
Saves the participants object state within the memento.
|
void |
setPinned(boolean pinned)
Sets whether this participant is pinned.
|
setInitializationData
getAdapter
static final String P_CONTENT
String getId()
String getSecondaryId()
null
if this participant doesn't support
multiple instances.String getName()
ImageDescriptor getImageDescriptor()
null
if none.null
if noneboolean isPinned()
true
if this participant is pinned and false
otherwise.void setPinned(boolean pinned)
pinned
- sets if the participant is pinned.ISynchronizePageConfiguration createPageConfiguration()
createPage(ISynchronizePageConfiguration)
is called and as such
can be used to pre-configure visual properties of the displayed page.IPageBookViewPage createPage(ISynchronizePageConfiguration configuration)
ISynchronizePageSite
.configuration
- used to initialize the pagevoid run(IWorkbenchPart part)
part
- the part in which the action is run or null
if the action
is not being run in a workbench part.void init(String secondaryId, IMemento memento) throws PartInitException
This method is automatically called by the team plugin shortly after participant construction. It marks the start of the views lifecycle. Clients must not call this method.
secondaryId
- the secondayId of this participant instance or null
if this participant doesn't support multiple instances.memento
- the participant state or null
if there
is no previous saved statePartInitException
- if this participant was not initialized
successfullyvoid dispose()
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).
void saveState(IMemento memento)
init
.
This method can be called multiple times during the lifetime of the participant object.
memento
- a memento to receive the object statevoid addPropertyChangeListener(IPropertyChangeListener listener)
The changes supported by the synchronize view are as follows:
IBasicPropertyConstants.P_TEXT
- indicates the name
of a synchronize participant has changedIBasicPropertyConstants.P_IMAGE
- indicates the
image of a synchronize participant has changedClients may define additional properties as required.
listener
- a property change listenervoid removePropertyChangeListener(IPropertyChangeListener listener)
listener
- a property listenervoid prepareCompareInput(ISynchronizeModelElement element, CompareConfiguration configuration, IProgressMonitor monitor) throws TeamException
element
- the sync model element whose contents are about to be displayed to the user
in a compare editor or compare dialogconfiguration
- the compare configuration that will be used to configure the compare editor or dialogmonitor
- a progress monitor that can be used if contacting a server to prepare the element and configurationTeamException
- if an error occurred that should prevent the display of the compare editor containing
the elementPreferencePage[] getPreferencePages()
String getHelpContextId()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.