Search in sources :

Example 51 with RefreshAction

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

the class TableLastValuesView method createActions.

/**
 * Create actions
 */
private void createActions() {
    actionRefresh = new RefreshAction(this) {

        @Override
        public void run() {
            refreshTable();
        }
    };
    actionExportAllToCsv = new ExportToCsvAction(this, viewer.getViewer(), false);
}
Also used : RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction)

Example 52 with RefreshAction

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

the class ObjectStatusMapView method createActions.

/**
 * Create actions
 */
private void createActions() {
    actionRefresh = new RefreshAction(this) {

        @Override
        public void run() {
            map.refresh();
        }
    };
    actionFlatView = new Action("&Flat view", Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            ((ObjectStatusMap) map).setGroupObjects(false);
            map.refresh();
        }
    };
    actionFlatView.setChecked(displayOption == 0);
    actionFlatView.setImageDescriptor(Activator.getImageDescriptor("icons/not_grouped_nodes.png"));
    actionGroupView = new Action("&Group view", Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            ((ObjectStatusMap) map).setGroupObjects(true);
            map.refresh();
        }
    };
    actionGroupView.setChecked(displayOption == 1);
    actionGroupView.setImageDescriptor(Activator.getImageDescriptor("icons/grouped_nodes.png"));
    actionRadialView = new Action("&Radial view", Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            redraw(actionRadialView.isChecked());
        }
    };
    actionRadialView.setChecked(displayOption == 2);
    actionRadialView.setImageDescriptor(Activator.getImageDescriptor("icons/radial.png"));
    actionShowFilter = new Action(Messages.get().ObjectStatusMapView_ActionShowFilter, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            showFilter = actionShowFilter.isChecked();
            map.enableFilter(showFilter);
        }
    };
    actionShowFilter.setChecked(showFilter);
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 53 with RefreshAction

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

the class SoftwareInventoryView method createActions.

/**
 * Create actions
 */
private void createActions() {
    actionRefresh = new RefreshAction(this) {

        @Override
        public void run() {
            inventoryWidget.refresh();
        }
    };
    ViewerProvider vp = new ViewerProvider() {

        @Override
        public ColumnViewer getViewer() {
            return inventoryWidget.getViewer();
        }
    };
    actionExportToCsv = new ExportToCsvAction(this, vp, true);
    actionExportAllToCsv = new ExportToCsvAction(this, vp, false);
}
Also used : RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) ViewerProvider(org.netxms.ui.eclipse.actions.ViewerProvider) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction)

Example 54 with RefreshAction

use of org.netxms.ui.eclipse.actions.RefreshAction 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)

Example 55 with RefreshAction

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

the class MappingTableEditor method createActions.

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

        @Override
        public void run() {
            if (modified)
                if (!MessageDialogHelper.openQuestion(getSite().getShell(), Messages.get().MappingTableEditor_RefreshConfirmation, Messages.get().MappingTableEditor_RefreshConfirmationText))
                    return;
            refresh();
        }
    };
    actionNewRow = new Action(Messages.get().MappingTableEditor_NewRow, SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            addNewRow();
        }
    };
    actionNewRow.setEnabled(false);
    // $NON-NLS-1$
    actionNewRow.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.add_new_row");
    handlerService.activateHandler(actionNewRow.getActionDefinitionId(), new ActionHandler(actionNewRow));
    actionDelete = new Action(Messages.get().MappingTableEditor_Delete, SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            deleteRows();
        }
    };
    actionDelete.setEnabled(false);
    // $NON-NLS-1$
    actionDelete.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.delete_rows");
    handlerService.activateHandler(actionDelete.getActionDefinitionId(), new ActionHandler(actionDelete));
    actionSave = new Action(Messages.get().MappingTableEditor_Save, SharedIcons.SAVE) {

        @Override
        public void run() {
            new SaveJob().start();
        }
    };
    actionSave.setEnabled(false);
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) IHandlerService(org.eclipse.ui.handlers.IHandlerService) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) ActionHandler(org.eclipse.jface.commands.ActionHandler)

Aggregations

RefreshAction (org.netxms.ui.eclipse.actions.RefreshAction)55 Action (org.eclipse.jface.action.Action)44 IHandlerService (org.eclipse.ui.handlers.IHandlerService)25 ActionHandler (org.eclipse.jface.commands.ActionHandler)23 ExportToCsvAction (org.netxms.ui.eclipse.actions.ExportToCsvAction)17 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 ActionHandler (org.eclipse.ui.commands.ActionHandler)2 PropertyDialogAction (org.eclipse.ui.dialogs.PropertyDialogAction)2 IOException (java.io.IOException)1 Iterator (java.util.Iterator)1 Point (org.eclipse.draw2d.geometry.Point)1 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 SWTException (org.eclipse.swt.SWTException)1 PropertyDialog (org.eclipse.ui.internal.dialogs.PropertyDialog)1 LibraryImage (org.netxms.client.LibraryImage)1 NXCException (org.netxms.client.NXCException)1 ServerAction (org.netxms.client.ServerAction)1 GraphSettings (org.netxms.client.datacollection.GraphSettings)1 MapLayoutAlgorithm (org.netxms.client.maps.MapLayoutAlgorithm)1