use of com.archimatetool.editor.actions.NewArchimateModelAction in project archi by archimatetool.
the class TreeModelView method makeActions.
/**
* Make local actions
*/
private void makeActions() {
IWorkbenchWindow window = getViewSite().getWorkbenchWindow();
fActionNewModel = new NewArchimateModelAction();
fActionOpenModel = new OpenModelAction(window);
fActionOpenDiagram = new OpenDiagramAction(getSelectionProvider());
fActionCloseModel = new CloseModelAction(getSelectionProvider());
fActionSaveModel = new SaveModelAction(this);
fActionDelete = new DeleteAction(getViewer());
fActionRename = new RenameAction(getViewer());
fActionFindReplace = new FindReplaceAction(this);
fActionProperties = new PropertiesAction(getSelectionProvider());
fActionLinkToEditor = new LinkToEditorAction();
fActionNewFolder = new NewFolderAction(getSelectionProvider());
fActionDuplicate = new DuplicateAction(getViewer());
fActionGenerateView = new GenerateViewAction(getSelectionProvider());
fActionToggleSearchField = new // $NON-NLS-1$
Action(// $NON-NLS-1$
"", // $NON-NLS-1$
IAction.AS_CHECK_BOX) {
@Override
public void run() {
if (isChecked()) {
showSearchWidget();
} else {
hideSearchWidget();
}
}
};
fActionToggleSearchField.setToolTipText(Messages.TreeModelView_0);
fActionToggleSearchField.setImageDescriptor(IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_SEARCH));
fActionCollapseSelected = new Action(Messages.TreeModelView_3) {
@Override
public void run() {
IStructuredSelection selection = ((IStructuredSelection) getViewer().getSelection());
for (Object o : selection.toArray()) {
if (fTreeViewer.isExpandable(o) && fTreeViewer.getExpandedState(o)) {
fTreeViewer.collapseToLevel(o, AbstractTreeViewer.ALL_LEVELS);
}
}
}
@Override
public ImageDescriptor getImageDescriptor() {
return IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_COLLAPSEALL);
}
};
fActionExpandSelected = new Action(Messages.TreeModelView_4) {
@Override
public void run() {
IStructuredSelection selection = ((IStructuredSelection) getViewer().getSelection());
for (Object o : selection.toArray()) {
if (hasExpandableNodes(o)) {
fTreeViewer.expandToLevel(o, AbstractTreeViewer.ALL_LEVELS);
}
}
}
@Override
public ImageDescriptor getImageDescriptor() {
return IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_EXPANDALL);
}
};
}
Aggregations