Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.team.ui.synchronize
Class AbstractSynchronizeParticipant

    java.lang.Object
      org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant

All Implemented Interfaces:
  IExecutableExtension, ISynchronizeParticipant

Direct Known Subclasses:
  SubscriberParticipant

public abstract class AbstractSynchronizeParticipant
extends Object
implements ISynchronizeParticipant

This class is the abstract base class for all synchronize view participants. Clients must subclass this class instead of directly implementing `AbstractSynchronizeParticipant`.

This class provides lifecycle support and hooks for configuration of synchronize view pages.

Since:
  3.0
See Also:
  `ISynchronizeParticipant`

Field Summary
`protected IConfigurationElement` | `configElement`
`static String` | `P_PINNED` Property key used in the property change event fired when the pinned state of a participant changes.

Constructor Summary
`AbstractSynchronizeParticipant()` Default constructor is a no-op.

Method Summary
`void` | `addPropertyChangeListener(IPropertyChangeListener listener)` Adds a listener for changes to properties of this synchronize participant.
`ISynchronizePageConfiguration` | `createPageConfiguration()` Creates the configuration for the participant page.
`boolean` | `doesSupportSynchronize()`
`boolean` | `equals(Object obj)`
`void` | `firePropertyChange(Object source, String property, Object oldValue, Object newValue)` Notify all listeners that the given property has changed.
`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.
`String` | `getSecondaryId()` Returns the instance id that identified the unique instance of this participant.
`int` | `hashCode()`
`void` | `init(String secondaryId, IMemento memento)` Classes that are persisted must override this method and perform the following initialization.
`protected abstract void` | `initializeConfiguration(ISynchronizePageConfiguration configuration)` This method is invoked after a page configuration is created but before it is returned by the `createPageConfiguration` method.
`boolean` | `isPinned()` Returns if this participant is pinned.
`protected void` | `pinned(boolean pinned)` Called when the pinned state is changed.
`void` | `removePropertyChangeListener(IPropertyChangeListener listener)` Removes the given property listener from this synchronize participant.
`void` | `saveState(IMemento memento)` Saves the participants object state within the memento.
`protected void` | `setImageDescriptor(ImageDescriptor imageDescriptor)` Sets the image descriptor for this participant to the specified value and notifies property listeners of the change.
`void` | `setInitializationData(IConfigurationElement config, String propertyName, Object data)` This method is called by the implementation of the method `IConfigurationElement.createExecutableExtension` on a newly constructed extension, passing it its relevant configuration information.
`protected void` | `setInitializationData(ISynchronizeParticipantDescriptor descriptor)`
`protected void` | `setName(String name)` Sets the name of this participant to the specified value and notifies property listeners of the change.
`void` | `setPinned(boolean pinned)` Sets whether this participant is pinned.
`protected void` | `setSecondaryId(String secondaryId)` Sets the secondary id for this participant.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.eclipse.team.ui.synchronize.ISynchronizeParticipant
`createPage, dispose, run`

Field Detail

### P_PINNED

    public static final String P_PINNED

  Property key used in the property change event fired when the pinned state of a participant changes.

  See Also:
    Constant Field Values

### configElement

    protected IConfigurationElement configElement

Constructor Detail

### AbstractSynchronizeParticipant

    public AbstractSynchronizeParticipant()

  Default constructor is a no-op. Subclasses that are persistable must support a no-arg constructor and

Method Detail

### getName

    public String getName()

  Description copied from interface: `ISynchronizeParticipant`
  Returns the name of this synchronize participant. This name is displayed to the user.

  Specified by:
    `getName` in interface `ISynchronizeParticipant`
  Returns:
    the name of this synchronize participant

### getImageDescriptor

    public ImageDescriptor getImageDescriptor()

  Description copied from interface: `ISynchronizeParticipant`
  Returns an image descriptor for this synchronize participant, or `null` if none.

  Specified by:
    `getImageDescriptor` in interface `ISynchronizeParticipant`
  Returns:
    an image descriptor for this synchronize participant, or `null` if none

### getId

    public String getId()

  Description copied from interface: `ISynchronizeParticipant`
  Returns 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:
    `getId` in interface `ISynchronizeParticipant`
  Returns:
    the unique id that identified the type of this synchronize participant.

### getSecondaryId

    public String getSecondaryId()

  Description copied from interface: `ISynchronizeParticipant`
  Returns 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:
    `getSecondaryId` in interface `ISynchronizeParticipant`
  Returns:
    the instance id that identified the unique instance of this participant or `null` if this participant doesn't support multiple instances.

### setPinned

    public final void setPinned(boolean pinned)

  Description copied from interface: `ISynchronizeParticipant`
  Sets whether this participant is pinned.

  Specified by:
    `setPinned` in interface `ISynchronizeParticipant`
  Parameters:
    `pinned` - sets if the participant is pinned.

### isPinned

    public final boolean isPinned()

  Description copied from interface: `ISynchronizeParticipant`
  Returns if this participant is pinned. Pinned participants will only be removed from the synchronize manager until they are un-pinned.

  Specified by:
    `isPinned` in interface `ISynchronizeParticipant`
  Returns:
    `true` if this participant is pinned and `false` otherwise.

### pinned

    protected 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

    public boolean equals(Object obj)

### hashCode

    public int hashCode()

### doesSupportSynchronize

    public boolean doesSupportSynchronize()

### addPropertyChangeListener

    public void addPropertyChangeListener(IPropertyChangeListener listener)

  Description copied from interface: `ISynchronizeParticipant`
  Adds 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:
    `addPropertyChangeListener` in interface `ISynchronizeParticipant`
  Parameters:
    `listener` - a property change listener

### removePropertyChangeListener

    public void removePropertyChangeListener(IPropertyChangeListener listener)

  Description copied from interface: `ISynchronizeParticipant`
  Removes the given property listener from this synchronize participant. Has no effect if an identical listener is not alread registered.

  Specified by:
    `removePropertyChangeListener` in interface `ISynchronizeParticipant`
  Parameters:
    `listener` - a property listener

### firePropertyChange

    public void firePropertyChange(Object source,
                                   String property,
                                   Object oldValue,
                                   Object newValue)

  Notify 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`

### setInitializationData

    public void setInitializationData(IConfigurationElement config,
                                      String propertyName,
                                      Object data)
                               throws CoreException

  Description copied from interface: `IExecutableExtension`
  This method is called by the implementation of the method `IConfigurationElement.createExecutableExtension` on 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 `Hashtable` containing the actual parameter names and values (both `String`s)

  Specified by:
    `setInitializationData` in 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:
    `IConfigurationElement.createExecutableExtension(String)`

### setInitializationData

    protected void setInitializationData(ISynchronizeParticipantDescriptor descriptor)
                                  throws CoreException

  Throws:
    `CoreException`

### setName

    protected void setName(String name)

  Sets the name of this participant to the specified value and notifies property listeners of the change.

  Parameters:
    `name` - the new name

### setImageDescriptor

    protected void setImageDescriptor(ImageDescriptor imageDescriptor)

  Sets the image descriptor for this participant to the specified value and notifies property listeners of the change.

  Parameters:
    `imageDescriptor` - the new image descriptor

### setSecondaryId

    protected void setSecondaryId(String secondaryId)

  Sets the secondary id for this participant.

  Parameters:
    `secondaryId` - the secondary id for this participant.

### init

    public void init(String secondaryId,
                     IMemento memento)
              throws PartInitException

  Classes 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);
      		}

  where `PARTICIPANT_ID` is the id of the particant as defined in the plugin manifest.

  Specified by:
    `init` in interface `ISynchronizeParticipant`
  Parameters:
    `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
  Throws:
    `PartInitException` - if this participant was not initialized successfully
  See Also:
    `ISynchronizeParticipant.init(String, org.eclipse.ui.IMemento)`

### saveState

    public void saveState(IMemento memento)

  Description copied from interface: `ISynchronizeParticipant`
  Saves the participants object state within the memento. This state will be available when the participant is restored via `init`.

  This method can be called multiple times during the lifetime of the participant object.

  Specified by:
    `saveState` in interface `ISynchronizeParticipant`
  Parameters:
    `memento` - a memento to receive the object state

### createPageConfiguration

    public final ISynchronizePageConfiguration createPageConfiguration()

  Description copied from interface: `ISynchronizeParticipant`
  Creates the configuration for the participant page. The configuration controls the options for displaying the participant. The configuration used to initialize the page when `ISynchronizeParticipant.createPage(ISynchronizePageConfiguration)` is called and as such can be used to pre-configure visual properties of the displayed page.

  Specified by:
    `createPageConfiguration` in interface `ISynchronizeParticipant`
  Returns:
    the configuration for the participant page.

### initializeConfiguration

    protected abstract void initializeConfiguration(ISynchronizePageConfiguration configuration)

  This method is invoked after a page configuration is created but before it is returned by the `createPageConfiguration` method. Subclasses can implement this method to tailor the configuration in ways appropriate to the participant.

  Parameters:
    `configuration` - the newly create page configuration

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
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, 2004. All rights reserved.