Search in sources :

Example 21 with RefreshAction

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

the class TemplateGraphView method createActions.

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

        @Override
        public void run() {
            refreshData();
        }
    };
    actionEdit = new Action("Edit graph") {

        @Override
        public void run() {
            editTemplateGraph();
        }
    };
    actionAdd = new Action("Create new template graph", SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            saveGraph("", null, false);
        }
    };
    actionDelete = new Action("Delete template graph") {

        @Override
        public void run() {
            deletePredefinedGraph();
        }
    };
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 22 with RefreshAction

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

the class AbstractPolicyEditor method createActions.

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

        @Override
        public void run() {
            refresh();
        }
    };
    actionSave = new Action("Save", SharedIcons.SAVE) {

        @Override
        public void run() {
            save();
        }
    };
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 23 with RefreshAction

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

the class DataComparisonView method createActions.

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

        @Override
        public void run() {
            updateChart();
        }
    };
    actionAutoRefresh = new Action(Messages.get().DataComparisonView_AutoRefresh) {

        @Override
        public void run() {
            autoRefreshEnabled = !autoRefreshEnabled;
            setChecked(autoRefreshEnabled);
            refreshController.setInterval(autoRefreshEnabled ? autoRefreshInterval : -1);
        }
    };
    actionAutoRefresh.setChecked(autoRefreshEnabled);
    actionUseLogScale = new Action(Messages.get().DataComparisonView_LogScale) {

        @Override
        public void run() {
            useLogScale = !useLogScale;
            setChecked(useLogScale);
            chart.setLogScaleEnabled(useLogScale);
        }
    };
    actionUseLogScale.setChecked(useLogScale);
    actionShowIn3D = new Action(Messages.get().DataComparisonView_3DView) {

        @Override
        public void run() {
            showIn3D = !showIn3D;
            setChecked(showIn3D);
            chart.set3DModeEnabled(showIn3D);
        }
    };
    actionShowIn3D.setChecked(showIn3D);
    // actionShowIn3D.setImageDescriptor(Activator.getImageDescriptor("icons/view3d.png"));
    actionShowTranslucent = new Action(Messages.get().DataComparisonView_Translucent) {

        @Override
        public void run() {
            translucent = !translucent;
            setChecked(translucent);
            chart.setTranslucent(translucent);
        }
    };
    actionShowTranslucent.setChecked(translucent);
    actionShowLegend = new Action(Messages.get().DataComparisonView_ShowLegend) {

        @Override
        public void run() {
            showLegend = !showLegend;
            setChecked(showLegend);
            chart.setLegendVisible(showLegend);
        }
    };
    actionShowLegend.setChecked(showLegend);
    actionLegendLeft = new Action(Messages.get().DataComparisonView_PlaceOnLeft, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            legendPosition = GraphSettings.POSITION_LEFT;
            chart.setLegendPosition(legendPosition);
        }
    };
    actionLegendLeft.setChecked(legendPosition == GraphSettings.POSITION_LEFT);
    actionLegendRight = new Action(Messages.get().DataComparisonView_PlaceOnRight, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            legendPosition = GraphSettings.POSITION_RIGHT;
            chart.setLegendPosition(legendPosition);
        }
    };
    actionLegendRight.setChecked(legendPosition == GraphSettings.POSITION_RIGHT);
    actionLegendTop = new Action(Messages.get().DataComparisonView_PlaceOnTop, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            legendPosition = GraphSettings.POSITION_TOP;
            chart.setLegendPosition(legendPosition);
        }
    };
    actionLegendTop.setChecked(legendPosition == GraphSettings.POSITION_LEFT);
    actionLegendBottom = new Action(Messages.get().DataComparisonView_PlaceOnBottom, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            legendPosition = GraphSettings.POSITION_BOTTOM;
            chart.setLegendPosition(legendPosition);
        }
    };
    actionLegendBottom.setChecked(legendPosition == GraphSettings.POSITION_LEFT);
    actionShowBarChart = new Action(Messages.get().DataComparisonView_BarChart, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            setChartType(DataComparisonChart.BAR_CHART);
        }
    };
    actionShowBarChart.setChecked(chart.getChartType() == DataComparisonChart.BAR_CHART);
    // $NON-NLS-1$
    actionShowBarChart.setImageDescriptor(Activator.getImageDescriptor("icons/chart_bar.png"));
    actionShowTubeChart = new Action(Messages.get().DataComparisonView_TubeChart, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            setChartType(DataComparisonChart.TUBE_CHART);
        }
    };
    actionShowTubeChart.setChecked(chart.getChartType() == DataComparisonChart.TUBE_CHART);
    // $NON-NLS-1$
    actionShowTubeChart.setImageDescriptor(Activator.getImageDescriptor("icons/chart_tube.png"));
    actionShowPieChart = new Action(Messages.get().DataComparisonView_PieChart, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            setChartType(DataComparisonChart.PIE_CHART);
        }
    };
    actionShowPieChart.setChecked(chart.getChartType() == DataComparisonChart.PIE_CHART);
    // $NON-NLS-1$
    actionShowPieChart.setImageDescriptor(Activator.getImageDescriptor("icons/chart_pie.png"));
    actionHorizontal = new Action(Messages.get().DataComparisonView_ShowHorizontally, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            transposed = true;
            chart.setTransposed(true);
        }
    };
    actionHorizontal.setChecked(transposed);
    actionHorizontal.setEnabled(chart.hasAxes());
    // $NON-NLS-1$
    actionHorizontal.setImageDescriptor(Activator.getImageDescriptor("icons/bar_horizontal.png"));
    actionVertical = new Action(Messages.get().DataComparisonView_ShowVertically, Action.AS_RADIO_BUTTON) {

        @Override
        public void run() {
            transposed = false;
            chart.setTransposed(false);
        }
    };
    actionVertical.setChecked(!transposed);
    actionVertical.setEnabled(chart.hasAxes());
    // $NON-NLS-1$
    actionVertical.setImageDescriptor(Activator.getImageDescriptor("icons/bar_vertical.png"));
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 24 with RefreshAction

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

the class SnmpTrapEditor method createActions.

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

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

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            createTrap();
        }
    };
    actionNew.setText(Messages.get().SnmpTrapEditor_NewMapping);
    // $NON-NLS-1$
    actionNew.setImageDescriptor(Activator.getImageDescriptor("icons/new.png"));
    actionEdit = new Action() {

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            editTrap();
        }
    };
    actionEdit.setText(Messages.get().SnmpTrapEditor_Properties);
    // $NON-NLS-1$
    actionEdit.setImageDescriptor(Activator.getImageDescriptor("icons/edit.png"));
    actionDelete = new Action() {

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            deleteTraps();
        }
    };
    actionDelete.setText(Messages.get().SnmpTrapEditor_Delete);
    // $NON-NLS-1$
    actionDelete.setImageDescriptor(Activator.getImageDescriptor("icons/delete.png"));
}
Also used : Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 25 with RefreshAction

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

the class ScheduledTaskView method createActions.

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

        @Override
        public void run() {
            refresh();
        }
    };
    actionCreate = new Action("New scheduled task...", SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            createTask();
        }
    };
    // $NON-NLS-1$
    actionCreate.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.new_task");
    handlerService.activateHandler(actionCreate.getActionDefinitionId(), new ActionHandler(actionCreate));
    actionEdit = new Action("Edit...", SharedIcons.EDIT) {

        @Override
        public void run() {
            editTask();
        }
    };
    // $NON-NLS-1$
    actionEdit.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.edit_task");
    handlerService.activateHandler(actionEdit.getActionDefinitionId(), new ActionHandler(actionEdit));
    actionDelete = new Action("Delete", SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            deleteTask();
        }
    };
    actionDisable = new Action("Disable") {

        @Override
        public void run() {
            setScheduledTaskEnabled(false);
        }
    };
    // $NON-NLS-1$
    actionDisable.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.disable_task");
    handlerService.activateHandler(actionDisable.getActionDefinitionId(), new ActionHandler(actionDisable));
    actionEnable = new Action("Enable") {

        @Override
        public void run() {
            setScheduledTaskEnabled(true);
        }
    };
    // $NON-NLS-1$
    actionEnable.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.enable_task");
    handlerService.activateHandler(actionEnable.getActionDefinitionId(), new ActionHandler(actionEnable));
    actionReschedule = new Action("Reschedule...", SharedIcons.EXECUTE) {

        @Override
        public void run() {
            rescheduleTask();
        }
    };
    // $NON-NLS-1$
    actionReschedule.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.reschedule_task");
    handlerService.activateHandler(actionReschedule.getActionDefinitionId(), new ActionHandler(actionReschedule));
}
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