use of com.archimatetool.editor.views.tree.TreeSelectionRequest in project archi by archimatetool.
the class DuplicateCommandHandler method duplicate.
/**
* Perform the duplicate command
*/
public void duplicate() {
// Gather the elements to duplicate
getElementsToDuplicate();
// Create the Commands
createCommands();
// Execute the Commands on the CommandStack(s) - there could be more than one if more than one model open in the Tree
for (Entry<CommandStack, CompoundCommand> entry : fCommandMap.entrySet()) {
entry.getKey().execute(entry.getValue());
}
// Select new objects in Tree
UIRequestManager.INSTANCE.fireRequest(new TreeSelectionRequest(this, new StructuredSelection(fNewObjects), true));
dispose();
}
use of com.archimatetool.editor.views.tree.TreeSelectionRequest in project archi by archimatetool.
the class NewDiagramCommand method redo.
@Override
public void redo() {
fFolder.getElements().add(fDiagramModel);
// Select
UIRequestManager.INSTANCE.fireRequest(new TreeSelectionRequest(this, new StructuredSelection(fDiagramModel), true));
// Open Editor
EditorManager.openDiagramEditor(fDiagramModel);
}
use of com.archimatetool.editor.views.tree.TreeSelectionRequest in project archi by archimatetool.
the class NewDiagramCommand method undo.
@Override
public void undo() {
// Close the Editor FIRST!
EditorManager.closeDiagramEditor(fDiagramModel);
fFolder.getElements().remove(fDiagramModel);
// Select the parent node if no node is selected (this happens when the node is deleted)
TreeSelectionRequest request = new TreeSelectionRequest(this, new StructuredSelection(fFolder), true) {
@Override
public boolean shouldSelect(Viewer viewer) {
return viewer.getSelection().isEmpty();
}
};
UIRequestManager.INSTANCE.fireRequest(request);
}
use of com.archimatetool.editor.views.tree.TreeSelectionRequest in project archi by archimatetool.
the class NewElementCommand method undo.
@Override
public void undo() {
fFolder.getElements().remove(fElement);
// Select the parent node if no node is selected (this happens when the node is deleted)
TreeSelectionRequest request = new TreeSelectionRequest(this, new StructuredSelection(fFolder), true) {
@Override
public boolean shouldSelect(Viewer viewer) {
return viewer.getSelection().isEmpty();
}
};
UIRequestManager.INSTANCE.fireRequest(request);
}
use of com.archimatetool.editor.views.tree.TreeSelectionRequest in project archi by archimatetool.
the class NewFolderCommand method redo.
@Override
public void redo() {
fParent.getFolders().add(fFolder);
// Select
UIRequestManager.INSTANCE.fireRequest(new TreeSelectionRequest(this, new StructuredSelection(fFolder), true));
}
Aggregations