public class LabelUtil
extends java.lang.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 org.eclipse.emf.ecore.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 org.eclipse.emf.ecore.EObject> |
copy(E newObject) |
static java.util.Map<java.lang.Object,java.lang.Object> |
createDefaultContext(org.eclipse.emf.ecore.EValidator eValidator)
Return a context map for use by EValidator.validate in which the EVlaidator.class key
is mapped to the eValidator, and the EValidator.SubstitutionLabelProvider.class key
is mapped to a SubstitutionLabelProvider that uses getLabel().
|
static java.lang.String |
diagnoseUnresolvedProxies(org.eclipse.emf.common.util.URI contextURI,
java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting>> map)
Convert the map return from EcoreUtil.UnresolvedProxyCrossReferencer.find(xx)
into a textual diagnosis.
|
static <T extends org.eclipse.emf.common.notify.Adapter> |
getAdapter(java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters,
java.lang.Class<T> adapterClass) |
static <T extends org.eclipse.emf.common.notify.Adapter> |
getAdapter(org.eclipse.emf.common.notify.Notifier notifier,
java.lang.Class<T> adapterClass) |
static org.eclipse.emf.ecore.EOperation |
getEcoreInvariant(org.eclipse.emf.ecore.EClass eClass,
java.lang.String name)
Return the EOperation that realises the name invariant for eClass.
|
static org.eclipse.emf.ecore.EClassifier |
getEType(org.eclipse.emf.ecore.EObject sourceObject,
org.eclipse.emf.ecore.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(org.eclipse.emf.common.notify.Notification notification,
T expectedNotifier,
java.lang.Class<T> featureClass) |
static java.lang.String |
getLabel(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object object,
java.util.Map<java.lang.Object,java.lang.Object> context)
Return a simple readable description of object.
|
static java.lang.String |
getLabel(java.lang.Object object)
Return a simple readable description of eObject using an IItemLabelProvider if possible.
|
@NonNull public static ILabelGenerator.Registry QUALIFIED_NAME_REGISTRY
@NonNull public static ILabelGenerator.Registry SIMPLE_NAME_REGISTRY
@NonNull public static org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider SUBSTITUTION_LABEL_PROVIDER
public static <E extends org.eclipse.emf.ecore.EObject> E copy(E newObject)
@NonNull public static java.util.Map<java.lang.Object,java.lang.Object> createDefaultContext(org.eclipse.emf.ecore.EValidator eValidator)
@Nullable public static java.lang.String diagnoseUnresolvedProxies(@NonNull org.eclipse.emf.common.util.URI contextURI, @NonNull java.util.Map<org.eclipse.emf.ecore.EObject,java.util.Collection<org.eclipse.emf.ecore.EStructuralFeature.Setting>> map)
@Nullable public static <T extends org.eclipse.emf.common.notify.Adapter> T getAdapter(@Nullable org.eclipse.emf.common.notify.Notifier notifier, java.lang.Class<T> adapterClass)
public static <T extends org.eclipse.emf.common.notify.Adapter> T getAdapter(java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters, java.lang.Class<T> adapterClass)
public static org.eclipse.emf.ecore.EClassifier getEType(org.eclipse.emf.ecore.EObject sourceObject, @NonNull org.eclipse.emf.ecore.EStructuralFeature feature)
sourceObject
- feature
- @Nullable public static org.eclipse.emf.ecore.EOperation getEcoreInvariant(@NonNull org.eclipse.emf.ecore.EClass eClass, @NonNull java.lang.String name)
eClass
- with invariantname
- of invariantpublic static <T> int getFeatureID(@NonNull org.eclipse.emf.common.notify.Notification notification, @Nullable T expectedNotifier, @NonNull java.lang.Class<T> featureClass)
public static java.lang.String getLabel(@Nullable java.lang.Object object)
public static java.lang.String getLabel(org.eclipse.emf.ecore.EClassifier eClassifier, java.lang.Object object, java.util.Map<java.lang.Object,java.lang.Object> context)