use of org.eclipse.ui.handlers.IHandlerService in project netxms by netxms.
the class EventProcessingPolicyEditor method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionHorizontal = new Action(Messages.get().EventProcessingPolicyEditor_LayoutH, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
verticalLayout = false;
updateLayout();
}
};
actionHorizontal.setChecked(!verticalLayout);
// $NON-NLS-1$
actionHorizontal.setImageDescriptor(Activator.getImageDescriptor("icons/h_layout.gif"));
actionVertical = new Action(Messages.get().EventProcessingPolicyEditor_LayoutV, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
verticalLayout = true;
updateLayout();
}
};
actionVertical.setChecked(verticalLayout);
// $NON-NLS-1$
actionVertical.setImageDescriptor(Activator.getImageDescriptor("icons/v_layout.gif"));
actionSave = new Action(Messages.get().EventProcessingPolicyEditor_Save) {
@Override
public void run() {
savePolicy();
}
};
actionSave.setImageDescriptor(SharedIcons.SAVE);
actionSave.setEnabled(false);
actionCollapseAll = new Action(Messages.get().EventProcessingPolicyEditor_CollapseAll) {
@Override
public void run() {
setAllRulesCollapsed(true);
}
};
actionCollapseAll.setImageDescriptor(SharedIcons.COLLAPSE_ALL);
actionExpandAll = new Action(Messages.get().EventProcessingPolicyEditor_ExpandAll) {
@Override
public void run() {
setAllRulesCollapsed(false);
}
};
actionExpandAll.setImageDescriptor(SharedIcons.EXPAND_ALL);
actionDelete = new Action(Messages.get().EventProcessingPolicyEditor_Delete) {
@Override
public void run() {
deleteSelectedRules();
}
};
actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
actionDelete.setEnabled(false);
actionInsertBefore = new Action(Messages.get().EventProcessingPolicyEditor_InsertBefore) {
@Override
public void run() {
insertRule(lastSelectedRule - 1);
}
};
actionInsertAfter = new Action(Messages.get().EventProcessingPolicyEditor_InsertAfter) {
@Override
public void run() {
insertRule(lastSelectedRule);
}
};
actionCut = new Action(Messages.get().EventProcessingPolicyEditor_Cut) {
@Override
public void run() {
cutRules();
}
};
actionCut.setImageDescriptor(SharedIcons.CUT);
actionCut.setEnabled(false);
actionCopy = new Action(Messages.get().EventProcessingPolicyEditor_Copy) {
@Override
public void run() {
copyRules();
}
};
actionCopy.setImageDescriptor(SharedIcons.COPY);
actionCopy.setEnabled(false);
actionPaste = new Action(Messages.get().EventProcessingPolicyEditor_Paste) {
@Override
public void run() {
pasteRules();
}
};
actionPaste.setImageDescriptor(SharedIcons.PASTE);
actionPaste.setEnabled(false);
actionEnableRule = new Action(Messages.get().EventProcessingPolicyEditor_Enable) {
@Override
public void run() {
enableRules(true);
}
};
actionDisableRule = new Action(Messages.get().EventProcessingPolicyEditor_Disable) {
@Override
public void run() {
enableRules(false);
}
};
actionShowFilter = new Action(Messages.get().EventProcessingPolicyEditor_ShowFilter, Action.AS_CHECK_BOX) {
@Override
public void run() {
enableFilter(actionShowFilter.isChecked());
}
};
actionAddRule = new Action("&Add new rule") {
@Override
public void run() {
insertRule(ruleEditors.size());
}
};
actionAddRule.setImageDescriptor(SharedIcons.ADD_OBJECT);
actionShowFilter.setChecked(filterEnabled);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.epp.commands.show_rule_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 LastValues method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction() {
@Override
public void run() {
dataView.refresh();
}
};
actionAutoUpdate = new Action(Messages.get().LastValues_AutoRefresh, Action.AS_CHECK_BOX) {
@Override
public void run() {
dataView.setAutoRefreshEnabled(actionAutoUpdate.isChecked());
}
};
actionAutoUpdate.setChecked(dataView.isAutoRefreshEnabled());
actionShowFilter = new Action(Messages.get().LastValues_ShowFilter, Action.AS_CHECK_BOX) {
@Override
public void run() {
dataView.enableFilter(!dataView.isFilterEnabled());
actionShowFilter.setChecked(dataView.isFilterEnabled());
}
};
actionShowFilter.setImageDescriptor(SharedIcons.FILTER);
actionShowFilter.setChecked(initShowFilter);
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.datacollection.commands.show_dci_filter");
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), new ActionHandler(actionShowFilter));
}
use of org.eclipse.ui.handlers.IHandlerService 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.ui.handlers.IHandlerService 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.ui.handlers.IHandlerService 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);
}
Aggregations