Search in sources :

Example 11 with RefreshAction

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

the class ActionManager method createActions.

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

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

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            createAction();
        }
    };
    actionNew.setText(Messages.get().ActionManager_ActionNew);
    actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
    actionEdit = new Action() {

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            editAction();
        }
    };
    actionEdit.setText(Messages.get().ActionManager_ActionProperties);
    actionEdit.setImageDescriptor(SharedIcons.EDIT);
    actionDelete = new Action() {

        /* (non-Javadoc)
			 * @see org.eclipse.jface.action.Action#run()
			 */
        @Override
        public void run() {
            deleteActions();
        }
    };
    actionDelete.setText(Messages.get().ActionManager_ActionDelete);
    actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
}
Also used : ServerAction(org.netxms.client.ServerAction) Action(org.eclipse.jface.action.Action) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction) RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 12 with RefreshAction

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

the class LineChartElement method createActions.

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

        @Override
        public void run() {
            refreshData();
        }
    };
    actionAdjustX = HistoricalGraphView.createAction(ActionType.ADJUST_X, chart);
    actionAdjustY = HistoricalGraphView.createAction(ActionType.ADJUST_Y, chart);
    actionAdjustBoth = HistoricalGraphView.createAction(ActionType.ADJUST_BOTH, chart);
    presetActions = HistoricalGraphView.createPresetActions(new HistoricalGraphView.PresetHandler() {

        @Override
        public void onPresetSelected(int units, int range) {
            config.setTimeUnits(units);
            config.setTimeRange(range);
            refreshData();
        }
    });
}
Also used : RefreshAction(org.netxms.ui.eclipse.actions.RefreshAction)

Example 13 with RefreshAction

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

the class AgentFileManager method createActions.

/**
 * Create actions
 */
private void createActions() {
    final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
    actionRefreshDirectory = new Action(Messages.get().AgentFileManager_RefreshFolder, SharedIcons.REFRESH) {

        @Override
        public void run() {
            refreshFileOrDirectory();
        }
    };
    // $NON-NLS-1$
    actionRefreshDirectory.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.refreshFolder");
    handlerService.activateHandler(actionRefreshDirectory.getActionDefinitionId(), new ActionHandler(actionRefreshDirectory));
    actionRefreshAll = new RefreshAction(this) {

        @Override
        public void run() {
            refreshFileList();
        }
    };
    actionUploadFile = new Action(Messages.get().AgentFileManager_UploadFile) {

        @Override
        public void run() {
            uploadFile(false);
        }
    };
    // $NON-NLS-1$
    actionUploadFile.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.uploadFile");
    handlerService.activateHandler(actionUploadFile.getActionDefinitionId(), new ActionHandler(actionUploadFile));
    actionDelete = new Action(Messages.get().AgentFileManager_Delete, SharedIcons.DELETE_OBJECT) {

        @Override
        public void run() {
            deleteFile();
        }
    };
    // $NON-NLS-1$
    actionDelete.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.delete");
    handlerService.activateHandler(actionDelete.getActionDefinitionId(), new ActionHandler(actionDelete));
    actionRename = new Action(Messages.get().AgentFileManager_Rename) {

        @Override
        public void run() {
            renameFile();
        }
    };
    // $NON-NLS-1$
    actionRename.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.rename");
    handlerService.activateHandler(actionRename.getActionDefinitionId(), new ActionHandler(actionRename));
    actionShowFilter = new Action(Messages.get().ViewServerFile_ShowFilterAction, 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.filemanager.commands.showFilter");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
    actionDownloadFile = new Action(Messages.get().AgentFileManager_Download) {

        @Override
        public void run() {
            startDownload();
        }
    };
    // $NON-NLS-1$
    actionDownloadFile.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.download");
    handlerService.activateHandler(actionDownloadFile.getActionDefinitionId(), new ActionHandler(actionDownloadFile));
    actionTailFile = new Action(Messages.get().AgentFileManager_FollowChanges) {

        @Override
        public void run() {
            tailFile(true, 1024);
        }
    };
    actionShowFile = new Action(Messages.get().AgentFileManager_Show) {

        @Override
        public void run() {
            tailFile(false, 0);
        }
    };
    actionCreateDirectory = new Action(Messages.get().AgentFileManager_CreateFolder) {

        @Override
        public void run() {
            createFolder();
        }
    };
    // $NON-NLS-1$
    actionCreateDirectory.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.newFolder");
    handlerService.activateHandler(actionCreateDirectory.getActionDefinitionId(), new ActionHandler(actionCreateDirectory));
    actionCalculateFolderSize = new Action("Calculate folder &size") {

        @Override
        public void run() {
            calculateFolderSize();
        }
    };
    // $NON-NLS-1$
    actionCalculateFolderSize.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.calculateFolderSize");
    handlerService.activateHandler(actionCalculateFolderSize.getActionDefinitionId(), new ActionHandler(actionCalculateFolderSize));
    actionCopyFileName = new Action("Copy file &name") {

        @Override
        public void run() {
            copyFileName();
        }
    };
    // $NON-NLS-1$
    actionCopyFileName.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.copyFileName");
    handlerService.activateHandler(actionCopyFileName.getActionDefinitionId(), new ActionHandler(actionCopyFileName));
    actionCopyFilePath = new Action("Copy file &path") {

        @Override
        public void run() {
            copyFilePath();
        }
    };
    // $NON-NLS-1$
    actionCopyFilePath.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.copyFilePath");
    handlerService.activateHandler(actionCopyFilePath.getActionDefinitionId(), new ActionHandler(actionCopyFilePath));
}
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 14 with RefreshAction

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

the class ServerFileManager method createActions.

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

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

        @Override
        public void run() {
            createFile();
        }
    };
    actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
    actionDelete = new Action(Messages.get().ViewServerFile_DeleteFileOnServerAction) {

        @Override
        public void run() {
            deleteFile();
        }
    };
    actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
    actionShowFilter = new Action(Messages.get().ViewServerFile_ShowFilterAction, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            enableFilter(!initShowFilter);
            actionShowFilter.setChecked(initShowFilter);
        }
    };
    actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
    actionShowFilter.setChecked(initShowFilter);
    // $NON-NLS-1$
    actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.filemanager.commands.showFilter");
    handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
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 15 with RefreshAction

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

the class LogViewer method createActions.

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

        @Override
        public void run() {
            refreshData();
        }
    };
    actionRefresh.setEnabled(false);
    actionExecute = new Action(Messages.get().LogViewer_ActionExec, SharedIcons.EXECUTE) {

        @Override
        public void run() {
            doQuery();
        }
    };
    // $NON-NLS-1$
    actionExecute.setActionDefinitionId("org.netxms.ui.eclipse.logviewer.commands.execute");
    handlerService.activateHandler(actionExecute.getActionDefinitionId(), new ActionHandler(actionExecute));
    actionClearFilter = new Action(Messages.get().LogViewer_ActionClearFilter, SharedIcons.CLEAR_LOG) {

        @Override
        public void run() {
            filterBuilder.clearFilter();
        }
    };
    actionGetMoreData = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.get().LogViewer_ActionGetMoreData, // $NON-NLS-1$
    Activator.getImageDescriptor("icons/get_more_data.png")) {

        @Override
        public void run() {
            getMoreData();
        }
    };
    actionGetMoreData.setEnabled(false);
    // $NON-NLS-1$
    actionGetMoreData.setActionDefinitionId("org.netxms.ui.eclipse.logviewer.commands.get_more_data");
    handlerService.activateHandler(actionGetMoreData.getActionDefinitionId(), new ActionHandler(actionGetMoreData));
    actionShowFilter = new Action(Messages.get().LogViewer_ActionShowFilter, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            showFilter(actionShowFilter.isChecked());
        }
    };
    actionShowFilter.setChecked(true);
    // $NON-NLS-1$
    actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.logviewer.commands.show_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)

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