Search in sources :

Example 1 with WizardEditingOperation

use of org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation in project InformationSystem by ObeoNetwork.

the class CustomEditingPolicy method execute.

/**
 * (non-Javadoc)
 *
 * @see org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy#execute()
 */
@Override
public void execute() {
    EditingDomain editingDomain = EEFUtils.getEditingDomain(editionContext);
    if (editingDomain != null) {
        DomainPropertiesEditionContext domainPropertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, editionContext.getAdapterFactory(), editionContext.getEObject());
        WizardEditingOperation operation = new WizardEditingOperation(domainPropertiesEditionContext);
        try {
            operation.execute(new NullProgressMonitor(), null);
        } catch (ExecutionException e) {
            EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
        }
    } else {
        super.execute();
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) DomainPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext) ExecutionException(org.eclipse.core.commands.ExecutionException) WizardEditingOperation(org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)

Example 2 with WizardEditingOperation

use of org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation in project InformationSystem by ObeoNetwork.

the class CustomEditingPolicy method execute.

/**
 * (non-Javadoc)
 *
 * @see org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy#execute()
 */
@Override
public void execute() {
    EditingDomain editingDomain = EEFUtils.getEditingDomain(editionContext);
    if (editingDomain != null) {
        DomainPropertiesEditionContext domainPropertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, editionContext.getAdapterFactory(), editionContext.getEObject());
        WizardEditingOperation operation = new WizardEditingOperation(domainPropertiesEditionContext);
        try {
            operation.execute(new NullProgressMonitor(), null);
        } catch (ExecutionException e) {
            EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
        }
    } else {
        super.execute();
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) DomainPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext) ExecutionException(org.eclipse.core.commands.ExecutionException) WizardEditingOperation(org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)

Example 3 with WizardEditingOperation

use of org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation in project InformationSystem by ObeoNetwork.

the class EditRequirementAction method run.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.jface.action.Action#run()
 */
@Override
public void run() {
    RequirementLink eObjectLink = (RequirementLink) linksView.getSelectedEntries().get(0);
    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(linksView.getInput());
    DomainPropertiesEditionContext propertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, linksView.getAdapterFactory(), eObjectLink.getRequirement());
    WizardEditingOperation operation = new RequirementEditingOperation(propertiesEditionContext);
    try {
        operation.execute(new NullProgressMonitor(), null);
        linksView.refresh();
    } catch (ExecutionException e) {
        // $NON-NLS-1$
        EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) RequirementEditingOperation(org.obeonetwork.tools.requirement.wizard.operation.RequirementEditingOperation) RequirementLink(org.obeonetwork.tools.requirement.core.RequirementLink) DomainPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext) ExecutionException(org.eclipse.core.commands.ExecutionException) WizardEditingOperation(org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)

Example 4 with WizardEditingOperation

use of org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation in project InformationSystem by ObeoNetwork.

the class LinkedRequirementsView method createDoubleClickAction.

/**
 * {@inheritDoc}
 *
 * @see org.obeonetwork.tools.linker.ui.view.EObjectLinksView#createDoubleClickAction()
 */
@Override
protected Action createDoubleClickAction() {
    return new Action() {

        /**
         * {@inheritDoc}
         *
         * @see org.eclipse.jface.action.Action#run()
         */
        @Override
        public void run() {
            if (getSelectedEntries().size() > 0) {
                RequirementLink eObjectLink = (RequirementLink) getSelectedEntries().get(0);
                TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getInput());
                DomainPropertiesEditionContext propertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, adapterFactory, eObjectLink.getRequirement());
                WizardEditingOperation operation = new RequirementEditingOperation(propertiesEditionContext);
                try {
                    operation.execute(new NullProgressMonitor(), null);
                    refresh();
                } catch (ExecutionException e) {
                    // $NON-NLS-1$
                    EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
                }
            }
        }
    };
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) EditRequirementAction(org.obeonetwork.tools.requirement.ui.view.action.EditRequirementAction) LinkRequirementAction(org.obeonetwork.tools.requirement.ui.view.action.LinkRequirementAction) CreateRequirementAction(org.obeonetwork.tools.requirement.ui.view.action.CreateRequirementAction) UnlinkRequirementAction(org.obeonetwork.tools.requirement.ui.view.action.UnlinkRequirementAction) Action(org.eclipse.jface.action.Action) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) RequirementEditingOperation(org.obeonetwork.tools.requirement.wizard.operation.RequirementEditingOperation) RequirementLink(org.obeonetwork.tools.requirement.core.RequirementLink) DomainPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext) ExecutionException(org.eclipse.core.commands.ExecutionException) WizardEditingOperation(org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)

Example 5 with WizardEditingOperation

use of org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation in project InformationSystem by ObeoNetwork.

the class CustomEditingPolicy method execute.

/**
 * (non-Javadoc)
 *
 * @see org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy#execute()
 */
@Override
public void execute() {
    EditingDomain editingDomain = EEFUtils.getEditingDomain(editionContext);
    if (editingDomain != null) {
        DomainPropertiesEditionContext domainPropertiesEditionContext = new DomainPropertiesEditionContext(null, null, editingDomain, editionContext.getAdapterFactory(), editionContext.getEObject());
        WizardEditingOperation operation = new WizardEditingOperation(domainPropertiesEditionContext);
        try {
            operation.execute(new NullProgressMonitor(), null);
        } catch (ExecutionException e) {
            EEFRuntimePlugin.getDefault().logError("An error occured during wizard editing.", e);
        }
    } else {
        super.execute();
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) EditingDomain(org.eclipse.emf.edit.domain.EditingDomain) DomainPropertiesEditionContext(org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext) ExecutionException(org.eclipse.core.commands.ExecutionException) WizardEditingOperation(org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)

Aggregations

ExecutionException (org.eclipse.core.commands.ExecutionException)5 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)5 DomainPropertiesEditionContext (org.eclipse.emf.eef.runtime.context.impl.DomainPropertiesEditionContext)5 WizardEditingOperation (org.eclipse.emf.eef.runtime.impl.operation.WizardEditingOperation)5 EditingDomain (org.eclipse.emf.edit.domain.EditingDomain)3 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)2 RequirementLink (org.obeonetwork.tools.requirement.core.RequirementLink)2 RequirementEditingOperation (org.obeonetwork.tools.requirement.wizard.operation.RequirementEditingOperation)2 Action (org.eclipse.jface.action.Action)1 CreateRequirementAction (org.obeonetwork.tools.requirement.ui.view.action.CreateRequirementAction)1 EditRequirementAction (org.obeonetwork.tools.requirement.ui.view.action.EditRequirementAction)1 LinkRequirementAction (org.obeonetwork.tools.requirement.ui.view.action.LinkRequirementAction)1 UnlinkRequirementAction (org.obeonetwork.tools.requirement.ui.view.action.UnlinkRequirementAction)1