TPTP 4.6.0 Platform Project
Public API Specification

org.eclipse.hyades.ui.extension
Interface IAssociationMappingRegistry

All Superinterfaces:
IDisposable

public interface IAssociationMappingRegistry
extends IDisposable

This interface is not intended to be implemented by clients. Instances can be obtained by org.eclipse.hyades.ui.TPTPUI#createAssociationMappingRegistry().


Field Summary
static int PROP_CONTENTS
          Property id used to notify listeners that the content of a registry has changed.
 
Method Summary
 void addCommitChangeListener(org.eclipse.ui.IPropertyListener propertyListener)
          Adds a listener that is notified whenever a commit of this registry is storing one or more changes.
 boolean checkpoint()
          Takes a snapshot of the current state of this registry.
 void clearCheckpoint()
          Clears a previous defined checkpoint.
 boolean commit()
          Commits the current state of this registry.
 IAssociationMapping getAssociationMapping(java.lang.String extensionPoint)
          Retrieves a mapping for a given extension point returning null if no mapping is available.
 IAssociationMapping[] getAssociationMappings()
          Returns the association mappings of this registry.
 IAssociationDescriptorFilter getFilter()
          Returns the association descriptor filter to be used with this mapping.
 java.lang.String getObjectCategory()
          Returns the category of object that the mappings in this registry are referring to.
 org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
          Returns the preference store used by this association mapping registry.
 void initialize(java.lang.String objectCategory, IAssociationDescriptorFilter filter, org.eclipse.jface.preference.IPreferenceStore preferenceStore)
          Initializes this registry.
 void removeCommitChangeListener(org.eclipse.ui.IPropertyListener propertyListener)
          Removes a commit listener.
 IAssociationMapping retrieveAssociationMapping(java.lang.String extensionPoint, java.lang.String pluginId)
          Retrieves a mapping for a given extension point returning an existing mapping or creating a new one.
 boolean rollback()
          Rolls this registry back to the state of the last checkpoint.
 
Methods inherited from interface org.eclipse.hyades.ui.util.IDisposable
dispose
 

Field Detail

PROP_CONTENTS

static final int PROP_CONTENTS
Property id used to notify listeners that the content of a registry has changed.

See Also:
Constant Field Values
Method Detail

initialize

void initialize(java.lang.String objectCategory,
                IAssociationDescriptorFilter filter,
                org.eclipse.jface.preference.IPreferenceStore preferenceStore)
                throws java.lang.IllegalArgumentException
Initializes this registry.

One of the initialize methods must be invoked at the beginning of the life cycle of the registry. Subsequents invocations of any of those methods don't produce any effect in the registry.

Parameters:
objectCategory - The unique identifier of the category of object for which the mappings refers to. An example of objectCategory is the file extension of the resource in which the object is saved. This value is used to persist the registry information in the preference store.
pluginId - The id of the plugin that declares the association descriptors of this registry's mappings. This value is used to persist the registry information in the preference store.
filter - The association description filter to be used by this registry
preferenceStore. - A preference store that allows a this association mapping registry to store and retrieve user preferences. If null, no preference information is persisted.
Throws:
java.lang.IllegalArgumentException - if objectCategory is null.

getFilter

IAssociationDescriptorFilter getFilter()
Returns the association descriptor filter to be used with this mapping.

Parameters:
filter -

getObjectCategory

java.lang.String getObjectCategory()
Returns the category of object that the mappings in this registry are referring to.

Parameters:
type -

getPreferenceStore

org.eclipse.jface.preference.IPreferenceStore getPreferenceStore()
Returns the preference store used by this association mapping registry.

Returns:
IPreferenceStore

retrieveAssociationMapping

IAssociationMapping retrieveAssociationMapping(java.lang.String extensionPoint,
                                               java.lang.String pluginId)
                                               throws java.lang.IllegalArgumentException
Retrieves a mapping for a given extension point returning an existing mapping or creating a new one.

The association mapping contains the association descriptors that applies to the category of object defined in this registry.

Parameters:
extensionPoint - The name of the extension point that is used to defined the association descriptor. An example of extensionPoint is the plugin extension point name of the editors that are used with this registry's category of object. This value is used to persist the mapping information in the preference store. The extensionPoint should be unique in this registry.
pluginId - The id of the plugin that declares the association descriptors of the mapping to be registered. If this parameter is null then no information is retrieved from the plugin registry.
Returns:
IAssociationMapping the association mapping.
Throws:
java.lang.IllegalArgumentException - if extensionPoint is null.

getAssociationMapping

IAssociationMapping getAssociationMapping(java.lang.String extensionPoint)
Retrieves a mapping for a given extension point returning null if no mapping is available.

The association mapping contains the association descriptors that applies to the category of object defined in this registry.

Parameters:
extensionPoint - The name of the extension point that is used to defined the association descriptor. An example of extensionPoint is the plugin extension point name of the editors that are used with this registry's category of object.
Returns:
IAssociationMapping the association mapping

getAssociationMappings

IAssociationMapping[] getAssociationMappings()
Returns the association mappings of this registry.

Returns:
IAssociationMapping[]

checkpoint

boolean checkpoint()
Takes a snapshot of the current state of this registry. The snapshot is kept in memory.

A new checkpoint overwrites a previous one.

Returns:
true if the snapshot was taken or false otherwise.
See Also:
rollback(), commit()

clearCheckpoint

void clearCheckpoint()
Clears a previous defined checkpoint. This method neither changes the current state of the registry nor affects the preference settings.

See Also:
checkpoint()

commit

boolean commit()
Commits the current state of this registry. The consequences of invoking this method are:
  • If getPreferenceStore() is not null, then the state is persisted in the preferences.
  • The committed state is set as the current checkpoint. This means that by invoking rollback() without any invocation of checkpoint() returns the state of the registry to the committed state.
  • Returns:
    true if the registry changes were committed or false otherwise.
    See Also:
    checkpoint(), rollback()

    rollback

    boolean rollback()
    Rolls this registry back to the state of the last checkpoint.

    Returns:
    true if the registry was rolled back or false otherwise.
    See Also:
    checkpoint(), commit()

    addCommitChangeListener

    void addCommitChangeListener(org.eclipse.ui.IPropertyListener propertyListener)
    Adds a listener that is notified whenever a commit of this registry is storing one or more changes. In other words there aren't notifications for commits that are performed on unchanged registries.

    Parameters:
    propertyListener -
    See Also:
    commit()

    removeCommitChangeListener

    void removeCommitChangeListener(org.eclipse.ui.IPropertyListener propertyListener)
    Removes a commit listener.

    Parameters:
    propertyListener -
    See Also:
    addCommitChangeListener(IPropertyListener), commit()

    TPTP 4.6.0 Platform Project
    Public API Specification