This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/main by this push:
new 336417b03c Git perspectives with double-click to expand/collapse
groups #7817 (#7818)
336417b03c is described below
commit 336417b03c8631b916a75549b717682ff5c694aa
Author: Nicolas Adment <[email protected]>
AuthorDate: Fri Aug 7 14:00:19 2026 +0200
Git perspectives with double-click to expand/collapse groups #7817 (#7818)
---
.../java/org/apache/hop/git/GitCommitPerspective.java | 18 +++++++++++-------
.../main/java/org/apache/hop/git/GitPerspective.java | 8 ++++++--
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git
a/plugins/misc/git/src/main/java/org/apache/hop/git/GitCommitPerspective.java
b/plugins/misc/git/src/main/java/org/apache/hop/git/GitCommitPerspective.java
index 7d31689c11..9a75636b3f 100644
---
a/plugins/misc/git/src/main/java/org/apache/hop/git/GitCommitPerspective.java
+++
b/plugins/misc/git/src/main/java/org/apache/hop/git/GitCommitPerspective.java
@@ -402,13 +402,17 @@ public class GitCommitPerspective implements
IHopPerspective {
protected void openFile(Event event) {
try {
TreeItem item = (TreeItem) event.item;
- if (item != null && item.getData() instanceof UIFile file) {
- ExplorerPerspective perspective = ExplorerPerspective.getInstance();
- UIGit git = GitGuiPlugin.getInstance().getGit();
- String path = this.getAbsolutePath(git.getDirectory(), file.getName());
- IHopFileType fileType = perspective.getFileType(path);
- fileType.openFile(hopGui, path, hopGui.getVariables());
- perspective.activate();
+ if (item != null) {
+ if (item.getData() instanceof UIFile file) {
+ ExplorerPerspective perspective = ExplorerPerspective.getInstance();
+ UIGit git = GitGuiPlugin.getInstance().getGit();
+ String path = this.getAbsolutePath(git.getDirectory(),
file.getName());
+ IHopFileType fileType = perspective.getFileType(path);
+ fileType.openFile(hopGui, path, hopGui.getVariables());
+ perspective.activate();
+ } else {
+ item.setExpanded(!item.getExpanded());
+ }
}
} catch (Exception e) {
new ErrorDialog(
diff --git
a/plugins/misc/git/src/main/java/org/apache/hop/git/GitPerspective.java
b/plugins/misc/git/src/main/java/org/apache/hop/git/GitPerspective.java
index c0deea7357..1aeca3fa05 100644
--- a/plugins/misc/git/src/main/java/org/apache/hop/git/GitPerspective.java
+++ b/plugins/misc/git/src/main/java/org/apache/hop/git/GitPerspective.java
@@ -475,8 +475,12 @@ public class GitPerspective implements IHopPerspective {
protected void selectRef(Event event) {
TreeItem item = (TreeItem) event.item;
- if (item != null && item.getData() instanceof Ref ref) {
- refreshHistory(ref.getName());
+ if (item != null) {
+ if (item.getData() instanceof Ref ref) {
+ refreshHistory(ref.getName());
+ } else {
+ item.setExpanded(!item.getExpanded());
+ }
}
}