Search in sources :

Example 1 with IAdapter

use of com.archimatetool.model.IAdapter in project archi by archimatetool.

the class AbstractECorePropertySection method executeCommand.

/**
 * Execuate a command on the selected objects' CommandStack
 * @param cmd
 */
protected void executeCommand(Command command) {
    fIsExecutingCommand = true;
    EObject eObject = getFirstSelectedObject();
    if (eObject != null && eObject instanceof IAdapter) {
        CommandStack commandStack = (CommandStack) ((IAdapter) eObject).getAdapter(CommandStack.class);
        if (commandStack != null) {
            commandStack.execute(command);
        }
    }
    fIsExecutingCommand = false;
}
Also used : CommandStack(org.eclipse.gef.commands.CommandStack) EObject(org.eclipse.emf.ecore.EObject) IAdapter(com.archimatetool.model.IAdapter)

Aggregations

IAdapter (com.archimatetool.model.IAdapter)1 EObject (org.eclipse.emf.ecore.EObject)1 CommandStack (org.eclipse.gef.commands.CommandStack)1