use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class ScriptLibrary method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction() {
@Override
public void run() {
refreshScriptList();
}
};
actionNew = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_New, // $NON-NLS-1$
Activator.getImageDescriptor("icons/new.png")) {
@Override
public void run() {
createNewScript();
}
};
actionEdit = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_Edit, // $NON-NLS-1$
Activator.getImageDescriptor("icons/edit.png")) {
@Override
public void run() {
editScript();
}
};
actionEdit.setEnabled(false);
actionRename = new Action(Messages.get().ScriptLibrary_Rename) {
@Override
public void run() {
renameScript();
}
};
actionRename.setEnabled(false);
actionDelete = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_Delete, // $NON-NLS-1$
Activator.getImageDescriptor("icons/delete.png")) {
@Override
public void run() {
deleteScript();
}
};
actionDelete.setEnabled(false);
actionCopyName = new Action("Copy name", SharedIcons.COPY) {
@Override
public void run() {
copyNameToClipboard();
}
};
actionCopyName.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.CopyNameToClipboard");
handlerService.activateHandler(actionCopyName.getActionDefinitionId(), new ActionHandler(actionCopyName));
}
use of org.eclipse.ui.handlers.IHandlerService 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();
}
};
}
use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class WorldMap method createActions.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.osm.views.AbstractGeolocationView#createActions()
*/
@Override
protected void createActions() {
super.createActions();
actionPlaceObject = new Action(Messages.get().WorldMap_PlaceObject) {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
placeObject();
}
};
actionShowFilter = new Action("Show filter", Action.AS_CHECK_BOX) {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
enableFilter(actionShowFilter.isChecked());
}
};
actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
actionShowFilter.setChecked(filterEnabled);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.worldmap.commands.show_filter");
final ActionHandler showFilterHandler = new ActionHandler(actionShowFilter);
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), showFilterHandler);
}
use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class PredefinedGraphTree method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
reloadGraphList();
}
};
actionDelete = new Action(Messages.get().PredefinedGraphTree_Delete, SharedIcons.DELETE_OBJECT) {
@Override
public void run() {
deletePredefinedGraph();
}
};
actionOpen = new Action() {
@SuppressWarnings("rawtypes")
@Override
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
Iterator it = selection.iterator();
while (it.hasNext()) {
Object o = it.next();
if (o instanceof GraphSettings) {
showPredefinedGraph((GraphSettings) o);
}
}
}
};
actionOpen.setText(Messages.get().PredefinedGraphTree_Open);
actionProperties = new Action(Messages.get().PredefinedGraphTree_Properties) {
@Override
public void run() {
editPredefinedGraph();
}
};
actionShowFilter = new Action(Messages.get().PredefinedGraphTree_ShowFilter, Action.AS_CHECK_BOX) {
@Override
public void run() {
enableFilter(!initShowFilter);
actionShowFilter.setChecked(initShowFilter);
}
};
// $NON-NLS-1$
actionShowFilter.setId("org.netxms.ui.eclipse.perfview.actions.showFilter");
actionShowFilter.setChecked(initShowFilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.perfview.commands.show_graph_filter");
final ActionHandler showFilterHandler = new ActionHandler(actionShowFilter);
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), showFilterHandler);
}
use of org.eclipse.ui.handlers.IHandlerService 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));
}
Aggregations