org.eclipse.ercp.eworkbench
Class ApplicationRegistry

java.lang.Object
  extended by org.eclipse.ercp.eworkbench.ApplicationRegistry
All Implemented Interfaces:
IExtensionChangeHandler, IApplicationRegistry

public class ApplicationRegistry
extends java.lang.Object
implements IApplicationRegistry, IExtensionChangeHandler

eRCP Application registry.


Constructor Summary
ApplicationRegistry()
          Construct a new registry.
 
Method Summary
 void addApplication(ApplicationDescriptor desc)
          Adds an application.
 void addExtension(IExtensionTracker tracker, IExtension addedExtension)
          This method is called whenever an extension conforming to the extension point filter is being added to the registry.
 ApplicationDescriptor createApplication(java.lang.String label)
          Create a new application.
 void deleteApplication(IApplicationDescriptor in)
          Delete an application.
 void dispose()
           
 IApplicationDescriptor findApplicationWithId(java.lang.String id)
          Finds and returns the registered application with the given app id.
 IApplicationDescriptor findApplicationWithLabel(java.lang.String label)
          Finds and returns the registered application with the given app id.
 IApplicationDescriptor[] getApplications()
          Returns a list of the applications known to the workbench.
 void load()
          Loads the registry.
 void removeExtension(IExtension source, java.lang.Object[] objects)
          This method is called after the removal of an extension.
 boolean validateLabel(java.lang.String label)
          Return true if a label is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationRegistry

public ApplicationRegistry()
Construct a new registry.

Method Detail

addApplication

public void addApplication(ApplicationDescriptor desc)
Adds an application. This is typically used by the reader.

Parameters:
desc -

createApplication

public ApplicationDescriptor createApplication(java.lang.String label)
Create a new application.

Parameters:
label - the name of the new descriptor
originalDescriptor - the descriptor on which to base the new descriptor
Returns:
a new application descriptor or null if the creation failed.

deleteApplication

public void deleteApplication(IApplicationDescriptor in)
Delete an application. Has no effect if the application is defined in an extension.

Parameters:
in -

findApplicationWithId

public IApplicationDescriptor findApplicationWithId(java.lang.String id)
Description copied from interface: IApplicationRegistry
Finds and returns the registered application with the given app id.

Specified by:
findApplicationWithId in interface IApplicationRegistry

findApplicationWithLabel

public IApplicationDescriptor findApplicationWithLabel(java.lang.String label)
Description copied from interface: IApplicationRegistry
Finds and returns the registered application with the given app id.

Specified by:
findApplicationWithLabel in interface IApplicationRegistry

getApplications

public IApplicationDescriptor[] getApplications()
Description copied from interface: IApplicationRegistry
Returns a list of the applications known to the workbench.

Specified by:
getApplications in interface IApplicationRegistry
Returns:
a list of applications

load

public void load()
Loads the registry.


validateLabel

public boolean validateLabel(java.lang.String label)
Return true if a label is valid. This checks only the given label in isolation. It does not check whether the given label is used by any existing applications.

Parameters:
label - the label to test
Returns:
whether the label is valid

dispose

public void dispose()

removeExtension

public void removeExtension(IExtension source,
                            java.lang.Object[] objects)
Description copied from interface: IExtensionChangeHandler
This method is called after the removal of an extension.

Specified by:
removeExtension in interface IExtensionChangeHandler
Parameters:
source - the extension being removed
objects - the objects that were associated with the removed extension

addExtension

public void addExtension(IExtensionTracker tracker,
                         IExtension addedExtension)
Description copied from interface: IExtensionChangeHandler
This method is called whenever an extension conforming to the extension point filter is being added to the registry. This method does not automatically register objects to the tracker.

Specified by:
addExtension in interface IExtensionChangeHandler
Parameters:
tracker - a tracker to which the handler has been registered
addedExtension - the extension being added