You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2022/01/31 08:52:12 UTC
[hop] branch master updated: HOP-3714 - Automatically display the shortcut in the GuiToolbarItem and Perspective toolitem tooltip - Add F5 shortcut to refresh meta perspective - Replace CCombo with Combo in PluginPerspective
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/master by this push:
new 4e84dfa HOP-3714 - Automatically display the shortcut in the GuiToolbarItem and Perspective toolitem tooltip - Add F5 shortcut to refresh meta perspective - Replace CCombo with Combo in PluginPerspective
new 7d85aa2 Merge pull request #1306 from nadment/HOP-3714
4e84dfa is described below
commit 4e84dfa884b273ce05572a5c6081059da0f5de5b
Author: Nicolas Adment <na...@gmail.com>
AuthorDate: Sat Jan 29 23:41:45 2022 +0100
HOP-3714
- Automatically display the shortcut in the GuiToolbarItem and
Perspective toolitem tooltip
- Add F5 shortcut to refresh meta perspective
- Replace CCombo with Combo in PluginPerspective
---
.../hop/core/gui/plugin/key/KeyboardShortcut.java | 4 +++-
.../org/apache/hop/ui/core/gui/GuiToolbarWidgets.java | 19 ++++++++++++++++++-
ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java | 13 ++++++++++++-
.../ui/hopgui/file/workflow/HopGuiWorkflowGraph.java | 2 +-
.../perspective/dataorch/HopGuiAbstractGraph.java | 10 +++-------
.../perspective/explorer/ExplorerPerspective.java | 3 ++-
.../perspective/metadata/MetadataPerspective.java | 2 ++
.../pluginexplorer/HopPluginExplorePerspective.java | 4 ++--
.../file/workflow/messages/messages_en_US.properties | 2 +-
.../hop/ui/hopgui/messages/messages_en_US.properties | 2 +-
.../dataorch/messages/messages_en_US.properties | 2 +-
.../dataorch/messages/messages_it_IT.properties | 2 +-
.../explorer/messages/messages_en_US.properties | 6 +++---
.../explorer/messages/messages_it_IT.properties | 2 +-
.../metadata/messages/messages_en_US.properties | 2 +-
.../metadata/messages/messages_it_IT.properties | 2 +-
16 files changed, 53 insertions(+), 24 deletions(-)
diff --git a/core/src/main/java/org/apache/hop/core/gui/plugin/key/KeyboardShortcut.java b/core/src/main/java/org/apache/hop/core/gui/plugin/key/KeyboardShortcut.java
index 0e9c4b0..b8dd5ce 100644
--- a/core/src/main/java/org/apache/hop/core/gui/plugin/key/KeyboardShortcut.java
+++ b/core/src/main/java/org/apache/hop/core/gui/plugin/key/KeyboardShortcut.java
@@ -86,9 +86,10 @@ public class KeyboardShortcut {
str.append("Delete");
}
// Digit
- else if (keyCode >= 48 && keyCode <= 57) {
+ else if ( (keyCode >= 48 && keyCode <= 57) || "+-/*".indexOf(keyCode)>=0) {
str.append(((char) keyCode));
}
+
if ((keyCode & (1 << 24)) != 0) {
switch (keyCode & (0xFFFF)) {
case 1:
@@ -180,6 +181,7 @@ public class KeyboardShortcut {
break;
}
}
+
return str.toString();
}
diff --git a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiToolbarWidgets.java b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiToolbarWidgets.java
index a2da881..6661cd9 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/gui/GuiToolbarWidgets.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/gui/GuiToolbarWidgets.java
@@ -20,13 +20,13 @@ package org.apache.hop.ui.core.gui;
import org.apache.commons.lang.StringUtils;
import org.apache.hop.core.Const;
import org.apache.hop.core.gui.plugin.GuiRegistry;
+import org.apache.hop.core.gui.plugin.key.KeyboardShortcut;
import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElementType;
import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarItem;
import org.apache.hop.ui.core.ConstUi;
import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.hopgui.TextSizeUtilFacade;
import org.apache.hop.ui.hopgui.file.IHopFileType;
-import org.apache.hop.ui.util.EnvironmentUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Image;
@@ -167,6 +167,7 @@ public class GuiToolbarWidgets extends BaseGuiWidgets {
toolbarItem.getListenerMethod());
item.addListener(SWT.Selection, listener);
toolItemMap.put(toolbarItem.getId(), item);
+ setToolItemKeyboardShortcut(item, toolbarItem);
break;
case COMBO:
@@ -218,6 +219,22 @@ public class GuiToolbarWidgets extends BaseGuiWidgets {
}
}
+/**
+ * See if there's a shortcut worth mentioning and add it to tooltip...
+ *
+ * @param toolItem
+ * @param guiToolbarItem
+ */
+ private void setToolItemKeyboardShortcut(ToolItem toolItem, GuiToolbarItem guiToolbarItem) {
+ KeyboardShortcut shortcut =
+ GuiRegistry.getInstance()
+ .findKeyboardShortcut(
+ guiToolbarItem.getListenerClass(), guiToolbarItem.getListenerMethod(), Const.isOSX());
+ if (shortcut != null) {
+ toolItem.setToolTipText(toolItem.getToolTipText()+" ("+shortcut.toString()+')');
+ }
+ }
+
private void setImages(
ToolItem item, ClassLoader classLoader, String location, String disabledLocation) {
GuiResource gr = GuiResource.getInstance();
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
index 27a54be..3a18d83 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/HopGui.java
@@ -31,11 +31,13 @@ import org.apache.hop.core.extension.ExtensionPointHandler;
import org.apache.hop.core.extension.HopExtensionPoint;
import org.apache.hop.core.gui.IUndo;
import org.apache.hop.core.gui.plugin.GuiPlugin;
+import org.apache.hop.core.gui.plugin.GuiRegistry;
import org.apache.hop.core.gui.plugin.key.GuiKeyboardShortcut;
import org.apache.hop.core.gui.plugin.key.GuiOsxKeyboardShortcut;
import org.apache.hop.core.gui.plugin.key.KeyboardShortcut;
import org.apache.hop.core.gui.plugin.menu.GuiMenuElement;
import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElement;
+import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarItem;
import org.apache.hop.core.logging.*;
import org.apache.hop.core.parameters.INamedParameterDefinitions;
import org.apache.hop.core.plugins.Plugin;
@@ -437,6 +439,15 @@ public class HopGui
if (image != null) {
item.setImage(image);
}
+
+ // See if there's a shortcut for the perspective, add it to tooltip...
+ KeyboardShortcut shortcut =
+ GuiRegistry.getInstance()
+ .findKeyboardShortcut(
+ perspectiveClass.getName(), "activate", Const.isOSX());
+ if (shortcut != null) {
+ item.setToolTipText(item.getToolTipText()+" ("+shortcut.toString()+')');
+ }
if (first) {
first = false;
@@ -447,7 +458,7 @@ public class HopGui
new ErrorDialog(shell, "Error", "Error loading perspectives", e);
}
}
-
+
private static Display setupDisplay() {
// Bootstrap Hop
//
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
index 76c1f59..4c3f435 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopGuiWorkflowGraph.java
@@ -1415,7 +1415,7 @@ public class HopGuiWorkflowGraph extends HopGuiAbstractGraph
@GuiToolbarElement(
root = GUI_PLUGIN_TOOLBAR_PARENT_ID,
id = TOOLBAR_ITEM_ZOOM_100PCT,
- toolTip = "HopGuiWorkflowGraph.GuiAction.Zoom100.Tooltip",
+ toolTip = "i18n::HopGuiWorkflowGraph.GuiAction.Zoom100.Tooltip",
type = GuiToolbarElementType.BUTTON,
image = "ui/images/zoom-100.svg")
public void zoom100Percent() {
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/dataorch/HopGuiAbstractGraph.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/dataorch/HopGuiAbstractGraph.java
index 48bf852..45a6852 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/dataorch/HopGuiAbstractGraph.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/dataorch/HopGuiAbstractGraph.java
@@ -189,16 +189,12 @@ public abstract class HopGuiAbstractGraph extends Composite {
public abstract void setZoomLabel();
- @GuiKeyboardShortcut(control = true, key = '+')
- public void zoomInShortcut1() {
- zoomIn();
- }
-
@GuiKeyboardShortcut(control = true, key = '=')
- public void zoomInShortcut2() {
+ public void zoomInShortcut() {
zoomIn();
}
+ @GuiKeyboardShortcut(control = true, key = '+')
public void zoomIn() {
magnification += 0.1f;
// Minimum 1000%
@@ -210,7 +206,7 @@ public abstract class HopGuiAbstractGraph extends Composite {
redraw();
}
- @GuiKeyboardShortcut(control = true, key = '-')
+ @GuiKeyboardShortcut(control = true, key = '-')
public void zoomOut() {
magnification -= 0.1f;
// Minimum 10%
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/explorer/ExplorerPerspective.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/explorer/ExplorerPerspective.java
index d9cd12b..6b5c43c 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/explorer/ExplorerPerspective.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/explorer/ExplorerPerspective.java
@@ -883,6 +883,8 @@ public class ExplorerPerspective implements IHopPerspective {
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);
@@ -1055,7 +1057,6 @@ public class ExplorerPerspective implements IHopPerspective {
public void updateSelection() {
- String objectKey;
TreeItemFolder tif = null;
if (tree.getSelectionCount() > 0) {
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/metadata/MetadataPerspective.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/metadata/MetadataPerspective.java
index 9e0f4d3..a8bd411 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/metadata/MetadataPerspective.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/metadata/MetadataPerspective.java
@@ -718,6 +718,8 @@ public class MetadataPerspective implements IHopPerspective {
id = TOOLBAR_ITEM_REFRESH,
toolTip = "i18n::MetadataPerspective.ToolbarElement.Refresh.Tooltip",
image = "ui/images/refresh.svg")
+ @GuiKeyboardShortcut(key = SWT.F5)
+ @GuiOsxKeyboardShortcut(key = SWT.F5)
public void refresh() {
try {
tree.setRedraw(false);
diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/pluginexplorer/HopPluginExplorePerspective.java b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/pluginexplorer/HopPluginExplorePerspective.java
index efa98c3..5c4a6fc 100644
--- a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/pluginexplorer/HopPluginExplorePerspective.java
+++ b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/pluginexplorer/HopPluginExplorePerspective.java
@@ -65,7 +65,7 @@ public class HopPluginExplorePerspective implements IHopPerspective {
private HopGui hopGui;
private Composite composite;
- private CCombo wPluginType;
+ private Combo wPluginType;
private TableView wPluginView;
private Map<String, List<Object[]>> dataMap;
@@ -132,7 +132,7 @@ public class HopPluginExplorePerspective implements IHopPerspective {
fdlFields.top = new FormAttachment(0, props.getMargin());
label.setLayoutData(fdlFields);
- wPluginType = new CCombo(composite, SWT.LEFT | SWT.READ_ONLY | SWT.BORDER);
+ wPluginType = new Combo(composite, SWT.LEFT | SWT.READ_ONLY | SWT.BORDER);
wPluginType.setItems(pluginsType);
wPluginType.setText(selectedPluginType);
props.setLook(wPluginType);
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
index 12cee6b..4e1ec48 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/file/workflow/messages/messages_en_US.properties
@@ -1026,7 +1026,7 @@ WorkflowGraph.Toolbar.AlignTop.Tooltip=Align the actions with the top-most actio
WorkflowGraph.Toolbar.AlignBottom.Tooltip=Align the actions with the bottom-most action in your selection
WorkflowGraph.Toolbar.DistributeHorizontal.Tooltip=Distribute the selected actions evenly between the left-most and right-most action in your selection
WorkflowGraph.Toolbar.DistributeVertical.Tooltip=Distribute the selected actions evenly between the top-most and bottom-most action in your selection
-WorkflowGraph.Toolbar.EditWorkflow.Tooltip=Edit workflow properties (CTRL-L or CMD-L)
+WorkflowGraph.Toolbar.EditWorkflow.Tooltip=Edit workflow properties
HopGuiWorkflowGraph.ContextualActionDialog.Workflow.Header=Select the action to execute or the action to create:
HopGuiWorkflowGraph.ContextualActionDialog.Action.Header=Select the action to take on action ''{0}'':
HopGuiWorkflowGraph.ContextualActionDialog.Note.Header=Select the note action to take:
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/messages/messages_en_US.properties
index 4c522e2..64b8980 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/messages/messages_en_US.properties
@@ -973,7 +973,7 @@ HopGui.Toolbar.Undo.Tooltip=Undo an operation
HopGui.Toolbar.Redo.Tooltip=Redo an operation
HopGui.Toolbar.Zoom=Zoom:
HopGui.Toolbar.Zoom.Tooltip=Zoom in our out
-HopGui.Toolbar.EditProperties.Tooltip=Edit the pipeline properties (CTRL-T or CMD-T)
+HopGui.Toolbar.EditProperties.Tooltip=Edit the pipeline properties
PipelineGraph.NewPipelineBackgroundMessage=Left click or tap anywhere to start.
PipelineGraph.SaveFile.Dialog.Header=Save File?
PipelineGraph.SaveFile.Dialog.Message=Do you want to save file ''{0}'' before closing?
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_en_US.properties
index 74c1498..6cf8bde 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_en_US.properties
@@ -17,7 +17,7 @@
#
#
#
-DataOrchestrationPerspective.Name=Data Orchestration (Ctrl+Shift+D)
+DataOrchestrationPerspective.Name=Data Orchestration
DataOrchestrationPerspective.Description=The Hop Data Orchestration Perspective for pipelines and workflows
DataOrchestrationPerspective.GuiPlugin.Description=Hop Data Orchestration Perspective GUI
DataOrchestrationPerspective.Close.Button.Text=Close
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_it_IT.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_it_IT.properties
index fafd8ea..68f81a4 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_it_IT.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/dataorch/messages/messages_it_IT.properties
@@ -17,7 +17,7 @@
#
#
#
-DataOrchestrationPerspective.Name=Data Orchestration (Ctrl+Shift+D)
+DataOrchestrationPerspective.Name=Data Orchestration
DataOrchestrationPerspective.Description=The Hop Data Orchestration Perspective for pipelines and workflows
DataOrchestrationPerspective.GuiPlugin.Description=Hop Data Orchestration Perspective GUI
DataOrchestrationPerspective.Close.Button.Text=Chiudi
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_en_US.properties
index 4020e0c..9997475 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_en_US.properties
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-ExplorerPerspective.Name=File Explorer (Ctrl+Shift+E)
+ExplorerPerspective.Name=File Explorer
ExplorerPerspective.Description=The Hop Explorer Perspective
ExplorerPerspective.GuiPlugin.Description=A file explorer for your current project
ExplorerPerspective.Error.RootFolder.Header=Error
@@ -26,8 +26,8 @@ ExplorerPerspective.Error.TreeRefresh.Message=Error refreshing file explorer tre
ExplorerPerspective.DeleteFile.Confirmation.Header=Delete file?
ExplorerPerspective.DeleteFile.Confirmation.Message=Are you sure you want to delete the following file?
ExplorerPerspective.ToolbarElement.Open.Tooltip=Open selected file
-ExplorerPerspective.ToolbarElement.Delete.Tooltip=Delete selected file (DEL)
-ExplorerPerspective.ToolbarElement.Rename.Tooltip=Rename the selected file (F2)
+ExplorerPerspective.ToolbarElement.Delete.Tooltip=Delete selected file
+ExplorerPerspective.ToolbarElement.Rename.Tooltip=Rename the selected file
ExplorerPerspective.ToolbarElement.Refresh.Tooltip=Refresh
ExplorerPerspective.ToolbarElement.CreateFolder.Tooltip=Create folder
ExplorerPerspective.Error.DeleteFile.Header=Error
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_it_IT.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_it_IT.properties
index 7294cdf..20c449e 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_it_IT.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/explorer/messages/messages_it_IT.properties
@@ -17,7 +17,7 @@
#
#
#
-ExplorerPerspective.Name=File Explorer (Ctrl+Shift+E)
+ExplorerPerspective.Name=File Explorer
ExplorerPerspective.Description=The Hop Explorer Perspective
ExplorerPerspective.GuiPlugin.Description=Un file explorer per il tuo progetto
ExplorerPerspective.Error.RootFolder.Header=Errore
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_en_US.properties
index 1e6f200..60f4099 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_en_US.properties
@@ -17,7 +17,7 @@
#
#
#
-MetadataPerspective.Name=Metadata (Ctrl+Shift+M)
+MetadataPerspective.Name=Metadata
MetadataPerspective.Description=The Hop Metatada Perspective
MetadataPerspective.GuiPlugin.Description=This perspective allows you to see and edit all available metadata
MetadataPerspective.CreateMetadata.Error.Header=Error
diff --git a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_it_IT.properties b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_it_IT.properties
index 69f1f6e..28b91c5 100644
--- a/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_it_IT.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/hopgui/perspective/metadata/messages/messages_it_IT.properties
@@ -17,7 +17,7 @@
#
#
#
-MetadataPerspective.Name=Metadata (Ctrl+Shift+M)
+MetadataPerspective.Name=Metadata
MetadataPerspective.Description=La Hop Metatada Perspective
MetadataPerspective.GuiPlugin.Description=Questa perspective ti permette di vedere e modificare tutti i metadati disponibili
MetadataPerspective.CreateMetadata.Error.Header=Errore