public class CustomCommandRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class<?>,java.util.Map<IPropertyType,java.util.Map<java.lang.Class<? extends org.eclipse.emf.common.command.Command>,java.lang.Class<? extends org.eclipse.emf.common.command.Command>>>> |
customCommandTypes |
static CustomCommandRegistry |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
org.eclipse.emf.common.command.Command |
createCustomCommand(org.eclipse.emf.edit.domain.EditingDomain domain,
org.eclipse.emf.edit.command.CommandParameter commandParameter,
java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass) |
protected java.lang.Class<? extends org.eclipse.emf.common.command.Command> |
getCustomCommandType(java.lang.Class<?> ownerType,
IPropertyType propertyType,
java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass) |
protected java.lang.String |
getFeatureName(java.lang.Object feature) |
protected java.lang.Class<?> |
getValueType(java.util.Collection<?> collection) |
protected void |
readCustomCommandContribution(org.eclipse.core.runtime.IConfigurationElement contribution)
java.lang.Class#classForName(className) when trying to retrieved a class from its
name because it take to much time when expected class is not directly visible (i.e. not declared in
plug-in itself nor in dependencies).
|
public static final CustomCommandRegistry INSTANCE
protected java.util.Map<java.lang.Class<?>,java.util.Map<IPropertyType,java.util.Map<java.lang.Class<? extends org.eclipse.emf.common.command.Command>,java.lang.Class<? extends org.eclipse.emf.common.command.Command>>>> customCommandTypes
protected java.lang.String getFeatureName(java.lang.Object feature)
protected java.lang.Class<?> getValueType(java.util.Collection<?> collection)
public org.eclipse.emf.common.command.Command createCustomCommand(org.eclipse.emf.edit.domain.EditingDomain domain, org.eclipse.emf.edit.command.CommandParameter commandParameter, java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass)
protected final java.lang.Class<? extends org.eclipse.emf.common.command.Command> getCustomCommandType(java.lang.Class<?> ownerType, IPropertyType propertyType, java.lang.Class<? extends org.eclipse.emf.common.command.Command> commandClass)
protected void readCustomCommandContribution(org.eclipse.core.runtime.IConfigurationElement contribution) throws java.lang.ClassNotFoundException, org.eclipse.core.runtime.CoreException, java.lang.NoSuchFieldException
Note: | Do not use java.lang.Class#classForName(className) when trying to retrieved a class from its
name because it take to much time when expected class is not directly visible (i.e. not declared in
plug-in itself nor in dependencies). Further more, this way of class retrieval implies to add: Eclipse-BuddyPolicy: dependent in plug-in manifest; whereas such an option is not recommended.
Another solution to this problem would have been to use the method
The more efficient solution is to delegate the loading of the contributed class to the class loader of the
contributor bundle by using |
contribution
- java.lang.ClassNotFoundException
org.eclipse.core.runtime.CoreException
java.lang.NoSuchFieldException