Search in sources :

Example 6 with NonNotifyingCompoundCommand

use of com.archimatetool.editor.model.commands.NonNotifyingCompoundCommand in project archi by archimatetool.

the class RenameCommandHandler method getCompoundCommand.

/**
 * Get, and if need be create, a CompoundCommand to which to add the object to be renamed command
 */
private static CompoundCommand getCompoundCommand(IAdapter object, Hashtable<CommandStack, CompoundCommand> commandMap) {
    // Get the Command Stack registered to the object
    CommandStack stack = (CommandStack) object.getAdapter(CommandStack.class);
    if (stack == null) {
        // $NON-NLS-1$
        System.err.println("CommandStack was null in getCompoundCommand");
        return null;
    }
    // Now get or create a Compound Command
    CompoundCommand compoundCommand = commandMap.get(stack);
    if (compoundCommand == null) {
        compoundCommand = new NonNotifyingCompoundCommand(Messages.RenameCommandHandler_0);
        commandMap.put(stack, compoundCommand);
    }
    return compoundCommand;
}
Also used : CommandStack(org.eclipse.gef.commands.CommandStack) NonNotifyingCompoundCommand(com.archimatetool.editor.model.commands.NonNotifyingCompoundCommand) CompoundCommand(org.eclipse.gef.commands.CompoundCommand) NonNotifyingCompoundCommand(com.archimatetool.editor.model.commands.NonNotifyingCompoundCommand)

Aggregations

NonNotifyingCompoundCommand (com.archimatetool.editor.model.commands.NonNotifyingCompoundCommand)6 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)6 CommandStack (org.eclipse.gef.commands.CommandStack)4 IArchimateConcept (com.archimatetool.model.IArchimateConcept)2 IArchimateElement (com.archimatetool.model.IArchimateElement)2 IArchimateModelObject (com.archimatetool.model.IArchimateModelObject)2 IArchimateRelationship (com.archimatetool.model.IArchimateRelationship)2 IDiagramModel (com.archimatetool.model.IDiagramModel)2 IDiagramModelArchimateConnection (com.archimatetool.model.IDiagramModelArchimateConnection)2 IDiagramModelArchimateObject (com.archimatetool.model.IDiagramModelArchimateObject)2 IDiagramModelComponent (com.archimatetool.model.IDiagramModelComponent)2 ArrayList (java.util.ArrayList)2 EObject (org.eclipse.emf.ecore.EObject)2 Command (org.eclipse.gef.commands.Command)2 AddDiagramModelReferenceCommand (com.archimatetool.editor.diagram.commands.AddDiagramModelReferenceCommand)1 AddDiagramObjectCommand (com.archimatetool.editor.diagram.commands.AddDiagramObjectCommand)1 CreateNestedArchimateConnectionsWithDialogCommand (com.archimatetool.editor.diagram.commands.CreateNestedArchimateConnectionsWithDialogCommand)1 DeleteArchimateElementCommand (com.archimatetool.editor.model.commands.DeleteArchimateElementCommand)1 DeleteArchimateRelationshipCommand (com.archimatetool.editor.model.commands.DeleteArchimateRelationshipCommand)1 EObjectFeatureCommand (com.archimatetool.editor.model.commands.EObjectFeatureCommand)1