public class LabelUtil extends Object
Modifier and Type | Field and Description |
---|---|
static ILabelGenerator.Registry |
QUALIFIED_NAME_REGISTRY
The global QUALIFIED_NAME_REGISTRY is used by qualifiedNameFor to generate qualified names
for objects; typically a :: separted hierarchical name.
|
static ILabelGenerator.Registry |
SIMPLE_NAME_REGISTRY
The global SIMPLE_NAME_REGISTRY is used by simpleNameFor to generate simple names
for objects; typically the name property.
|
static EValidator.SubstitutionLabelProvider |
SUBSTITUTION_LABEL_PROVIDER
A SubstitutionLabelProvider instance that uses LaberlUtil.getLabel() to provide labels.
|
Constructor and Description |
---|
LabelUtil() |
Modifier and Type | Method and Description |
---|---|
static <E extends EObject> |
copy(E newObject) |
static Map<Object,Object> |
createDefaultContext(EValidator eValidator)
Return a context map for use by EValidator.validate in which the EValidator.class key
is mapped to the eValidator, and the EValidator.SubstitutionLabelProvider.class key
is mapped to a SubstitutionLabelProvider that uses getLabel().
|
static String |
diagnoseUnresolvedProxies(URI contextURI,
Map<EObject,Collection<EStructuralFeature.Setting>> map)
Convert the map return from EcoreUtil.UnresolvedProxyCrossReferencer.find(xx)
into a textual diagnosis.
|
static <T extends Adapter> |
getAdapter(List<Adapter> eAdapters,
Class<T> adapterClass) |
static <T extends Adapter> |
getAdapter(Notifier notifier,
Class<T> adapterClass) |
static EOperation |
getEcoreInvariant(EClass eClass,
String name)
Return the EOperation that realises the name invariant for eClass.
|
static EClassifier |
getEType(EObject sourceObject,
EStructuralFeature feature)
Return the specialised value of feature.getEType() resolving any type parameters
from the specialised type of the sourceObject of the feature.
|
static <T> int |
getFeatureID(Notification notification,
T expectedNotifier,
Class<T> featureClass) |
static String |
getLabel(EClassifier eClassifier,
Object object,
Map<Object,Object> context)
Return a simple readable description of object.
|
static String |
getLabel(Object object)
Return a simple readable description of eObject using an IItemLabelProvider if possible.
|
public static ILabelGenerator.Registry QUALIFIED_NAME_REGISTRY
public static ILabelGenerator.Registry SIMPLE_NAME_REGISTRY
public static EValidator.SubstitutionLabelProvider SUBSTITUTION_LABEL_PROVIDER
public static <E extends EObject> E copy(E newObject)
public static Map<Object,Object> createDefaultContext(EValidator eValidator)
public static String diagnoseUnresolvedProxies(URI contextURI, Map<EObject,Collection<EStructuralFeature.Setting>> map)
public static <T extends Adapter> T getAdapter(Notifier notifier, Class<T> adapterClass)
public static <T extends Adapter> T getAdapter(List<Adapter> eAdapters, Class<T> adapterClass)
public static EClassifier getEType(EObject sourceObject, EStructuralFeature feature)
sourceObject
- feature
- public static EOperation getEcoreInvariant(EClass eClass, String name)
eClass
- with invariantname
- of invariantpublic static <T> int getFeatureID(Notification notification, T expectedNotifier, Class<T> featureClass)
public static String getLabel(Object object)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.