de.cau.cs.kieler.kiml.service
Class ExtensionLayoutDataService

java.lang.Object
  extended by de.cau.cs.kieler.kiml.LayoutDataService
      extended by de.cau.cs.kieler.kiml.service.ExtensionLayoutDataService
Direct Known Subclasses:
EclipseLayoutDataService, ProgrammaticLayoutDataService

public abstract class ExtensionLayoutDataService
extends LayoutDataService

A layout data service that reads its content from the Eclipse extension registry.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class de.cau.cs.kieler.kiml.LayoutDataService
LayoutDataService.Registry
 
Field Summary
static String ATTRIBUTE_ADVANCED
          name of the 'advanced' attribute in the extension points.
static String ATTRIBUTE_APPLIESTO
          name of the 'appliesTo' attribute in the extension points.
static String ATTRIBUTE_CATEGORY
          name of the 'category' attribute in the extension points.
static String ATTRIBUTE_CLASS
          name of the 'class' attribute in the extension points.
static String ATTRIBUTE_DEFAULT
          name of the 'default' attribute in the extension points.
static String ATTRIBUTE_DESCRIPTION
          name of the 'description' attribute in the extension points.
static String ATTRIBUTE_ENUMVALUES
          name of the 'enumValues' attribute used in doing remote layout.
static String ATTRIBUTE_ID
          name of the 'id' attribute in the extension points.
static String ATTRIBUTE_IMPLEMENTATION
          The name of the 'implementation' attribute of a layout option of type 'remoteenum'.
static String ATTRIBUTE_NAME
          name of the 'name' attribute in the extension points.
static String ATTRIBUTE_OPTION
          name of the 'option' attribute in the extension points.
static String ATTRIBUTE_PARAMETER
          name of the 'parameter' attribute in the extension points.
static String ATTRIBUTE_PRIORITY
          name of the 'priority' attribute in the extension points.
static String ATTRIBUTE_TYPE
          name of the 'type' attribute in the extension points.
static String ELEMENT_CATEGORY
          name of the 'category' element in the 'layout providers' extension point.
static String ELEMENT_KNOWN_OPTION
          name of the 'known option' element in the 'layout providers' extension point.
static String ELEMENT_LAYOUT_ALGORITHM
          name of the 'layout algorithm' element in the 'layout providers' extension point.
static String ELEMENT_LAYOUT_OPTION
          name of the 'layout option' element in the 'layout providers' extension point.
static String ELEMENT_LAYOUT_TYPE
          name of the 'layout type' element in the 'layout providers' extension point.
static String ELEMENT_SUPPORTED_DIAGRAM
          name of the 'supported diagram' element in the 'layout providers' extension point.
static String EXTP_ID_LAYOUT_PROVIDERS
          identifier of the extension point for layout providers.
 
Fields inherited from class de.cau.cs.kieler.kiml.LayoutDataService
DIAGRAM_TYPE_GENERAL, ECLIPSEDATASERVICE, REMOTEDATASERVICE, SERVICEDATASERVICE
 
Constructor Summary
ExtensionLayoutDataService()
           
 
Method Summary
protected  LayoutAlgorithmData createLayoutAlgorithmData(IConfigurationElement element)
          Create a layout algorithm data instance and configure it with platform-specific extensions.
protected  IFactory<AbstractLayoutProvider> getLayoutProviderFactory(IConfigurationElement element)
          Create a layout provider factory from a configuration element.
protected  IConfigurationElement[] getProviderExtensions()
          Returns the extensions responsible for providing layout meta data.
protected  Class<?> loadClass(IConfigurationElement element)
          Load a class from a configuration element.
protected  void loadLayoutProviderExtensions()
          Loads and registers all layout provider extensions from the extension point.
protected abstract  void reportError(CoreException exception)
          Report an error that occurred while reading extensions.
protected abstract  void reportError(String extensionPoint, IConfigurationElement element, String attribute, Throwable exception)
          Report an error that occurred while reading extensions.
 
Methods inherited from class de.cau.cs.kieler.kiml.LayoutDataService
addService, getAlgorithmData, getAlgorithmData, getAlgorithmDataBySuffix, getCategoryName, getInstance, getInstanceOf, getMode, getOptionData, getOptionData, getOptionData, getOptionDataBySuffix, getRegistry, getTypeData, getTypeData, getTypeDataBySuffix, removeService, setMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTP_ID_LAYOUT_PROVIDERS

public static final String EXTP_ID_LAYOUT_PROVIDERS
identifier of the extension point for layout providers.

See Also:
Constant Field Values

ELEMENT_LAYOUT_ALGORITHM

public static final String ELEMENT_LAYOUT_ALGORITHM
name of the 'layout algorithm' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ELEMENT_LAYOUT_TYPE

public static final String ELEMENT_LAYOUT_TYPE
name of the 'layout type' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ELEMENT_CATEGORY

public static final String ELEMENT_CATEGORY
name of the 'category' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ELEMENT_KNOWN_OPTION

public static final String ELEMENT_KNOWN_OPTION
name of the 'known option' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ELEMENT_LAYOUT_OPTION

public static final String ELEMENT_LAYOUT_OPTION
name of the 'layout option' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ELEMENT_SUPPORTED_DIAGRAM

public static final String ELEMENT_SUPPORTED_DIAGRAM
name of the 'supported diagram' element in the 'layout providers' extension point.

See Also:
Constant Field Values

ATTRIBUTE_ADVANCED

public static final String ATTRIBUTE_ADVANCED
name of the 'advanced' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_APPLIESTO

public static final String ATTRIBUTE_APPLIESTO
name of the 'appliesTo' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_CATEGORY

public static final String ATTRIBUTE_CATEGORY
name of the 'category' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_CLASS

public static final String ATTRIBUTE_CLASS
name of the 'class' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_DEFAULT

public static final String ATTRIBUTE_DEFAULT
name of the 'default' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_DESCRIPTION

public static final String ATTRIBUTE_DESCRIPTION
name of the 'description' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_ID

public static final String ATTRIBUTE_ID
name of the 'id' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
name of the 'name' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_OPTION

public static final String ATTRIBUTE_OPTION
name of the 'option' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_PARAMETER

public static final String ATTRIBUTE_PARAMETER
name of the 'parameter' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_PRIORITY

public static final String ATTRIBUTE_PRIORITY
name of the 'priority' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_TYPE

public static final String ATTRIBUTE_TYPE
name of the 'type' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_ENUMVALUES

public static final String ATTRIBUTE_ENUMVALUES
name of the 'enumValues' attribute used in doing remote layout.

See Also:
Constant Field Values

ATTRIBUTE_IMPLEMENTATION

public static final String ATTRIBUTE_IMPLEMENTATION
The name of the 'implementation' attribute of a layout option of type 'remoteenum'.

See Also:
Constant Field Values
Constructor Detail

ExtensionLayoutDataService

public ExtensionLayoutDataService()
Method Detail

reportError

protected abstract void reportError(String extensionPoint,
                                    IConfigurationElement element,
                                    String attribute,
                                    Throwable exception)
Report an error that occurred while reading extensions.

Parameters:
extensionPoint - the identifier of the extension point
element - the configuration element
attribute - the attribute that contains an invalid entry
exception - an optional exception that was caused by the invalid entry

reportError

protected abstract void reportError(CoreException exception)
Report an error that occurred while reading extensions.

Parameters:
exception - a core exception holding a status with further information

getProviderExtensions

protected IConfigurationElement[] getProviderExtensions()
Returns the extensions responsible for providing layout meta data. This method can be overridden by subclasses.

Returns:
the extensions responsible for providing layout meta data

loadLayoutProviderExtensions

protected void loadLayoutProviderExtensions()
Loads and registers all layout provider extensions from the extension point.


createLayoutAlgorithmData

protected LayoutAlgorithmData createLayoutAlgorithmData(IConfigurationElement element)
Create a layout algorithm data instance and configure it with platform-specific extensions.

Parameters:
element - a configuration element to use for configuration
Returns:
a new layout algorithm data instance

getLayoutProviderFactory

protected IFactory<AbstractLayoutProvider> getLayoutProviderFactory(IConfigurationElement element)
Create a layout provider factory from a configuration element.

Parameters:
element - a configuration element from an extension
Returns:
a factory for layout provider instances

loadClass

protected Class<?> loadClass(IConfigurationElement element)
Load a class from a configuration element.

Parameters:
element - a configuration element from an extension
Returns:
a class, or null if none could be loaded