use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class AlarmBrowser method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
alarmView.refresh();
}
};
actionExportToCsv = new ExportToCsvAction(this, alarmView.getViewer(), false);
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class ScriptEditorView method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
reloadScript();
}
};
actionSave = new Action(Messages.get().ScriptEditorView_Save, SharedIcons.SAVE) {
@Override
public void run() {
saveScript();
}
};
// $NON-NLS-1$
actionSave.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.save");
handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
actionCompile = new // $NON-NLS-2$
Action(// $NON-NLS-2$
Messages.get().ScriptEditorView_Compile, // $NON-NLS-2$
Activator.getImageDescriptor("icons/compile.gif")) {
@Override
public void run() {
compileScript();
}
};
// $NON-NLS-1$
actionCompile.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.compile");
handlerService.activateHandler(actionCompile.getActionDefinitionId(), new ActionHandler(actionCompile));
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class AbstractNetworkMapView method createActions.
/**
* Create actions
*/
protected void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refreshMap();
}
};
actionShowLinkDirection = new Action("Show link direction", Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setShowLinkDirection(!labelProvider.isShowLinkDirection());
setChecked(labelProvider.isShowLinkDirection());
updateObjectPositions();
saveLayout();
viewer.refresh();
}
};
actionShowLinkDirection.setChecked(labelProvider.isShowLinkDirection());
actionShowStatusBackground = new Action(Messages.get().AbstractNetworkMapView_ShowStatusBkgnd, Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setShowStatusBackground(!labelProvider.isShowStatusBackground());
setChecked(labelProvider.isShowStatusBackground());
updateObjectPositions();
saveLayout();
viewer.refresh();
}
};
actionShowStatusBackground.setChecked(labelProvider.isShowStatusBackground());
actionShowStatusBackground.setEnabled(labelProvider.getObjectFigureType() == MapObjectDisplayMode.ICON);
actionShowStatusIcon = new Action(Messages.get().AbstractNetworkMapView_ShowStatusIcon, Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setShowStatusIcons(!labelProvider.isShowStatusIcons());
setChecked(labelProvider.isShowStatusIcons());
updateObjectPositions();
saveLayout();
viewer.refresh();
}
};
actionShowStatusIcon.setChecked(labelProvider.isShowStatusIcons());
actionShowStatusIcon.setEnabled(labelProvider.getObjectFigureType() == MapObjectDisplayMode.ICON);
actionShowStatusFrame = new Action(Messages.get().AbstractNetworkMapView_ShowStatusFrame, Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setShowStatusFrame(!labelProvider.isShowStatusFrame());
setChecked(labelProvider.isShowStatusFrame());
updateObjectPositions();
saveLayout();
viewer.refresh();
}
};
actionShowStatusFrame.setChecked(labelProvider.isShowStatusFrame());
actionShowStatusFrame.setEnabled(labelProvider.getObjectFigureType() == MapObjectDisplayMode.ICON);
actionZoomIn = new Action(Messages.get().AbstractNetworkMapView_ZoomIn, SharedIcons.ZOOM_IN) {
@Override
public void run() {
viewer.zoomIn();
}
};
// $NON-NLS-1$
actionZoomIn.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.ZoomIn");
// $NON-NLS-1$
actionZoomIn.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.ZoomIn");
handlerService.activateHandler(actionZoomIn.getActionDefinitionId(), new ActionHandler(actionZoomIn));
actionZoomOut = new Action(Messages.get().AbstractNetworkMapView_ZoomOut, SharedIcons.ZOOM_OUT) {
@Override
public void run() {
viewer.zoomOut();
}
};
// $NON-NLS-1$
actionZoomOut.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.ZoomOut");
// $NON-NLS-1$
actionZoomOut.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.ZoomOut");
handlerService.activateHandler(actionZoomOut.getActionDefinitionId(), new ActionHandler(actionZoomOut));
actionZoomFit = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().AbstractNetworkMapView_ZoomFit, // $NON-NLS-1$
Activator.getImageDescriptor("icons/fit.png")) {
@Override
public void run() {
viewer.zoomFit();
}
};
// $NON-NLS-1$
actionZoomFit.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.ZoomToFit");
// $NON-NLS-1$
actionZoomFit.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.ZoomToFit");
handlerService.activateHandler(actionZoomFit.getActionDefinitionId(), new ActionHandler(actionZoomFit));
actionZoomTo = viewer.createZoomActions(handlerService);
actionSetAlgorithm = new Action[layoutAlgorithmNames.length];
for (int i = 0; i < layoutAlgorithmNames.length; i++) {
final MapLayoutAlgorithm alg = MapLayoutAlgorithm.getByValue(i);
actionSetAlgorithm[i] = new Action(layoutAlgorithmNames[i], Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setLayoutAlgorithm(alg, true);
viewer.setInput(mapPage);
}
};
actionSetAlgorithm[i].setChecked(layoutAlgorithm.getValue() == i);
actionSetAlgorithm[i].setEnabled(automaticLayoutEnabled);
}
actionAlwaysFitLayout = new Action(Messages.get().AbstractNetworkMapView_AlwaysFitLayout, Action.AS_CHECK_BOX) {
@Override
public void run() {
alwaysFitLayout = actionAlwaysFitLayout.isChecked();
setLayoutAlgorithm(layoutAlgorithm, true);
IDialogSettings settings = Activator.getDefault().getDialogSettings();
// $NON-NLS-1$
settings.put(viewId + ".alwaysFitLayout", alwaysFitLayout);
}
};
actionAlwaysFitLayout.setChecked(alwaysFitLayout);
actionSetRouter = new Action[connectionRouterNames.length];
for (int i = 0; i < connectionRouterNames.length; i++) {
final int alg = i + 1;
actionSetRouter[i] = new Action(connectionRouterNames[i], Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setConnectionRouter(alg, true);
}
};
actionSetRouter[i].setChecked(routingAlgorithm == alg);
}
actionEnableAutomaticLayout = new Action(Messages.get().AbstractNetworkMapView_EnableAutoLayout, Action.AS_CHECK_BOX) {
@Override
public void run() {
if (automaticLayoutEnabled) {
setManualLayout();
} else {
setAutomaticLayout();
}
setChecked(automaticLayoutEnabled);
}
};
actionEnableAutomaticLayout.setChecked(automaticLayoutEnabled);
actionSaveLayout = new Action(Messages.get().AbstractNetworkMapView_SaveLayout) {
@Override
public void run() {
updateObjectPositions();
saveLayout();
}
};
actionSaveLayout.setImageDescriptor(SharedIcons.SAVE);
actionSaveLayout.setEnabled(!automaticLayoutEnabled);
actionOpenDrillDownObject = new Action("Open drill-down object") {
@Override
public void run() {
openDrillDownObject();
}
};
actionOpenDrillDownObject.setEnabled(false);
actionFiguresIcons = new Action(Messages.get().AbstractNetworkMapView_Icons, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setObjectDisplayMode(MapObjectDisplayMode.ICON, true);
}
};
actionFiguresSmallLabels = new Action(Messages.get().AbstractNetworkMapView_SmallLabels, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setObjectDisplayMode(MapObjectDisplayMode.SMALL_LABEL, true);
}
};
actionFiguresLargeLabels = new Action(Messages.get().AbstractNetworkMapView_LargeLabels, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setObjectDisplayMode(MapObjectDisplayMode.LARGE_LABEL, true);
}
};
actionFiguresStatusIcons = new Action(Messages.get().AbstractNetworkMapView_StatusIcons, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setObjectDisplayMode(MapObjectDisplayMode.STATUS, true);
}
};
actionFiguresFloorPlan = new Action("Floor plan", Action.AS_RADIO_BUTTON) {
@Override
public void run() {
setObjectDisplayMode(MapObjectDisplayMode.FLOOR_PLAN, true);
}
};
actionShowGrid = new Action(Messages.get().AbstractNetworkMapView_ShowGrid, Action.AS_CHECK_BOX) {
@Override
public void run() {
viewer.showGrid(actionShowGrid.isChecked());
}
};
// $NON-NLS-1$
actionShowGrid.setImageDescriptor(Activator.getImageDescriptor("icons/grid.png"));
actionShowGrid.setChecked(viewer.isGridVisible());
// $NON-NLS-1$
actionShowGrid.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.ShowGrid");
// $NON-NLS-1$
actionShowGrid.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.ShowGrid");
handlerService.activateHandler(actionShowGrid.getActionDefinitionId(), new ActionHandler(actionShowGrid));
actionSnapToGrid = new Action(Messages.get().AbstractNetworkMapView_SnapToGrid, Action.AS_CHECK_BOX) {
@Override
public void run() {
viewer.setSnapToGrid(actionSnapToGrid.isChecked());
}
};
// $NON-NLS-1$
actionSnapToGrid.setImageDescriptor(Activator.getImageDescriptor("icons/snap_to_grid.png"));
actionSnapToGrid.setChecked(viewer.isSnapToGrid());
actionAlignToGrid = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().AbstractNetworkMapView_AlignToGrid, // $NON-NLS-1$
Activator.getImageDescriptor("icons/align_to_grid.gif")) {
@Override
public void run() {
viewer.alignToGrid(false);
updateObjectPositions();
}
};
// $NON-NLS-1$
actionAlignToGrid.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.AlignToGrid");
// $NON-NLS-1$
actionAlignToGrid.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.AlignToGrid");
handlerService.activateHandler(actionAlignToGrid.getActionDefinitionId(), new ActionHandler(actionAlignToGrid));
actionShowObjectDetails = new Action(Messages.get().AbstractNetworkMapView_ShowObjDetails) {
@Override
public void run() {
showObjectDetails();
}
};
actionHideLinkLabels = new Action(Messages.get().AbstractNetworkMapView_HideLinkLabels, Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setConnectionLabelsVisible(!actionHideLinkLabels.isChecked());
viewer.refresh(true);
}
};
// $NON-NLS-1$
actionHideLinkLabels.setImageDescriptor(Activator.getImageDescriptor("icons/hide_link.png"));
actionHideLinks = new Action(Messages.get().AbstractNetworkMapView_HideLinks, Action.AS_CHECK_BOX) {
@Override
public void run() {
labelProvider.setConnectionsVisible(!actionHideLinks.isChecked());
viewer.refresh(true);
}
};
// $NON-NLS-1$
actionHideLinks.setImageDescriptor(Activator.getImageDescriptor("icons/hide_net_link.png"));
actionSelectAllObjects = new Action(Messages.get().AbstractNetworkMapView_SelectAllObjects) {
@Override
public void run() {
viewer.setSelection(new StructuredSelection(mapPage.getObjectElements()));
}
};
// $NON-NLS-1$
actionSelectAllObjects.setId("org.netxms.ui.eclipse.networkmaps.localActions.AbstractMap.SelectAllObjects");
// $NON-NLS-1$
actionSelectAllObjects.setActionDefinitionId("org.netxms.ui.eclipse.networkmaps.localCommands.AbstractMap.SelectAllObjects");
handlerService.activateHandler(actionSelectAllObjects.getActionDefinitionId(), new ActionHandler(actionSelectAllObjects));
actionLockLink = new Action("Locked") {
@Override
public void run() {
changeLinkLock();
}
};
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class ObjectBrowser method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
objectTree.refresh();
}
};
actionMoveObject = new Action(Messages.get().ObjectBrowser_MoveObject) {
@Override
public void run() {
moveObject(SubtreeType.INFRASTRUCTURE);
}
};
// $NON-NLS-1$
actionMoveObject.setId("org.netxms.ui.eclipse.objectbrowser.actions.moveObject");
actionMoveTemplate = new Action(Messages.get().ObjectBrowser_MoveTemplate) {
@Override
public void run() {
moveObject(SubtreeType.TEMPLATES);
}
};
// $NON-NLS-1$
actionMoveTemplate.setId("org.netxms.ui.eclipse.objectbrowser.actions.moveTemplate");
actionMoveBusinessService = new Action(Messages.get().ObjectBrowser_MoveService) {
@Override
public void run() {
moveObject(SubtreeType.BUSINESS_SERVICES);
}
};
// $NON-NLS-1$
actionMoveBusinessService.setId("org.netxms.ui.eclipse.objectbrowser.actions.moveBusinessService");
actionMoveDashboard = new Action(Messages.get().ObjectBrowser_MoveDashboard) {
@Override
public void run() {
moveObject(SubtreeType.DASHBOARDS);
}
};
// $NON-NLS-1$
actionMoveDashboard.setId("org.netxms.ui.eclipse.objectbrowser.actions.moveDashboard");
actionMoveMap = new Action(Messages.get().ObjectBrowser_MoveMap) {
@Override
public void run() {
moveObject(SubtreeType.MAPS);
}
};
// $NON-NLS-1$
actionMoveMap.setId("org.netxms.ui.eclipse.objectbrowser.actions.moveMap");
actionMovePolicy = new Action(Messages.get().ObjectBrowser_MovePolicy) {
@Override
public void run() {
moveObject(SubtreeType.POLICIES);
}
};
// $NON-NLS-1$
actionMovePolicy.setId("org.netxms.ui.eclipse.objectbrowser.actions.movePolicy");
actionHideUnmanaged = new Action(Messages.get().ObjectBrowser_HideUnmanaged, Action.AS_CHECK_BOX) {
@Override
public void run() {
objectTree.setHideUnmanaged(actionHideUnmanaged.isChecked());
}
};
// $NON-NLS-1$
actionHideUnmanaged.setId("org.netxms.ui.eclipse.objectbrowser.actions.hideUnmanaged");
actionHideUnmanaged.setChecked(objectTree.isHideUnmanaged());
actionHideTemplateChecks = new Action(Messages.get().ObjectBrowser_HideCheckTemplates, Action.AS_CHECK_BOX) {
@Override
public void run() {
objectTree.setHideTemplateChecks(actionHideTemplateChecks.isChecked());
}
};
// $NON-NLS-1$
actionHideTemplateChecks.setId("org.netxms.ui.eclipse.objectbrowser.actions.hideTemplateChecks");
actionHideTemplateChecks.setChecked(objectTree.isHideTemplateChecks());
actionHideSubInterfaces = new Action(Messages.get().ObjectBrowser_HideSubInterfaces, Action.AS_CHECK_BOX) {
@Override
public void run() {
objectTree.setHideSubInterfaces(actionHideSubInterfaces.isChecked());
}
};
// $NON-NLS-1$
actionHideSubInterfaces.setId("org.netxms.ui.eclipse.objectbrowser.actions.hideSubInterfaces");
actionHideSubInterfaces.setChecked(objectTree.isHideSubInterfaces());
actionShowFilter = new Action(Messages.get().ObjectBrowser_ShowFilter, Action.AS_CHECK_BOX) {
@Override
public void run() {
objectTree.enableFilter(actionShowFilter.isChecked());
}
};
// $NON-NLS-1$
actionShowFilter.setId("org.netxms.ui.eclipse.objectbrowser.actions.showFilter");
actionShowFilter.setChecked(objectTree.isFilterEnabled());
// $NON-NLS-1$
actionShowFilter.setActionDefinitionId("org.netxms.ui.eclipse.objectbrowser.commands.show_object_filter");
final ActionHandler showFilterHandler = new ActionHandler(actionShowFilter);
handlerService.activateHandler(actionShowFilter.getActionDefinitionId(), showFilterHandler);
actionShowStatusIndicator = new Action(Messages.get().ObjectBrowser_ShowStatusIndicator, Action.AS_CHECK_BOX) {
@Override
public void run() {
objectTree.enableStatusIndicator(actionShowStatusIndicator.isChecked());
}
};
// $NON-NLS-1$
actionShowStatusIndicator.setId("org.netxms.ui.eclipse.objectbrowser.actions.showStatusIndicator");
actionShowStatusIndicator.setChecked(objectTree.isStatusIndicatorEnabled());
// $NON-NLS-1$
actionShowStatusIndicator.setActionDefinitionId("org.netxms.ui.eclipse.objectbrowser.commands.show_status_indicator");
final ActionHandler showStatusIndicatorHandler = new ActionHandler(actionShowStatusIndicator);
handlerService.activateHandler(actionShowStatusIndicator.getActionDefinitionId(), showStatusIndicatorHandler);
actionRenameObject = new Action(Messages.get().ObjectBrowser_Rename) {
@Override
public void run() {
TreeItem[] selection = objectTree.getTreeControl().getSelection();
if (selection.length != 1)
return;
objectTree.getTreeViewer().editElement(selection[0].getData(), 0);
}
};
// $NON-NLS-1$
actionRenameObject.setId("org.netxms.ui.eclipse.objectbrowser.actions.rename");
// $NON-NLS-1$
actionRenameObject.setActionDefinitionId("org.netxms.ui.eclipse.objectbrowser.commands.rename_object");
final ActionHandler renameObjectHandler = new ActionHandler(actionRenameObject);
handlerService.activateHandler(actionRenameObject.getActionDefinitionId(), renameObjectHandler);
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class MappingTables method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refresh(0);
}
};
actionNewTable = new Action(Messages.get().MappingTables_NewTable, SharedIcons.ADD_OBJECT) {
@Override
public void run() {
createNewTable();
}
};
actionEditTable = new Action(Messages.get().MappingTables_Edit, SharedIcons.EDIT) {
@Override
public void run() {
editTable();
}
};
actionEditTable.setEnabled(false);
actionDeleteTables = new Action(Messages.get().MappingTables_Delete, SharedIcons.DELETE_OBJECT) {
@Override
public void run() {
deleteTables();
}
};
actionDeleteTables.setEnabled(false);
}
Aggregations