|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.service.LayoutInfoService
public abstract class LayoutInfoService
Service class for layout information such as registered diagram types and pre-configured layout option values.
Field Summary | |
---|---|
static String |
ATTRIBUTE_CLASS
name of the 'class' attribute in the extension points. |
static String |
ATTRIBUTE_CONFIG
name of the 'config' attribute in the extension points. |
static String |
ATTRIBUTE_ID
name of the 'id' attribute in the extension points. |
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_VALUE
name of the 'value' attribute in the extension points. |
static String |
ELEMENT_BINDING
name of the 'binding' element in the 'layout info' extension point. |
static String |
ELEMENT_DIAGRAM_TYPE
name of the 'diagram type' element in the 'layout info' extension point. |
static String |
ELEMENT_OPTION
name of the 'option' element in the 'layout info' extension point. |
static String |
ELEMENT_SEMANTIC_OPTION
name of the 'semantic option' element in the 'layout info' extension point. |
static String |
EXTP_ID_LAYOUT_INFO
identifier of the extension point for layout info. |
Constructor Summary | |
---|---|
protected |
LayoutInfoService()
Protected constructor to enforce instantiation in subclasses. |
Method Summary | |
---|---|
protected void |
addDiagramType(String id,
String name)
Registers the given diagram type. |
void |
addOptionValue(String id,
String optionId,
Object value)
Adds the given layout option value as default for an object identifier. |
protected void |
addSemanticConfig(String clazzName,
SemanticLayoutConfig config)
Registers the given semantic layout configuration. |
String |
getDiagramTypeName(String id)
Returns the name of the given diagram type. |
List<Pair<String,String>> |
getDiagramTypes()
Returns a collection of registered diagram types. |
static LayoutInfoService |
getInstance()
Returns the singleton instance of the layout info service. |
Object |
getOptionValue(EClass clazz,
String optionId)
Retrieves a layout option value for a domain model class. |
Object |
getOptionValue(String objectId,
String optionId)
Retrieves a layout option value for an object identifier. |
Map<String,Object> |
getOptionValues(EClass clazz)
Returns a map that contains all layout option values for a domain model class. |
Map<String,Object> |
getOptionValues(String objectId)
Returns a map that contains all layout option values for an object identifier. |
List<ILayoutConfig> |
getSemanticConfigs(EClass clazz)
Return the semantic layout configurations that are associated with the given domain model class. |
protected void |
loadLayoutInfoExtensions()
Loads and registers all layout info extensions from the extension point. |
void |
removeOptionValue(String id,
String optionId)
Remove the value of the given layout option. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXTP_ID_LAYOUT_INFO
public static final String ELEMENT_BINDING
public static final String ELEMENT_DIAGRAM_TYPE
public static final String ELEMENT_OPTION
public static final String ELEMENT_SEMANTIC_OPTION
public static final String ATTRIBUTE_CLASS
public static final String ATTRIBUTE_CONFIG
public static final String ATTRIBUTE_ID
public static final String ATTRIBUTE_NAME
public static final String ATTRIBUTE_OPTION
public static final String ATTRIBUTE_VALUE
Constructor Detail |
---|
protected LayoutInfoService()
Method Detail |
---|
public static LayoutInfoService getInstance()
protected abstract void reportError(String extensionPoint, IConfigurationElement element, String attribute, Throwable exception)
extensionPoint
- the identifier of the extension pointelement
- the configuration elementattribute
- the attribute that contains an invalid entryexception
- an optional exception that was caused by the invalid entryprotected abstract void reportError(CoreException exception)
exception
- a core exception holding a status with further informationprotected void loadLayoutInfoExtensions()
protected final void addDiagramType(String id, String name)
id
- identifier of the diagram typename
- user friendly name of the diagram typepublic final void addOptionValue(String id, String optionId, Object value)
id
- identifier of the object to registeroptionId
- identifier of a layout optionvalue
- value for the layout optionpublic final void removeOptionValue(String id, String optionId)
id
- identifier of the object for which an option shall be removedoptionId
- identifier of a layout optionprotected final void addSemanticConfig(String clazzName, SemanticLayoutConfig config)
clazzName
- domain model class name for which to register the configurationconfig
- a semantic layout configurationpublic final String getDiagramTypeName(String id)
id
- identifier of the diagram type
null
if there is no diagram type
with the given identifierpublic final List<Pair<String,String>> getDiagramTypes()
public final Map<String,Object> getOptionValues(String objectId)
objectId
- an object identifier, such as an edit part class name, a domain model class name,
or a diagram type id
public final Object getOptionValue(String objectId, String optionId)
objectId
- an object identifier, such as an edit part class name, a domain model class name,
or a diagram type idoptionId
- a layout option identifier
null
if the option is not set for
the given objectpublic final Map<String,Object> getOptionValues(EClass clazz)
clazz
- a domain model class
public final Object getOptionValue(EClass clazz, String optionId)
clazz
- a domain model classoptionId
- a layout option identifier
null
if the option is not
set for the classpublic final List<ILayoutConfig> getSemanticConfigs(EClass clazz)
clazz
- a domain model class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |