public class LabelGeneratorRegistry extends Object implements ILabelGenerator.Registry
MethodCall registrations may be made via registerInstanceMethod or registerStaticMethod.
A debug string may be obtained via DebugString.toDebug(object).
DebugString providers string formatters for simple classes such as String, Number, Boolean and Ecore components such as EObject, Resource and ResourceSet.
User extensions should be registered prior to use. Beware that late registration can give misleading results since in the absence of an exact MethodCall registration the class hierarchy is search first for base classes then for instances for which there is an exact MethodCall match. This result is then cached and so may occlude a late registration.
Modifier and Type | Class and Description |
---|---|
static class |
LabelGeneratorRegistry.Global |
INSTANCE
Constructor and Description |
---|
LabelGeneratorRegistry(ILabelGenerator.Registry delegate)
Construct a registry that resolves label generators locally when possible
but which delegates to delegate otherwise.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
buildLabelFor(ILabelGenerator.Builder s,
T labelledObject) |
<T> void |
buildSubLabelFor(ILabelGenerator.Builder labelBuilder,
T labelledObject) |
ILabelGenerator.Builder |
createDefaultLabelBuilder(Object labelledObject,
Map<ILabelGenerator.Option<?>,Object> options) |
static String |
debugLabelFor(Object object) |
ILabelGenerator<?> |
get(Class<?> labelledClass) |
static LabelGeneratorRegistry |
init() |
static void |
initialize(ILabelGenerator.Registry registry) |
Object |
install(Class<?> labelledClass,
ILabelGenerator.Descriptor labelDescriptor) |
Object |
install(Class<?> labelledClass,
ILabelGenerator<?> labelGenerator) |
String |
labelFor(Object labelledObject) |
String |
labelFor(Object labelledObject,
Map<ILabelGenerator.Option<?>,Object> options) |
void |
uninstall(Class<?> labelledClass) |
public LabelGeneratorRegistry(ILabelGenerator.Registry delegate)
public static LabelGeneratorRegistry init()
public static void initialize(ILabelGenerator.Registry registry)
public <T> void buildLabelFor(ILabelGenerator.Builder s, T labelledObject)
buildLabelFor
in interface ILabelGenerator.Registry
public <T> void buildSubLabelFor(ILabelGenerator.Builder labelBuilder, T labelledObject)
buildSubLabelFor
in interface ILabelGenerator.Registry
public ILabelGenerator.Builder createDefaultLabelBuilder(Object labelledObject, Map<ILabelGenerator.Option<?>,Object> options)
public ILabelGenerator<?> get(Class<?> labelledClass)
get
in interface ILabelGenerator.Registry
public Object install(Class<?> labelledClass, ILabelGenerator.Descriptor labelDescriptor)
install
in interface ILabelGenerator.Registry
public Object install(Class<?> labelledClass, ILabelGenerator<?> labelGenerator)
install
in interface ILabelGenerator.Registry
public String labelFor(Object labelledObject)
labelFor
in interface ILabelGenerator.Registry
public String labelFor(Object labelledObject, Map<ILabelGenerator.Option<?>,Object> options)
labelFor
in interface ILabelGenerator.Registry
public void uninstall(Class<?> labelledClass)
uninstall
in interface ILabelGenerator.Registry
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.