use of com.archimatetool.editor.views.tree.commands.NewFolderCommand in project archi by archimatetool.
the class NewFolderAction method run.
@Override
public void run() {
Object selected = getSelection().getFirstElement();
if (selected instanceof IFolder) {
IFolder parent = (IFolder) selected;
// Create a new Folder, set its name
IFolder folder = IArchimateFactory.eINSTANCE.createFolder();
folder.setName(Messages.NewFolderAction_1);
folder.setType(FolderType.USER);
// Execute Command
Command cmd = new NewFolderCommand(parent, folder);
CommandStack commandStack = (CommandStack) parent.getAdapter(CommandStack.class);
commandStack.execute(cmd);
}
}
Aggregations