use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class BrowserView method createActions.
/**
* Create actions
*/
private void createActions() {
actionBack = new Action(Messages.get().BrowserView_Back, SharedIcons.NAV_BACKWARD) {
@Override
public void run() {
browser.back();
}
};
actionForward = new Action(Messages.get().BrowserView_Forward, SharedIcons.NAV_FORWARD) {
@Override
public void run() {
browser.forward();
}
};
actionStop = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().BrowserView_Stop, // $NON-NLS-1$
Activator.getImageDescriptor("icons/stop.png")) {
@Override
public void run() {
browser.stop();
}
};
actionReload = new RefreshAction(this) {
@Override
public void run() {
browser.refresh();
}
};
}
use of org.netxms.ui.eclipse.actions.RefreshAction 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.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class TableToolResults method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refreshTable();
}
};
actionExportToCsv = new ExportToCsvAction(this, viewer, true);
actionExportAllToCsv = new ExportToCsvAction(this, viewer, false);
}
use of org.netxms.ui.eclipse.actions.RefreshAction 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();
}
};
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class HistoricalGraphView method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
updateChart();
}
};
actionProperties = new Action(Messages.get().HistoricalGraphView_Properties) {
@Override
public void run() {
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, settings);
if (dlg != null) {
dlg.open();
configureGraphFromSettings();
refreshMenuSelection();
}
}
};
actionAutoRefresh = new Action(Messages.get().HistoricalGraphView_Autorefresh) {
@Override
public void run() {
settings.setAutoRefresh(!settings.isAutoRefresh());
setChecked(settings.isAutoRefresh());
refreshController.setInterval(settings.isAutoRefresh() ? settings.getRefreshRate() : -1);
}
};
actionAutoRefresh.setChecked(settings.isAutoRefresh());
actionLogScale = new Action(Messages.get().HistoricalGraphView_LogScale) {
@Override
public void run() {
try {
chart.setLogScaleEnabled(!settings.isLogScale());
settings.setLogScale(!settings.isLogScale());
} catch (IllegalStateException e) {
MessageDialogHelper.openError(getSite().getShell(), Messages.get().HistoricalGraphView_Error, String.format(Messages.get().HistoricalGraphView_LogScaleSwitchError, e.getLocalizedMessage()));
// $NON-NLS-1$
Activator.logError("Cannot change log scale mode", e);
}
setChecked(settings.isLogScale());
}
};
actionLogScale.setChecked(settings.isLogScale());
actionZoomIn = new Action(Messages.get().HistoricalGraphView_ZoomIn) {
@Override
public void run() {
chart.zoomIn();
}
};
actionZoomIn.setImageDescriptor(SharedIcons.ZOOM_IN);
actionZoomOut = new Action(Messages.get().HistoricalGraphView_ZoomOut) {
@Override
public void run() {
chart.zoomOut();
}
};
actionZoomOut.setImageDescriptor(SharedIcons.ZOOM_OUT);
actionAdjustX = createAction(ActionType.ADJUST_X, chart);
actionAdjustY = createAction(ActionType.ADJUST_Y, chart);
actionAdjustBoth = createAction(ActionType.ADJUST_BOTH, chart);
actionShowLegend = new Action(Messages.get().HistoricalGraphView_ShowLegend) {
@Override
public void run() {
settings.setShowLegend(actionShowLegend.isChecked());
chart.setLegendVisible(settings.isShowLegend());
}
};
actionShowLegend.setChecked(settings.isShowLegend());
actionExtendedLegend = new Action(Messages.get().HistoricalGraphView_ExtendedLegend) {
@Override
public void run() {
settings.setExtendedLegend(actionExtendedLegend.isChecked());
chart.setExtendedLegend(settings.isExtendedLegend());
}
};
actionExtendedLegend.setChecked(settings.isExtendedLegend());
actionLegendLeft = new Action(Messages.get().HistoricalGraphView_PlaceOnLeft, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
settings.setLegendPosition(GraphSettings.POSITION_LEFT);
chart.setLegendPosition(settings.getLegendPosition());
}
};
actionLegendLeft.setChecked(settings.getLegendPosition() == GraphSettings.POSITION_LEFT);
actionLegendRight = new Action(Messages.get().HistoricalGraphView_PlaceOnRight, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
settings.setLegendPosition(GraphSettings.POSITION_RIGHT);
chart.setLegendPosition(settings.getLegendPosition());
}
};
actionLegendRight.setChecked(settings.getLegendPosition() == GraphSettings.POSITION_RIGHT);
actionLegendTop = new Action(Messages.get().HistoricalGraphView_PlaceOnTop, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
settings.setLegendPosition(GraphSettings.POSITION_TOP);
chart.setLegendPosition(settings.getLegendPosition());
}
};
actionLegendTop.setChecked(settings.getLegendPosition() == GraphSettings.POSITION_TOP);
actionLegendBottom = new Action(Messages.get().HistoricalGraphView_PlaceOnBottom, Action.AS_RADIO_BUTTON) {
@Override
public void run() {
settings.setLegendPosition(GraphSettings.POSITION_BOTTOM);
chart.setLegendPosition(settings.getLegendPosition());
}
};
actionLegendBottom.setChecked(settings.getLegendPosition() == GraphSettings.POSITION_BOTTOM);
actionSave = new Action(Messages.get().HistoricalGraphView_Save, SharedIcons.SAVE) {
@Override
public void run() {
String initalName = settings.getName().compareTo("noname") == 0 ? settings.getTitle() : settings.getName();
saveGraph(initalName, null, false, false);
}
};
// TODO: add check that graph uses only one node as source
actionSaveAsTemplate = new Action("Save as template", SharedIcons.SAVE_AS) {
@Override
public void run() {
String initalName = settings.getName().compareTo("noname") == 0 ? settings.getTitle() : settings.getName();
saveGraph(initalName, null, false, true);
}
};
actionStacked = new Action(Messages.get().HistoricalGraphView_Stacked, Action.AS_CHECK_BOX) {
@Override
public void run() {
settings.setStacked(actionStacked.isChecked());
configureGraphFromSettings();
}
};
actionStacked.setChecked(settings.isStacked());
actionTranslucent = new Action(Messages.get().HistoricalGraphView_Translucent, Action.AS_CHECK_BOX) {
@Override
public void run() {
settings.setTranslucent(actionTranslucent.isChecked());
configureGraphFromSettings();
}
};
actionTranslucent.setChecked(settings.isTranslucent());
actionAreaChart = new Action("Area chart", Action.AS_CHECK_BOX) {
@Override
public void run() {
settings.setArea(actionAreaChart.isChecked());
configureGraphFromSettings();
}
};
actionAreaChart.setChecked(settings.isArea());
presetActions = createPresetActions(new PresetHandler() {
@Override
public void onPresetSelected(int units, int range) {
settings.setTimeUnits(units);
settings.setTimeRange(range);
updateChart();
}
});
actionSaveAsImage = new Action("Save as image", SharedIcons.SAVE_AS_IMAGE) {
@Override
public void run() {
chart.saveAsImage();
}
};
}
Aggregations