Search in sources :

Example 6 with GuiOsxKeyboardShortcut

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);
                }
            }
        }
    }
}
Also used : ActionMeta(org.apache.hop.workflow.action.ActionMeta) IAction(org.apache.hop.workflow.action.IAction) HopExtensionPoint(org.apache.hop.core.extension.HopExtensionPoint) GuiOsxKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut) GuiKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut)

Example 7 with GuiOsxKeyboardShortcut

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;
}
Also used : IHopFileType(org.apache.hop.ui.hopgui.file.IHopFileType) ErrorDialog(org.apache.hop.ui.core.dialog.ErrorDialog) HopException(org.apache.hop.core.exception.HopException) GuiOsxKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut) GuiToolbarElement(org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElement) GuiKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut)

Example 8 with GuiOsxKeyboardShortcut

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));
}
Also used : KeyboardShortcut(org.apache.hop.core.gui.plugin.key.KeyboardShortcut) GuiKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut) GuiOsxKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut)

Example 9 with GuiOsxKeyboardShortcut

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);
}
Also used : IHopPerspective(org.apache.hop.ui.hopgui.perspective.IHopPerspective) GuiOsxKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut) GuiKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut)

Example 10 with GuiOsxKeyboardShortcut

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);
}
Also used : IHopPerspective(org.apache.hop.ui.hopgui.perspective.IHopPerspective) GuiOsxKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut) GuiKeyboardShortcut(org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut)

Aggregations

GuiKeyboardShortcut (org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut)11 GuiOsxKeyboardShortcut (org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut)11 HopException (org.apache.hop.core.exception.HopException)5 GuiToolbarElement (org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElement)5 ErrorDialog (org.apache.hop.ui.core.dialog.ErrorDialog)3 FileObject (org.apache.commons.vfs2.FileObject)2 FileSystemException (org.apache.commons.vfs2.FileSystemException)2 HopExtensionPoint (org.apache.hop.core.extension.HopExtensionPoint)2 GuiMenuElement (org.apache.hop.core.gui.plugin.menu.GuiMenuElement)2 IHopFileType (org.apache.hop.ui.hopgui.file.IHopFileType)2 IHopPerspective (org.apache.hop.ui.hopgui.perspective.IHopPerspective)2 Field (java.lang.reflect.Field)1 Method (java.lang.reflect.Method)1 GuiContextAction (org.apache.hop.core.action.GuiContextAction)1 GuiContextActionFilter (org.apache.hop.core.action.GuiContextActionFilter)1 HopPluginException (org.apache.hop.core.exception.HopPluginException)1 GuiRegistry (org.apache.hop.core.gui.plugin.GuiRegistry)1 GuiWidgetElement (org.apache.hop.core.gui.plugin.GuiWidgetElement)1 GuiCallback (org.apache.hop.core.gui.plugin.callback.GuiCallback)1 KeyboardShortcut (org.apache.hop.core.gui.plugin.key.KeyboardShortcut)1