use of org.eclipse.emf.edit.command.CommandParameter in project InformationSystem by ObeoNetwork.
the class BindingDialectUIServices method provideRepresentationCreationToolDescriptors.
/**
* {@inheritDoc}
*
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#provideRepresentationCreationToolDescriptors(java.lang.Object)
*/
@Override
public Collection<CommandParameter> provideRepresentationCreationToolDescriptors(Object feature) {
final Collection<CommandParameter> newChilds = new ArrayList<CommandParameter>();
final DBindingEditorCreationDescription creationTool = DescriptionFactory.eINSTANCE.createDBindingEditorCreationDescription();
newChilds.add(new CommandParameter(null, feature, creationTool));
return newChilds;
}
use of org.eclipse.emf.edit.command.CommandParameter in project InformationSystem by ObeoNetwork.
the class BindingDialectUIServices method provideNewChildDescriptors.
/**
* {@inheritDoc}
*
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#provideNewChildDescriptors()
*/
@Override
public Collection<CommandParameter> provideNewChildDescriptors() {
final Collection<CommandParameter> newChilds = new ArrayList<CommandParameter>();
final DBindingEditorDescription description = DescriptionFactory.eINSTANCE.createDBindingEditorDescription();
newChilds.add(new CommandParameter(null, DescriptionPackage.Literals.VIEWPOINT__OWNED_REPRESENTATIONS, description));
return newChilds;
}
use of org.eclipse.emf.edit.command.CommandParameter in project InformationSystem by ObeoNetwork.
the class FilterContainerItemProvider method addExternalChildDescriptors.
/**
* This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s
* describing all of the children that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@SuppressWarnings({ "unchecked", "deprecation" })
protected void addExternalChildDescriptors(Collection newChildDescriptors, Object object) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(CHILD_DESCRIPTOR_EXTENSION_ID);
if (extensionPoint == null || extensionPoint.getExtensions().length == 0) {
EcorePlugin.INSTANCE.log("Extension point '" + CHILD_DESCRIPTOR_EXTENSION_ID + "' not found");
} else {
Bundle theBundle = null;
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IExtension extension = extensions[i];
IConfigurationElement[] members = extension.getConfigurationElements();
for (int j = 0; j < members.length; j++) {
IConfigurationElement member = members[j];
String conditionClass = member.getAttribute("implementation");
theBundle = Platform.getBundle(member.getNamespace());
if (conditionClass != null) {
try {
Class c = theBundle.loadClass(conditionClass);
Object instance = c.newInstance();
if (instance instanceof IChildDescriptorProvider) {
IChildDescriptorProvider childDescriptorProvider = (IChildDescriptorProvider) instance;
CommandParameter parameter = childDescriptorProvider.getEntityFilter(object);
if (parameter != null) {
newChildDescriptors.add(parameter);
}
}
} catch (ClassNotFoundException e) {
EcorePlugin.INSTANCE.log(e);
} catch (InstantiationException e) {
EcorePlugin.INSTANCE.log(e);
} catch (IllegalAccessException e) {
EcorePlugin.INSTANCE.log(e);
}
}
}
}
}
}
Aggregations