|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A synchronize participant is a visual component that can be displayed within any control (e.g. view, editor, dialog). Typically a participant is used to show changes between local resources and variant states of those resources and allows the user to perform actions to manipulate the changes.
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. That is possible by
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.
Clients are not intended to implement this interface. Instead, subclass AbstractSynchronizeParticipant
.
ISynchronizeView
,
ISynchronizeManager
,
AbstractSynchronizeParticipant
Method Summary | |
---|---|
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 |
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. |
Methods inherited from interface org.eclipse.core.runtime.IExecutableExtension |
---|
setInitializationData |
Method Detail |
public String getId()
public String getSecondaryId()
null
if this participant doesn't support
multiple instances.public String getName()
public ImageDescriptor getImageDescriptor()
null
if none.
null
if nonepublic boolean isPinned()
true
if this participant is pinned and false
otherwise.public void setPinned(boolean pinned)
pinned
- sets if the participant is pinned.public ISynchronizePageConfiguration createPageConfiguration()
createPage(ISynchronizePageConfiguration)
is called and as such
can be used to pre-configure visual properties of the displayed page.
public IPageBookViewPage createPage(ISynchronizePageConfiguration configuration)
ISynchronizePageSite
.
configuration
- used to initialize the page
public void 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.public 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 state
PartInitException
- if this participant was not initialized
successfullypublic void 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).
public 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 statepublic void 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 listenerpublic void removePropertyChangeListener(IPropertyChangeListener listener)
listener
- a property listenerpublic void 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 configuration
TeamException
- if an error occurred that should prevent the display of the compare editor containing
the elementpublic PreferencePage[] getPreferencePages()
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.