use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class ImageLibrary method createActions.
/**
* Create actions
*/
private void createActions() {
actionNew = new Action(Messages.get().ImageLibrary_ActionUpload) {
@Override
public void run() {
final ImagePropertiesDialog dialog = new ImagePropertiesDialog(getSite().getShell(), knownCategories, imageLibrary, false);
final GalleryItem[] selection = gallery.getSelection();
if (selection.length > 0) {
LibraryImage image = (LibraryImage) selection[0].getData();
dialog.setDefaultCategory(image.getCategory());
}
if (dialog.open() == Dialog.OK) {
uploadNewImage(dialog.getName(), dialog.getCategory(), dialog.getFileName());
}
}
};
actionNew.setImageDescriptor(SharedIcons.ADD_OBJECT);
actionEdit = new Action(Messages.get().ImageLibrary_ActionEdit) {
@Override
public void run() {
final GalleryItem[] selection = gallery.getSelection();
if (selection.length == 1) {
final ImagePropertiesDialog dialog = new ImagePropertiesDialog(getSite().getShell(), knownCategories, imageLibrary, true);
LibraryImage image = (LibraryImage) selection[0].getData();
dialog.setName(image.getName());
dialog.setDefaultCategory(image.getCategory());
if (dialog.open() == Dialog.OK) {
editImage(selection[0], dialog.getName(), dialog.getCategory(), dialog.getFileName());
}
}
}
};
actionEdit.setImageDescriptor(SharedIcons.EDIT);
actionDelete = new Action(Messages.get().ImageLibrary_ActionDelete) {
@Override
public void run() {
deleteImage();
}
};
actionDelete.setImageDescriptor(SharedIcons.DELETE_OBJECT);
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
try {
refreshImages();
} catch (Exception e) {
// $NON-NLS-1$
Activator.logError("ImageLibrary view: Exception in refresh action", e);
}
}
};
actionZoomIn = new Action(Messages.get().ImageLibrary_ActionZoomIn) {
@Override
public void run() {
final DefaultGalleryGroupRenderer groupRenderer = (DefaultGalleryGroupRenderer) gallery.getGroupRenderer();
if (currentIconSize < MAX_GRID_ICON_SIZE) {
currentIconSize += 16;
groupRenderer.setItemHeight(currentIconSize);
groupRenderer.setItemWidth(currentIconSize);
}
}
};
actionZoomIn.setImageDescriptor(SharedIcons.ZOOM_IN);
actionZoomOut = new Action(Messages.get().ImageLibrary_ActionZoomOut) {
@Override
public void run() {
final DefaultGalleryGroupRenderer groupRenderer = (DefaultGalleryGroupRenderer) gallery.getGroupRenderer();
if (currentIconSize > MIN_GRID_ICON_SIZE) {
currentIconSize -= 16;
groupRenderer.setItemHeight(currentIconSize);
groupRenderer.setItemWidth(currentIconSize);
}
}
};
actionZoomOut.setImageDescriptor(SharedIcons.ZOOM_OUT);
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class ScriptExecutor method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionSave = new Action(Messages.get().ScriptExecutor_Save, SharedIcons.SAVE) {
@Override
public void run() {
intermediateSave(false);
}
};
// $NON-NLS-1$
actionSave.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.save");
handlerService.activateHandler(actionSave.getActionDefinitionId(), new ActionHandler(actionSave));
actionSaveAs = new Action(Messages.get().ScriptExecutor_SaveAs, SharedIcons.SAVE_AS) {
@Override
public void run() {
createNewScript(false);
}
};
// $NON-NLS-1$
actionSaveAs.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.save_as");
handlerService.activateHandler(actionSaveAs.getActionDefinitionId(), new ActionHandler(actionSaveAs));
actionClear = new Action(Messages.get().ScriptExecutor_Clear, SharedIcons.CLEAR) {
@Override
public void run() {
if (modified) {
if (saveIfRequired(false))
return;
}
scriptCombo.deselectAll();
scriptCombo.clearSelection();
// $NON-NLS-1$
scriptEditor.setText("");
output.clear();
form.setText(Messages.get().ScriptExecutor_Noname);
}
};
actionClearOutput = new Action(Messages.get().ScriptExecutor_ClearOutput, SharedIcons.CLEAR_LOG) {
@Override
public void run() {
output.clear();
}
};
// $NON-NLS-1$
actionClearOutput.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.clear_output");
handlerService.activateHandler(actionClearOutput.getActionDefinitionId(), new ActionHandler(actionClearOutput));
actionReload = new RefreshAction(this) {
@Override
public void run() {
if (modified) {
if (saveIfRequired(false))
return;
}
updateScriptList(null);
getScriptContent();
output.clear();
}
};
actionReload.setText(Messages.get().ScriptExecutor_Reload);
actionExecute = new Action(Messages.get().ScriptExecutor_Execute, SharedIcons.EXECUTE) {
@Override
public void run() {
executeScript();
}
};
// $NON-NLS-1$
actionExecute.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.execute_script");
handlerService.activateHandler(actionExecute.getActionDefinitionId(), new ActionHandler(actionExecute));
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class ScriptLibrary method createActions.
/**
* Create actions
*/
private void createActions() {
final IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
actionRefresh = new RefreshAction() {
@Override
public void run() {
refreshScriptList();
}
};
actionNew = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_New, // $NON-NLS-1$
Activator.getImageDescriptor("icons/new.png")) {
@Override
public void run() {
createNewScript();
}
};
actionEdit = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_Edit, // $NON-NLS-1$
Activator.getImageDescriptor("icons/edit.png")) {
@Override
public void run() {
editScript();
}
};
actionEdit.setEnabled(false);
actionRename = new Action(Messages.get().ScriptLibrary_Rename) {
@Override
public void run() {
renameScript();
}
};
actionRename.setEnabled(false);
actionDelete = new // $NON-NLS-1$
Action(// $NON-NLS-1$
Messages.get().ScriptLibrary_Delete, // $NON-NLS-1$
Activator.getImageDescriptor("icons/delete.png")) {
@Override
public void run() {
deleteScript();
}
};
actionDelete.setEnabled(false);
actionCopyName = new Action("Copy name", SharedIcons.COPY) {
@Override
public void run() {
copyNameToClipboard();
}
};
actionCopyName.setActionDefinitionId("org.netxms.ui.eclipse.nxsl.commands.CopyNameToClipboard");
handlerService.activateHandler(actionCopyName.getActionDefinitionId(), new ActionHandler(actionCopyName));
}
use of org.netxms.ui.eclipse.actions.RefreshAction in project netxms by netxms.
the class HistoricalDataView method createActions.
/**
* Create actions
*/
private void createActions() {
actionRefresh = new RefreshAction(this) {
@Override
public void run() {
refreshData();
}
};
actionSelectRange = new Action(Messages.get().HistoricalDataView_SelectDataRange) {
@Override
public void run() {
selectRange();
}
};
actionDeleteDciEntry = new Action("Delete entry") {
@Override
public void run() {
deleteDciEntry();
}
};
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 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);
}
Aggregations