use of org.eclipse.jface.commands.ActionHandler 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.jface.commands.ActionHandler 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.jface.commands.ActionHandler 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));
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ExportFileBuilder method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionSave = new Action(Messages.get().ExportFileBuilder_Save, SharedIcons.SAVE) {
@Override
public void run() {
save();
}
};
// $NON-NLS-1$
actionSave.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.save_exported_config");
handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
actionPublish = new Action("&Publish...", Activator.getImageDescriptor("icons/publish.gif")) {
@Override
public void run() {
publish();
}
};
// $NON-NLS-1$
actionPublish.setActionDefinitionId("org.netxms.ui.eclipse.serverconfig.commands.publish_config");
handlerService.activateHandler(actionPublish.getActionDefinitionId(), new ActionHandler(actionPublish));
}
use of org.eclipse.jface.commands.ActionHandler in project tdi-studio-se by Talend.
the class BindingActions method registerActions.
/**
* DOC smallet Comment method "registerActions".
*/
private void registerActions() {
IContextService contextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
//$NON-NLS-1$
contextService.activateContext("talend.global");
IWorkbench workbench = PlatformUI.getWorkbench();
IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
IHandler handler;
for (IAction action : actions) {
handler = new ActionHandler(action);
handlerService.activateHandler(action.getActionDefinitionId(), handler);
}
}
Aggregations