Search in sources :

Example 1 with PropertiesAction

use of com.archimatetool.editor.views.tree.actions.PropertiesAction in project archi by archimatetool.

the class ZestView method makeActions.

/**
 * Make local actions
 */
private void makeActions() {
    fActionProperties = new PropertiesAction(getViewer());
    fActionLayout = new Action(Messages.ZestView_0) {

        @Override
        public void run() {
            fGraphViewer.doApplyLayout();
        }

        @Override
        public String getToolTipText() {
            return getText();
        }

        @Override
        public ImageDescriptor getImageDescriptor() {
            return AbstractUIPlugin.imageDescriptorFromPlugin(ArchiZestPlugin.PLUGIN_ID, // $NON-NLS-1$
            "img/layout.gif");
        }
    };
    fActionPinContent = new Action(Messages.ZestView_4, IAction.AS_CHECK_BOX) {

        {
            setToolTipText(Messages.ZestView_1);
            setImageDescriptor(IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_PIN));
        }
    };
    fActionCopyImageToClipboard = new CopyZestViewAsImageToClipboardAction(fGraphViewer);
    fActionExportImageToFile = new ExportAsImageAction(fGraphViewer);
    fActionSelectInModelTree = new Action(Messages.ZestView_8) {

        @Override
        public void run() {
            IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
            ITreeModelView view = (ITreeModelView) ViewManager.showViewPart(ITreeModelView.ID, true);
            if (view != null && !selection.isEmpty()) {
                view.getViewer().setSelection(new StructuredSelection(selection.toArray()), true);
            }
        }

        @Override
        public String getToolTipText() {
            return getText();
        }
    };
}
Also used : ITreeModelView(com.archimatetool.editor.views.tree.ITreeModelView) IAction(org.eclipse.jface.action.IAction) IViewerAction(com.archimatetool.editor.views.tree.actions.IViewerAction) PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction) Action(org.eclipse.jface.action.Action) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction)

Example 2 with PropertiesAction

use of com.archimatetool.editor.views.tree.actions.PropertiesAction 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);
        }
    };
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) NewArchimateModelAction(com.archimatetool.editor.actions.NewArchimateModelAction) DuplicateAction(com.archimatetool.editor.views.tree.actions.DuplicateAction) IAction(org.eclipse.jface.action.IAction) IViewerAction(com.archimatetool.editor.views.tree.actions.IViewerAction) OpenModelAction(com.archimatetool.editor.actions.OpenModelAction) DeleteAction(com.archimatetool.editor.views.tree.actions.DeleteAction) GenerateViewAction(com.archimatetool.editor.views.tree.actions.GenerateViewAction) PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction) NewFolderAction(com.archimatetool.editor.views.tree.actions.NewFolderAction) CloseModelAction(com.archimatetool.editor.views.tree.actions.CloseModelAction) SaveModelAction(com.archimatetool.editor.views.tree.actions.SaveModelAction) RenameAction(com.archimatetool.editor.views.tree.actions.RenameAction) LinkToEditorAction(com.archimatetool.editor.views.tree.actions.LinkToEditorAction) FindReplaceAction(com.archimatetool.editor.views.tree.actions.FindReplaceAction) Action(org.eclipse.jface.action.Action) NewArchimateModelAction(com.archimatetool.editor.actions.NewArchimateModelAction) OpenDiagramAction(com.archimatetool.editor.views.tree.actions.OpenDiagramAction) CloseModelAction(com.archimatetool.editor.views.tree.actions.CloseModelAction) FindReplaceAction(com.archimatetool.editor.views.tree.actions.FindReplaceAction) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) NewFolderAction(com.archimatetool.editor.views.tree.actions.NewFolderAction) PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction) LinkToEditorAction(com.archimatetool.editor.views.tree.actions.LinkToEditorAction) SaveModelAction(com.archimatetool.editor.views.tree.actions.SaveModelAction) OpenModelAction(com.archimatetool.editor.actions.OpenModelAction) DeleteAction(com.archimatetool.editor.views.tree.actions.DeleteAction) GenerateViewAction(com.archimatetool.editor.views.tree.actions.GenerateViewAction) IArchimateModelObject(com.archimatetool.model.IArchimateModelObject) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) RenameAction(com.archimatetool.editor.views.tree.actions.RenameAction) OpenDiagramAction(com.archimatetool.editor.views.tree.actions.OpenDiagramAction) DuplicateAction(com.archimatetool.editor.views.tree.actions.DuplicateAction)

Example 3 with PropertiesAction

use of com.archimatetool.editor.views.tree.actions.PropertiesAction in project archi by archimatetool.

the class NavigatorView method makeActions.

/**
 * Make local actions
 */
private void makeActions() {
    fActionProperties = new PropertiesAction(getViewer());
    fActionPinContent = new Action(Messages.NavigatorView_0, IAction.AS_CHECK_BOX) {

        {
            setToolTipText(Messages.NavigatorView_1);
            setImageDescriptor(IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_PIN));
        }
    };
    fActionNavDown = new Action(Messages.NavigatorView_2, IAction.AS_RADIO_BUTTON) {

        {
            setToolTipText(Messages.NavigatorView_3);
            setImageDescriptor(IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_NAVIGATOR_DOWNWARD));
            setChecked(true);
        }

        @Override
        public void run() {
            fActionNavUp.setChecked(false);
            fTreeViewer.setShowTargetElements(true);
        }
    };
    fActionNavUp = new Action(Messages.NavigatorView_4, IAction.AS_RADIO_BUTTON) {

        {
            setToolTipText(Messages.NavigatorView_5);
            setImageDescriptor(IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_NAVIGATOR_UPWARD));
        }

        @Override
        public void run() {
            fActionNavDown.setChecked(false);
            fTreeViewer.setShowTargetElements(false);
        }
    };
}
Also used : PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction) IAction(org.eclipse.jface.action.IAction) IViewerAction(com.archimatetool.editor.views.tree.actions.IViewerAction) Action(org.eclipse.jface.action.Action) PropertiesAction(com.archimatetool.editor.views.tree.actions.PropertiesAction)

Aggregations

IViewerAction (com.archimatetool.editor.views.tree.actions.IViewerAction)3 PropertiesAction (com.archimatetool.editor.views.tree.actions.PropertiesAction)3 Action (org.eclipse.jface.action.Action)3 IAction (org.eclipse.jface.action.IAction)3 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 NewArchimateModelAction (com.archimatetool.editor.actions.NewArchimateModelAction)1 OpenModelAction (com.archimatetool.editor.actions.OpenModelAction)1 ITreeModelView (com.archimatetool.editor.views.tree.ITreeModelView)1 CloseModelAction (com.archimatetool.editor.views.tree.actions.CloseModelAction)1 DeleteAction (com.archimatetool.editor.views.tree.actions.DeleteAction)1 DuplicateAction (com.archimatetool.editor.views.tree.actions.DuplicateAction)1 FindReplaceAction (com.archimatetool.editor.views.tree.actions.FindReplaceAction)1 GenerateViewAction (com.archimatetool.editor.views.tree.actions.GenerateViewAction)1 LinkToEditorAction (com.archimatetool.editor.views.tree.actions.LinkToEditorAction)1 NewFolderAction (com.archimatetool.editor.views.tree.actions.NewFolderAction)1 OpenDiagramAction (com.archimatetool.editor.views.tree.actions.OpenDiagramAction)1 RenameAction (com.archimatetool.editor.views.tree.actions.RenameAction)1 SaveModelAction (com.archimatetool.editor.views.tree.actions.SaveModelAction)1 IArchimateModelObject (com.archimatetool.model.IArchimateModelObject)1