Search in sources :

Example 6 with RefreshAction

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

the class SummaryTableManager method createActions.

/**
 */
private void createActions() {
    final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    // create show filter action
    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.datacollection.commands.show_dci_filter");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
    // create refresh action
    actionRefresh = new RefreshAction(this) {

        @Override
        public void run() {
            refresh();
        }
    };
    // create add action for single value table
    actionCreateSingleValue = new Action("Create new summary table...", SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            createSummaryTable(false);
        }
    };
    actionCreateTableValue = new Action("Create new summary table for table DCIs...", Activator.getImageDescriptor("icons/new.png")) {

        @Override
        public void run() {
            createSummaryTable(true);
        }
    };
    // create edit action
    actionEdit = new Action(Messages.get().SummaryTableManager_ActionEdit, SharedIcons.EDIT) {

        @Override
        public void run() {
            editSummaryTable();
        }
    };
    actionEdit.setEnabled(false);
    // create delete action
    actionDelete = new Action(Messages.get().SummaryTableManager_ActionDelete, SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            deleteSelection();
        }
    };
    actionDelete.setEnabled(false);
}
Also used : 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) ActionHandler(org.eclipse.jface.commands.ActionHandler)

Example 7 with RefreshAction

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

the class DataCollectionEditor method createActions.

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

        @Override
        public void run() {
            viewer.setInput(dciConfig.getItems());
        }
    };
    actionCreateItem = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().DataCollectionEditor_NewParam, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/new.png")) {

        @Override
        public void run() {
            createItem();
        }
    };
    actionCreateTable = new Action(Messages.get().DataCollectionEditor_NewTable) {

        @Override
        public void run() {
            createTable();
        }
    };
    actionEdit = new Action(Messages.get().DataCollectionEditor_ActionEdit, SharedIcons.EDIT) {

        @Override
        public void run() {
            editSelectedObject();
        }
    };
    actionEdit.setText(Messages.get().DataCollectionEditor_Edit);
    // $NON-NLS-1$
    actionEdit.setImageDescriptor(Activator.getImageDescriptor("icons/edit.png"));
    actionEdit.setEnabled(false);
    actionDelete = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().DataCollectionEditor_Delete, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/delete.png")) {

        @Override
        public void run() {
            deleteItems();
        }
    };
    actionDelete.setEnabled(false);
    actionCopy = new Action(Messages.get().DataCollectionEditor_Copy) {

        @Override
        public void run() {
            copyItems(false);
        }
    };
    actionCopy.setEnabled(false);
    actionMove = new Action(Messages.get().DataCollectionEditor_Move) {

        @Override
        public void run() {
            copyItems(true);
        }
    };
    actionMove.setEnabled(false);
    actionConvert = new Action(Messages.get().DataCollectionEditor_Convert) {

        @Override
        public void run() {
            convertToTemplate();
        }
    };
    actionConvert.setEnabled(false);
    actionDuplicate = new Action(Messages.get().DataCollectionEditor_Duplicate) {

        @Override
        public void run() {
            duplicateItems();
        }
    };
    actionDuplicate.setEnabled(false);
    actionActivate = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().DataCollectionEditor_Activate, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/active.gif")) {

        @Override
        public void run() {
            setItemStatus(DataCollectionObject.ACTIVE);
            actionActivate.setEnabled(false);
            actionDisable.setEnabled(true);
        }
    };
    actionActivate.setEnabled(false);
    actionDisable = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().DataCollectionEditor_Disable, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/disabled.gif")) {

        @Override
        public void run() {
            setItemStatus(DataCollectionObject.DISABLED);
            actionActivate.setEnabled(true);
            actionDisable.setEnabled(false);
        }
    };
    actionDisable.setEnabled(false);
    actionShowFilter = new Action(Messages.get().DataCollectionEditor_ShowFilter, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            enableFilter(actionShowFilter.isChecked());
        }
    };
    actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
    actionShowFilter.setChecked(getBooleanFromSettings("DataCollectionEditor.showFilter", true));
    // $NON-NLS-1$
    actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.datacollection.commands.show_dci_filter");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
    actionExportToCsv = new ExportToCsvAction(this, viewer, true);
    actionExportAllToCsv = new ExportToCsvAction(this, viewer, false);
}
Also used : 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) ActionHandler(org.eclipse.jface.commands.ActionHandler) ExportToCsvAction(org.netxms.ui.eclipse.actions.ExportToCsvAction)

Example 8 with RefreshAction

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

the class SummaryTable method createActions.

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

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

Example 9 with RefreshAction

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

the class PackageManager method createActions.

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

        @Override
        public void run() {
            refresh();
        }
    };
    actionInstall = new Action(Messages.get().PackageManager_InstallAction, SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            installPackage();
        }
    };
    actionRemove = new Action(Messages.get().PackageManager_RemoveAction, SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            removePackage();
        }
    };
    actionDeploy = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().PackageManager_DeployAction, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/package_deploy.gif")) {

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

Example 10 with RefreshAction

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

the class ServerStoredAgentConfigEditorView method createActions.

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

        @Override
        public void run() {
            getConfigList();
        }
    };
    actionSave = new Action(Messages.get().AgentConfigEditorView_Save, SharedIcons.SAVE) {

        @Override
        public void run() {
            intermediateSave();
            actionSave.setEnabled(false);
            modified = false;
        }
    };
    actionCreate = new Action(Messages.get().ServerStoredAgentConfigEditorView_JobTitle_CreateNew, SharedIcons.ADD_OBJECT) {

        @Override
        public void run() {
            createNewConfig();
        }
    };
    actionDelete = new Action(Messages.get().ServerStoredAgentConfigEditorView_Delete, SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            deleteConfig();
        }
    };
    actionMoveUp = new Action(Messages.get().ServerStoredAgentConfigEditorView_MoveUp, SharedIcons.UP) {

        @Override
        public void run() {
            moveUp();
        }
    };
    actionMoveDown = new Action(Messages.get().ServerStoredAgentConfigEditorView_MoveDown, SharedIcons.DOWN) {

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