Search in sources :

Example 21 with ExportToCsvAction

use of org.netxms.ui.eclipse.actions.ExportToCsvAction in project netxms by netxms.

the class MibExplorer method createActions.

/**
 * Create actions
 */
private void createActions() {
    final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    actionRefresh = new RefreshAction() {

        @Override
        public void run() {
            mibBrowser.refreshTree();
        }
    };
    actionWalk = new Action(Messages.get().MibExplorer_Walk) {

        @Override
        public void run() {
            doWalk();
        }
    };
    actionWalk.setEnabled(currentNode != null);
    actionSetNode = new Action(Messages.get().MibExplorer_SetNodeObject) {

        @Override
        public void run() {
            ObjectSelectionDialog dlg = new ObjectSelectionDialog(MibExplorer.this.getSite().getShell(), null, ObjectSelectionDialog.createNodeSelectionFilter(false));
            dlg.enableMultiSelection(false);
            if (dlg.open() == Window.OK) {
                setNode((AbstractNode) dlg.getSelectedObjects().get(0));
            }
        }
    };
    actionSelect = new Action("Select in MIB tree") {

        @Override
        public void run() {
            selectInTree();
        }
    };
    actionSelect.setEnabled(false);
    actionExportToCsv = new ExportToCsvAction(this, viewer, true);
    actionShowFilter = new Action("Show filter", Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            enableFilter(!initShowFilter);
            actionShowFilter.setChecked(initShowFilter);
        }
    };
    actionShowFilter.setChecked(initShowFilter);
    // $NON-NLS-1$
    actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.snmp.commands.showFilter");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
Also used : ObjectSelectionDialog(org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) Action(org.eclipse.jface.action.Action) IHandlerService(org.eclipse.ui.handlers.IHandlerService) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) AbstractNode(org.netxms.client.objects.AbstractNode) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction) ActionHandler(org.eclipse.jface.commands.ActionHandler)

Aggregations

ExportToCsvAction (org.netxms.ui.eclipse.actions.ExportToCsvAction)21 RefreshAction (org.netxms.ui.eclipse.actions.RefreshAction)17 Action (org.eclipse.jface.action.Action)11 ActionHandler (org.eclipse.jface.commands.ActionHandler)5 IHandlerService (org.eclipse.ui.handlers.IHandlerService)5 IAction (org.eclipse.jface.action.IAction)1 AbstractNode (org.netxms.client.objects.AbstractNode)1 ViewerProvider (org.netxms.ui.eclipse.actions.ViewerProvider)1 AcknowledgeCustomTimeDialog (org.netxms.ui.eclipse.alarmviewer.dialogs.AcknowledgeCustomTimeDialog)1 ObjectSelectionDialog (org.netxms.ui.eclipse.objectbrowser.dialogs.ObjectSelectionDialog)1