use of org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut in project hop by apache.
the class HopGuiWorkflowGraph method openReferencedObject.
@GuiKeyboardShortcut(key = 'z')
@GuiOsxKeyboardShortcut(key = 'z')
public void openReferencedObject() {
if (lastMove != null) {
// Hide the tooltip!
hideToolTips();
// Find the transform
ActionMeta action = workflowMeta.getAction(lastMove.x, lastMove.y, iconSize);
if (action != null) {
// Open referenced object...
//
IAction iAction = action.getAction();
String[] objectDescriptions = iAction.getReferencedObjectDescriptions();
if (objectDescriptions == null || objectDescriptions.length == 0) {
return;
}
//
if (objectDescriptions.length == 1) {
HopGuiWorkflowActionContext.openReferencedObject(workflowMeta, variables, iAction, objectDescriptions[0], 0);
} else {
// Show Selection dialog...
//
EnterSelectionDialog dialog = new EnterSelectionDialog(getShell(), objectDescriptions, BaseMessages.getString(PKG, "HopGuiWorkflowGraph.OpenReferencedObject.Selection.Title"), BaseMessages.getString(PKG, "HopGuiWorkflowGraph.OpenReferencedObject.Selection.Message"));
String answer = dialog.open(0);
if (answer != null) {
int index = dialog.getSelectionNr();
HopGuiWorkflowActionContext.openReferencedObject(workflowMeta, variables, iAction, answer, index);
}
}
}
}
}
use of org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut in project hop by apache.
the class ExplorerPerspective method refresh.
@GuiToolbarElement(root = GUI_PLUGIN_TOOLBAR_PARENT_ID, id = TOOLBAR_ITEM_REFRESH, toolTip = "i18n::ExplorerPerspective.ToolbarElement.Refresh.Tooltip", image = "ui/images/refresh.svg")
@GuiKeyboardShortcut(key = SWT.F5)
@GuiOsxKeyboardShortcut(key = SWT.F5)
public void refresh() {
try {
determineRootFolderName(hopGui);
for (IExplorerRefreshListener listener : refreshListeners) {
listener.beforeRefresh();
}
tree.setRedraw(false);
tree.removeAll();
// Add the root element...
//
TreeItem rootItem = new TreeItem(tree, SWT.NONE);
rootItem.setText(Const.NVL(rootName, ""));
IHopFileType fileType = getFileType(rootFolder);
setItemImage(rootItem, fileType);
callPaintListeners(tree, rootItem, rootFolder, rootName, fileType);
setTreeItemData(rootItem, rootFolder, rootName, fileType, 0, true, true);
// Paint the top level folder only
//
refreshFolder(rootItem, rootFolder, 0);
tree.setRedraw(true);
TreeMemory.setExpandedFromMemory(tree, FILE_EXPLORER_TREE);
} catch (Exception e) {
new ErrorDialog(getShell(), BaseMessages.getString(PKG, "ExplorerPerspective.Error.TreeRefresh.Header"), BaseMessages.getString(PKG, "ExplorerPerspective.Error.TreeRefresh.Message"), e);
}
updateSelection();
treeIsFresh = true;
}
use of org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut in project hop by apache.
the class GuiRegistry method addKeyboardShortcut.
public void addKeyboardShortcut(String parentClassName, Method parentMethod, GuiOsxKeyboardShortcut shortcut) {
List<KeyboardShortcut> shortcuts = shortCutsMap.computeIfAbsent(parentClassName, k -> new ArrayList<>());
shortcuts.add(new KeyboardShortcut(shortcut, parentMethod));
}
use of org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut in project hop by apache.
the class HopGui method nextPerspective.
@GuiKeyboardShortcut(control = true, shift = true, key = SWT.ARROW_DOWN)
@GuiOsxKeyboardShortcut(command = true, shift = true, key = SWT.ARROW_DOWN)
public void nextPerspective() {
IHopPerspective perspective = getActivePerspective();
getPerspectiveManager().showNextPerspective(perspective);
}
use of org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut in project hop by apache.
the class HopGui method previousPerspective.
@GuiKeyboardShortcut(control = true, shift = true, key = SWT.ARROW_UP)
@GuiOsxKeyboardShortcut(command = true, shift = true, key = SWT.ARROW_UP)
public void previousPerspective() {
IHopPerspective perspective = getActivePerspective();
getPerspectiveManager().showPreviousPerspective(perspective);
}
Aggregations