Search in sources :

Example 1 with EditDocumentationLinkCommand

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

the class EditDocumentationLink 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) {
        DocumentationLink editedLink = (DocumentationLink) linksView.getSelectedEntries().get(0);
        DocumentationLinkDialog dialog = new DocumentationLinkDialog(linksView.getSite().getShell(), editedLink);
        int open = dialog.open();
        if (open == Window.OK) {
            editingDomain.getCommandStack().execute(new EditDocumentationLinkCommand(editedLink, dialog.getName(), dialog.getValue()));
            linksView.refresh();
        }
    }
}
Also used : DocumentationLinkDialog(org.obeonetwork.tools.doc.ui.dialog.DocumentationLinkDialog) EditDocumentationLinkCommand(org.obeonetwork.tools.doc.core.command.EditDocumentationLinkCommand) TransactionalEditingDomain(org.eclipse.emf.transaction.TransactionalEditingDomain) DocumentationLink(org.obeonetwork.tools.doc.core.DocumentationLink) EObject(org.eclipse.emf.ecore.EObject)

Aggregations

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