use of org.eclipse.jface.commands.ActionHandler 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));
}
use of org.eclipse.jface.commands.ActionHandler 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);
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ExtendedGraphViewer method createZoomActions.
/**
* Create zoom actions
* @return
*/
public Action[] createZoomActions(IHandlerService handlerService) {
final ZoomManager zoomManager = getZoomManager();
final Action[] actions = new Action[zoomLevels.length];
for (int i = 0; i < zoomLevels.length; i++) {
actions[i] = new ZoomAction(zoomLevels[i], zoomManager);
if (zoomLevels[i] == 1.00) {
actions[i].setChecked(true);
// $NON-NLS-1$
actions[i].setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.Zoom100Pct");
// $NON-NLS-1$
actions[i].setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.Zoom100Pct");
handlerService.activateHandler(actions[i].getActionDefinitionId(), new ActionHandler(actions[i]));
}
}
return actions;
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ScriptExecutor method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionSave = new Action(Messages.get().ScriptExecutor_Save, SharedIcons.SAVE) {
@Override
public void run() {
intermediateSave(false);
}
};
// $NON-NLS-1$
actionSave.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.save");
handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
actionSaveAs = new Action(Messages.get().ScriptExecutor_SaveAs, SharedIcons.SAVE_AS) {
@Override
public void run() {
createNewScript(false);
}
};
// $NON-NLS-1$
actionSaveAs.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.save_as");
handlerService.activateHandler(actionSaveAs.getActionDefinitionId(), new ActionHandler(actionSaveAs));
actionClear = new Action(Messages.get().ScriptExecutor_Clear, SharedIcons.CLEAR) {
@Override
public void run() {
if (modified) {
if (saveIfRequired(false))
return;
}
scriptCombo.deselectAll();
scriptCombo.clearSelection();
// $NON-NLS-1$
scriptEditor.setText("");
output.clear();
form.setText(Messages.get().ScriptExecutor_Noname);
}
};
actionClearOutput = new Action(Messages.get().ScriptExecutor_ClearOutput, SharedIcons.CLEAR_LOG) {
@Override
public void run() {
output.clear();
}
};
// $NON-NLS-1$
actionClearOutput.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.clear_output");
handlerService.activateHandler(actionClearOutput.getActionDefinitionId(), new ActionHandler(actionClearOutput));
actionReload = new RefreshAction(this) {
@Override
public void run() {
if (modified) {
if (saveIfRequired(false))
return;
}
updateScriptList(null);
getScriptContent();
output.clear();
}
};
actionReload.setText(Messages.get().ScriptExecutor_Reload);
actionExecute = new Action(Messages.get().ScriptExecutor_Execute, SharedIcons.EXECUTE) {
@Override
public void run() {
executeScript();
}
};
// $NON-NLS-1$
actionExecute.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.execute_script");
handlerService.activateHandler(actionExecute.getActionDefinitionId(), new ActionHandler(actionExecute));
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ObjectFinder method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionStartSearch = new Action("&Search", Activator.getImageDescriptor("icons/find.gif")) {
@Override
public void run() {
startSearch();
}
};
// $NON-NLS-1$
actionStartSearch.setId("org.netxms.ui.eclipse.objectbrowser.actions.startSearch");
// $NON-NLS-1$
actionStartSearch.setActionDefinitionId("org.netxms.ui.eclipse.objectbrowser.commands.start_search");
final ActionHandler showFilterHandler = new ActionHandler(actionStartSearch);
handlerService.activateHandler(actionStartSearch.getActionDefinitionId(), showFilterHandler);
actionShowObjectDetails = new Action("Show object details") {
@Override
public void run() {
showObjectDetails();
}
};
}
Aggregations