use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class AlarmCategoryConfigurator method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction() {
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
dataView.refreshView();
}
};
actionShowFilter = new Action() {
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
enableFilter(actionShowFilter.isChecked());
}
};
actionShowFilter.setText("Show filter");
actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
actionShowFilter.setChecked(initShowfilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_category");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ScreenshotView method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refresh();
}
};
actionSave = new Action(Messages.get().ScreenshotView_Save, SharedIcons.SAVE) {
@Override
public void run() {
saveImage();
}
};
// $NON-NLS-1$
actionSave.setActionDefinitionId("org.netxms.ui.eclipse.agentmanager.commands.save_screenshot");
handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
actionSave.setEnabled(false);
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class AbstractCommandResults method createActions.
/**
* Create actions
*/
protected void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionClear = new Action(Messages.get().LocalCommandResults_ClearConsole, SharedIcons.CLEAR_LOG) {
@Override
public void run() {
console.clear();
}
};
// $NON-NLS-1$
actionClear.setActionDefinitionId("org.netxms.ui.eclipse.objecttools.commands.clear_output");
handlerService.activateHandler(actionClear.getActionDefinitionId(), new ActionHandler(actionClear));
actionScrollLock = new Action(Messages.get().LocalCommandResults_ScrollLock, Action.AS_CHECK_BOX) {
@Override
public void run() {
console.setAutoScroll(!actionScrollLock.isChecked());
}
};
// $NON-NLS-1$
actionScrollLock.setImageDescriptor(Activator.getImageDescriptor("icons/scroll_lock.gif"));
actionScrollLock.setChecked(false);
// $NON-NLS-1$
actionScrollLock.setActionDefinitionId("org.netxms.ui.eclipse.objecttools.commands.scroll_lock");
handlerService.activateHandler(actionScrollLock.getActionDefinitionId(), new ActionHandler(actionScrollLock));
actionCopy = new Action(Messages.get().LocalCommandResults_Copy) {
@Override
public void run() {
console.copy();
}
};
actionCopy.setEnabled(false);
// $NON-NLS-1$
actionCopy.setActionDefinitionId("org.netxms.ui.eclipse.objecttools.commands.copy");
handlerService.activateHandler(actionCopy.getActionDefinitionId(), new ActionHandler(actionCopy));
actionSelectAll = new Action(Messages.get().LocalCommandResults_SelectAll) {
@Override
public void run() {
console.selectAll();
}
};
// $NON-NLS-1$
actionSelectAll.setActionDefinitionId("org.netxms.ui.eclipse.objecttools.commands.select_all");
handlerService.activateHandler(actionSelectAll.getActionDefinitionId(), new ActionHandler(actionSelectAll));
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class NodePollerView method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRestart = new Action(Messages.get().NodePollerView_ActionRestart, SharedIcons.RESTART) {
@Override
public void run() {
startPoll();
}
};
// $NON-NLS-1$
actionRestart.setActionDefinitionId("org.netxms.ui.eclipse.objectmanager.commands.restart_poller");
handlerService.activateHandler(actionRestart.getActionDefinitionId(), new ActionHandler(actionRestart));
actionClearOutput = new Action(Messages.get().NodePollerView_ActionClear, SharedIcons.CLEAR_LOG) {
@Override
public void run() {
// $NON-NLS-1$
textArea.setText("");
}
};
// $NON-NLS-1$
actionClearOutput.setActionDefinitionId("org.netxms.ui.eclipse.objectmanager.commands.clear_output");
handlerService.activateHandler(actionClearOutput.getActionDefinitionId(), new ActionHandler(actionClearOutput));
}
use of org.eclipse.jface.commands.ActionHandler in project netxms by netxms.
the class ObjectToolsEditor method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
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.objecttools.commands.showFilter");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
actionRefresh = new RefreshAction() {
@Override
public void run() {
refreshToolList();
}
};
actionNew = new Action(Messages.get().ObjectToolsEditor_New) {
@Override
public void run() {
createTool();
}
};
actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
actionEdit = new PropertyDialogAction(getSite(), viewer) {
@Override
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.size() != 1)
return;
final long toolId = ((ObjectTool) selection.getFirstElement()).getId();
// If there will be error, adapter factory will show error message to user
if (Platform.getAdapterManager().getAdapter(selection.getFirstElement(), ObjectToolDetails.class) == null)
return;
super.run();
ObjectToolDetails details = ObjectToolsAdapterFactory.getDetailsFromCache(toolId);
if ((details != null) && details.isModified()) {
saveObjectTool(details);
}
}
};
actionEdit.setImageDescriptor(SharedIcons.EDIT);
actionDelete = new Action(Messages.get().ObjectToolsEditor_Delete) {
@Override
public void run() {
deleteTools();
}
};
actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
actionDisable = new Action(Messages.get().ObjectToolsEditor_Disable) {
@Override
public void run() {
setSelectedDisabled();
}
};
actionEnable = new Action(Messages.get().ObjectToolsEditor_Enable) {
@Override
public void run() {
setSelectedEnabled();
}
};
actionClone = new Action(Messages.get().ObjectToolsEditor_Clone) {
@Override
public void run() {
cloneTool();
}
};
}
Aggregations