|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry
public class ElementTypeRegistry
The registry of application element types, contributed by the
org.eclipse.gmf.runtime.emf.type.core.elementTypes
extension
point, or registered directly through register(IMetamodelType)
or
register(ISpecializationType)
.
Method Summary | |
---|---|
void |
addElementTypeRegistryListener(IElementTypeRegistryListener l)
Adds l as a listener for changes to this registry. |
IElementType[] |
getAllTypesMatching(org.eclipse.emf.ecore.EObject eObject)
Gets all of the element types (metamodel type and specialization types) that match eObject in breadth-first order (specializations
before metamodel types). |
IElementType[] |
getAllTypesMatching(org.eclipse.emf.ecore.EObject eObject,
IClientContext clientContext)
Gets all of the element types (metamodel type and specialization types) that match eObject in breadth-first order (specializations
before metamodel types). |
IElementType[] |
getContainedTypes(org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference reference)
Gets the array of types that can be contained in the structural feature of eContainer . |
IElementType[] |
getContainedTypes(org.eclipse.emf.ecore.EObject eContainer,
org.eclipse.emf.ecore.EReference reference,
IClientContext clientContext)
Gets the array of types that can be contained in the structural feature of eContainer . |
IEditHelperAdvice[] |
getEditHelperAdvice(org.eclipse.emf.ecore.EObject eObject)
Gets the edit helper advice for eObject in order of most
general advice to most specific advice. |
IEditHelperAdvice[] |
getEditHelperAdvice(org.eclipse.emf.ecore.EObject eObject,
IClientContext clientContext)
Gets the edit helper advice for eObject in order of most
general advice to most specific advice. |
IEditHelperAdvice[] |
getEditHelperAdvice(IElementType type)
Gets the edit helper advice for type in order of most
general advice to most specific advice. |
IEditHelperAdvice[] |
getEditHelperAdvice(IElementType type,
IClientContext clientContext)
Gets the edit helper advice for type to which the
clientContext has been bound, in order of most general
advice to most specific advice. |
IEditHelperAdvice[] |
getEditHelperAdvice(java.lang.Object o)
Gets the edit helper advice registered for o , which can
be either an EObject or an IElementType or an
IEditHelperContext . |
IElementType |
getElementType(org.eclipse.emf.ecore.EClass eClass)
Gets the registered element type for eClass that
has no client contexts explicitly bound to it. |
IElementType |
getElementType(org.eclipse.emf.ecore.EClass eClass,
IClientContext clientContext)
Gets the registered element type for eClass . |
IElementType |
getElementType(org.eclipse.emf.ecore.EObject eObject)
Gets the registered element type for eObject . |
IElementType |
getElementType(org.eclipse.emf.ecore.EObject eObject,
IClientContext clientContext)
Gets the registered element type for eObject in the
clientContext . |
IElementType |
getElementType(java.lang.Object o)
Convenience method to get an element type for o . |
IElementTypeFactory |
getElementTypeFactory(java.lang.String kindName)
Gets the element type factory registered to create element types of kind kindName . |
IElementType[] |
getElementTypes(IClientContext clientContext)
Gets the element types (both metamodel types and specialization types) in the registry that are bound to the clientContext . |
static ElementTypeRegistry |
getInstance()
Gets the singleton element type registry. |
IMetamodelType[] |
getMetamodelTypes(IClientContext clientContext)
Gets the metamodel types in the registry that are bound to the clientContext . |
ISpecializationType[] |
getSpecializationsOf(java.lang.String id)
Gets an array containing all specializations of the element type for id , in breadth-first order. |
ISpecializationType[] |
getSpecializationTypes(IClientContext clientContext)
Gets the specialization types in the registry that are bound to the clientContext . |
IElementType |
getType(java.lang.String id)
Gets the element type for id . |
boolean |
register(IMetamodelType metamodelType)
Registers metamodelType with this registry, if its ID is
unique in the registry. |
boolean |
register(ISpecializationType specializationType)
Registers specializationType with this registry, if its ID
is unique in the registry. |
void |
removeElementTypeRegistryListener(IElementTypeRegistryListener l)
Removes l as a listener for changes to this registry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ElementTypeRegistry getInstance()
public IEditHelperAdvice[] getEditHelperAdvice(IElementType type)
type
in order of most
general advice to most specific advice. This order is used so that the
more specific advice can act on or modify the more general advice.
The client context is inferred from the type
.
type
- the element type for which to obtain editing advice
public IEditHelperAdvice[] getEditHelperAdvice(IElementType type, IClientContext clientContext)
type
to which the
clientContext
has been bound, in order of most general
advice to most specific advice. This order is used so that the more
specific advice can act on or modify the more general advice.
type
- the element type for which to obtain editing adviceclientContext
- the client context
public IEditHelperAdvice[] getEditHelperAdvice(org.eclipse.emf.ecore.EObject eObject, IClientContext clientContext)
eObject
in order of most
general advice to most specific advice. This order is used so that the
more specific advice can act on or modify the more general advice.
eObject
- the model element for which to obtain editing adviceclientContext
- the client context
public IEditHelperAdvice[] getEditHelperAdvice(org.eclipse.emf.ecore.EObject eObject)
eObject
in order of most
general advice to most specific advice. This order is used so that the
more specific advice can act on or modify the more general advice.
The client context will be inferred from the eObject
.
eObject
- the model element for which to obtain editing advice
public IEditHelperAdvice[] getEditHelperAdvice(java.lang.Object o)
o
, which can
be either an EObject or an IElementType or an
IEditHelperContext
.
o
- the element or type
null
if none.public IElementType[] getContainedTypes(org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference reference, IClientContext clientContext)
feature
of eContainer
. The result will not
include types that represent abstract EClasses.
eContainer
- the containerreference
- the featureclientContext
- the client context
public IElementType[] getContainedTypes(org.eclipse.emf.ecore.EObject eContainer, org.eclipse.emf.ecore.EReference reference)
feature
of eContainer
. The result will
not include types that represent abstract EClasses.
The client context will be inferred from the eContainer
.
eContainer
- the containerreference
- the feature
public IElementType getElementType(java.lang.Object o)
o
.
If o
is an IElementType
, returns
o
.
If o
is an EObject
, returns the metamodel
type registered for o
's eClass in the client context that
is bound to o
.
If o
is an IEditHelperContext
, returns the
element type in o
if specified. Else, returns the
metamodel type registered for the eClass of the EObject specified in
o
in the client context specified in o
. If
no client context is specified, then the client context bound to the
EObject is used.
Use getElementType(EClass, IClientContext)
to get metamodel
types registered for a specific EClass
.
o
- the object for which to find an element type.
o
itself if it is an element type, otherwise
returns the registered metamodel typepublic IElementType getElementType(org.eclipse.emf.ecore.EClass eClass)
eClass
that
has no client contexts explicitly bound to it.
eClass
- the EClass
whose element type is to be found.
eClass
public IElementType getElementType(org.eclipse.emf.ecore.EClass eClass, IClientContext clientContext)
eClass
.
eClass
- the EClass
whose element type is to be found.clientContext
- the client context
eClass
public IElementType getElementType(org.eclipse.emf.ecore.EObject eObject)
eObject
.
The client context will be inferred from the eObject
.
eObject
- the EObject
whose element type is to be found.
eObject
's
EClass
public IElementType getElementType(org.eclipse.emf.ecore.EObject eObject, IClientContext clientContext)
eObject
in the
clientContext
.
eObject
- the EObject
whose element type is to be found.clientContext
- the client context
eObject
's
EClass
public IElementType[] getAllTypesMatching(org.eclipse.emf.ecore.EObject eObject, IClientContext clientContext)
eObject
in breadth-first order (specializations
before metamodel types).
eObject
- the model element to matchclientContext
- the client context
public IElementType[] getAllTypesMatching(org.eclipse.emf.ecore.EObject eObject)
eObject
in breadth-first order (specializations
before metamodel types).
The client context will be inferred from the eObject
.
eObject
- the model element to match
public ISpecializationType[] getSpecializationsOf(java.lang.String id)
id
, in breadth-first order.
id
- the element type ID
public IMetamodelType[] getMetamodelTypes(IClientContext clientContext)
clientContext
.
clientContext
- the client context
public ISpecializationType[] getSpecializationTypes(IClientContext clientContext)
clientContext
.
clientContext
- the client context
public IElementType[] getElementTypes(IClientContext clientContext)
clientContext
.
clientContext
- the client context
public IElementType getType(java.lang.String id)
id
. May return
null
if this element is not registered.
id
- the type ID
null
if there
is none.public IElementTypeFactory getElementTypeFactory(java.lang.String kindName)
kindName
.
kindName
- the element type kind name
null/code> if there is none
public boolean register(IMetamodelType metamodelType)
metamodelType
with this registry, if its ID is
unique in the registry. The type's EClass does not have to be unique in
the registry. Metamodel types in the registry are distinguished by the
client context that is bound to the type.
Notifies clients if the element type was added to the registry.
metamodelType
- the element type to register
true
if the type was registered,
false
otherwisepublic boolean register(ISpecializationType specializationType)
specializationType
with this registry, if its ID
is unique in the registry.
Notifies clients if the element type was added to the registry.
specializationType
- the element type to register
true
if the type was registered,
false
otherwisepublic void addElementTypeRegistryListener(IElementTypeRegistryListener l)
l
as a listener for changes to this registry. Does
nothing if l
is already registered as a listener.
l
- the new listenerpublic void removeElementTypeRegistryListener(IElementTypeRegistryListener l)
l
as a listener for changes to this registry. Does
nothing if l
is not registered as a listener.
l
- the listener to remove
|
Runtime | |||||||||
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., Borland Software Corp., and others 2005,2006. All rights reserved.