use of org.eclipse.jface.commands.ActionHandler 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);
}
use of org.eclipse.jface.commands.ActionHandler 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);
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class AbstractTraceView method createActions.
/**
* Create actions
*/
protected void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionClear = new Action(Messages.get().AbstractTraceView_Clear, SharedIcons.CLEAR_LOG) {
@Override
public void run() {
traceWidget.clear();
}
};
actionShowFilter = new Action("Show &filter", Action.AS_CHECK_BOX) {
@Override
public void run() {
traceWidget.enableFilter(!traceWidget.isFilterEnabled());
actionShowFilter.setChecked(traceWidget.isFilterEnabled());
}
};
actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
actionShowFilter.setChecked(initShowFilter);
actionShowFilter.setId("org.netxms.ui.eclipse.library.actions.showSnmpFilter");
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.library.commands.show_filter");
final ActionHandler showFilterHandler = new ActionHandler(actionShowFilter);
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), showFilterHandler);
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ScriptingConsole method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionClear = new Action("C&lear console", SharedIcons.CLEAR_LOG) {
@Override
public void run() {
console.clearConsole();
}
};
actionScrollLock = new Action("&Scroll lock", Action.AS_CHECK_BOX) {
@Override
public void run() {
}
};
// $NON-NLS-1$
actionScrollLock.setImageDescriptor(Activator.getImageDescriptor("icons/scroll_lock.gif"));
actionScrollLock.setChecked(false);
actionTerminate = new Action("&Terminate", SharedIcons.TERMINATE) {
@Override
public void run() {
synchronized (mutex) {
if (running) {
}
}
}
};
actionTerminate.setEnabled(false);
actionTerminate.setActionDefinitionId("org.netxms.ui.eclipse.scripting.commands.terminate_process");
handlerService.activateHandler(actionTerminate.getActionDefinitionId(), new ActionHandler(actionTerminate));
actionCopy = new Action("&Copy") {
@Override
public void run() {
if (viewer.canDoOperation(TextConsoleViewer.COPY))
viewer.doOperation(TextConsoleViewer.COPY);
}
};
actionCopy.setEnabled(false);
actionCopy.setActionDefinitionId("org.netxms.ui.eclipse.scripting.commands.copy");
handlerService.activateHandler(actionCopy.getActionDefinitionId(), new ActionHandler(actionCopy));
actionSelectAll = new Action("Select &all") {
@Override
public void run() {
if (viewer.canDoOperation(TextConsoleViewer.SELECT_ALL))
viewer.doOperation(TextConsoleViewer.SELECT_ALL);
}
};
actionSelectAll.setActionDefinitionId("org.netxms.ui.eclipse.scripting.commands.select_all");
handlerService.activateHandler(actionSelectAll.getActionDefinitionId(), new ActionHandler(actionSelectAll));
}
use of org.eclipse.jface.commands.ActionHandler 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));
}
Aggregations