Search in sources :

Example 41 with RefreshAction

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

the class CertificateView method createActions.

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

        @Override
        public void run() {
            refreshCertificateList();
        }
    };
    actionNew = new Action(Messages.get().CertificateView_CreateNewCertif) {

        @Override
        public void run() {
            createCertificate();
        }
    };
    actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
    actionEdit = new Action(Messages.get().CertificateView_EditCertifData) {

        @Override
        public void run() {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            if (selection.size() != 1)
                return;
            final long certId = ((AuthCertificate) selection.getFirstElement()).getId();
            AuthCertificate cert = certificates.get(certId);
            if ((cert != null)) {
                saveCertificate(cert);
            }
        }
    };
    actionEdit.setImageDescriptor(SharedIcons.EDIT);
    actionDelete = new Action(Messages.get().CertificateView_DeleteCertif) {

        @Override
        public void run() {
            deleteCertificate();
        }
    };
    actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) AuthCertificate(org.netxms.client.users.AuthCertificate) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 42 with RefreshAction

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

the class DashboardView method createActions.

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

        @Override
        public void run() {
            if (dbc.isModified()) {
                if (!MessageDialogHelper.openConfirm(getSite().getShell(), Messages.get().DashboardView_Refresh, Messages.get().DashboardView_Confirmation))
                    return;
            }
            rebuildDashboard(true);
        }
    };
    actionSave = new Action(Messages.get().DashboardView_Save, SharedIcons.SAVE) {

        @Override
        public void run() {
            dbc.saveDashboard(DashboardView.this);
        }
    };
    actionSave.setEnabled(false);
    actionExportValues = new Action(Messages.get().DashboardView_ExportLineChartValues, SharedIcons.CSV) {

        @Override
        public void run() {
            exportLineChartValues();
        }
    };
    // $NON-NLS-1$
    actionExportValues.setActionDefinitionId("org.netxms.ui.eclipse.dashboard.commands.export_line_chart_values");
    handlerService.activateHandler(actionExportValues.getActionDefinitionId(), new ActionHandler(actionExportValues));
    actionEditMode = new Action(Messages.get().DashboardView_EditMode, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            dbc.setEditMode(!dbc.isEditMode());
            actionEditMode.setChecked(dbc.isEditMode());
            if (!dbc.isEditMode())
                rebuildDashboard(false);
        }
    };
    actionEditMode.setImageDescriptor(SharedIcons.EDIT);
    actionEditMode.setChecked(dbc.isEditMode());
    actionAddSyslogMonitor = new Action("Add s&yslog monitor") {

        @Override
        public void run() {
            dbc.addSyslogMonitor();
        }
    };
    actionAddSnmpTrapMonitor = new Action("Add S&NMP trap monitor") {

        @Override
        public void run() {
            dbc.addSnmpTrapMonitor();
        }
    };
    actionAddEventMonitor = new Action("Add &event monitor") {

        @Override
        public void run() {
            dbc.addEventMonitor();
        }
    };
    actionAddAlarmBrowser = new Action(Messages.get().DashboardView_AddAlarmBrowser) {

        @Override
        public void run() {
            dbc.addAlarmBrowser();
        }
    };
    actionAddLabel = new Action(Messages.get().DashboardView_AddLabel) {

        @Override
        public void run() {
            dbc.addLabel();
        }
    };
    actionAddBarChart = new Action(Messages.get().DashboardView_AddBarChart) {

        @Override
        public void run() {
            dbc.addBarChart();
        }
    };
    actionAddPieChart = new Action(Messages.get().DashboardView_AddPieChart) {

        @Override
        public void run() {
            dbc.addPieChart();
        }
    };
    actionAddTubeChart = new Action(Messages.get().DashboardView_AddTubeChart) {

        @Override
        public void run() {
            dbc.addTubeChart();
        }
    };
    actionAddLineChart = new Action(Messages.get().DashboardView_AddLineChart) {

        @Override
        public void run() {
            dbc.addLineChart();
        }
    };
    actionAddAvailabilityChart = new Action(Messages.get().DashboardView_AddAvailChart) {

        @Override
        public void run() {
            dbc.addAvailabilityChart();
        }
    };
    actionAddDashboard = new Action(Messages.get().DashboardView_AddDashboard) {

        @Override
        public void run() {
            dbc.addEmbeddedDashboard();
        }
    };
    actionAddStatusIndicator = new Action(Messages.get().DashboardView_AddStatusIndicator) {

        @Override
        public void run() {
            dbc.addStatusIndicator();
        }
    };
}
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)

Example 43 with RefreshAction

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

the class AlarmCategoryConfigurator method createActions.

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

        /*
          * (non-Javadoc)
          * 
          * @see org.eclipse.jface.action.Action#run()
          */
        @Override
        public void run() {
            dataView.refreshView();
        }
    };
    actionShowFilter = new Action() {

        /*
          * (non-Javadoc)
          * 
          * @see org.eclipse.jface.action.Action#run()
          */
        @Override
        public void run() {
            enableFilter(actionShowFilter.isChecked());
        }
    };
    actionShowFilter.setText("Show filter");
    actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
    actionShowFilter.setChecked(initShowfilter);
    // $NON-NLS-1$
    actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_category");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
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)

Example 44 with RefreshAction

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

the class ObjectAlarmBrowser method createActions.

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

        @Override
        public void run() {
            alarmView.refresh();
            showObjectList();
        }
    };
    actionExportToCsv = new ExportToCsvAction(this, alarmView.getViewer(), false);
}
Also used : RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction)

Example 45 with RefreshAction

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

the class AgentConfigEditorView method createActions.

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

        private static final long serialVersionUID = 1L;

        @Override
        public void run() {
        }
    };
    actionSave = new Action() {

        @Override
        public void run() {
            doSave(null);
        }
    };
    actionSave.setText(Messages.get().AgentConfigEditorView_Save);
    actionSave.setImageDescriptor(SharedIcons.SAVE);
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

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