Search in sources :

Example 6 with EStructuralFeature

use of org.eclipse.emf.ecore.EStructuralFeature in project tdi-studio-se by Talend.

the class BusinessStructuralFeaturesParser method getParseCommand.

/**
     * @generated
     */
public ICommand getParseCommand(IAdaptable adapter, Object[] values) {
    EObject element = (EObject) adapter.getAdapter(EObject.class);
    if (element == null) {
        return UnexecutableCommand.INSTANCE;
    }
    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
    if (editingDomain == null) {
        return UnexecutableCommand.INSTANCE;
    }
    //$NON-NLS-1$
    CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values");
    for (int i = 0; i < values.length; i++) {
        EStructuralFeature feature = (EStructuralFeature) features.get(i);
        command.compose(getModificationCommand(element, feature, values[i]));
    }
    return command;
}
Also used : TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) CompositeTransactionalCommand(org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand) EObject(org.eclipse.emf.ecore.EObject) EStructuralFeature(org.eclipse.emf.ecore.EStructuralFeature)

Aggregations

EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)6 EObject (org.eclipse.emf.ecore.EObject)4 ArrayList (java.util.ArrayList)2 IItemPropertySource (org.eclipse.emf.edit.provider.IItemPropertySource)2 BusinessAssignment (org.talend.designer.business.model.business.BusinessAssignment)2 BigDecimal (java.math.BigDecimal)1 FieldPosition (java.text.FieldPosition)1 Iterator (java.util.Iterator)1 List (java.util.List)1 EReference (org.eclipse.emf.ecore.EReference)1 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)1 CompositeTransactionalCommand (org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand)1 ConfigurationException (org.osgi.service.cm.ConfigurationException)1