Search in sources :

Example 1 with AddDocumentationLinkCommand

use of org.obeonetwork.tools.doc.core.command.AddDocumentationLinkCommand in project InformationSystem by ObeoNetwork.

the class AddDocumentationLink method run.

/**
 * {@inheritDoc}
 * @see org.eclipse.jface.action.Action#run()
 */
@Override
public void run() {
    EObject input = linksView.getInput();
    TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(input);
    if (editingDomain != null) {
        DocumentationLinkDialog dialog = new DocumentationLinkDialog(linksView.getSite().getShell());
        int open = dialog.open();
        if (open == Window.OK) {
            editingDomain.getCommandStack().execute(new AddDocumentationLinkCommand(input, dialog.getName(), dialog.getValue()));
            linksView.refresh();
        }
    }
}
Also used : DocumentationLinkDialog(org.obeonetwork.tools.doc.ui.dialog.DocumentationLinkDialog) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) EObject(org.eclipse.emf.ecore.EObject) AddDocumentationLinkCommand(org.obeonetwork.tools.doc.core.command.AddDocumentationLinkCommand)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 TransactionalEditingDomain (org.eclipse.emf.transaction.TransactionalEditingDomain)1 AddDocumentationLinkCommand (org.obeonetwork.tools.doc.core.command.AddDocumentationLinkCommand)1 DocumentationLinkDialog (org.obeonetwork.tools.doc.ui.dialog.DocumentationLinkDialog)1