From 2a8f0d312a304df500e6d5395a12131b8abbe2a4 Mon Sep 17 00:00:00 2001 From: Maximilian Wittmer Date: Mon, 11 Mar 2024 11:54:45 +0100 Subject: [PATCH] Automatically Expand Paths of single children #1063 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In these cases, I expect all folders to open recursively when clicking on com.wittmaxi.plugin com.wittmaxi.plugin └─src └─org.foo.com └─Bar.java A new feature in SWT allows for this feature, this PR enables that feature in the Package Explorer. Implements https://github.com/eclipse-platform/eclipse.platform.ui/issues/1063 --- .../jdt/internal/ui/packageview/PackageExplorerPart.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java index 6b9fea51743..e06374a545a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java @@ -256,6 +256,7 @@ private class PackageExplorerProblemTreeViewer extends ProblemTreeViewer { public PackageExplorerProblemTreeViewer(Composite parent, int style) { super(parent, style); fPendingRefreshes= Collections.synchronizedList(new ArrayList<>()); + setAutoExpandOnSingleChildLevels(ALL_LEVELS); } @Override public void add(Object parentElement, Object... childElements) { @@ -576,7 +577,7 @@ private void initFrameActions() { } private ProblemTreeViewer createViewer(Composite composite) { - return new PackageExplorerProblemTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + new PackageExplorerProblemTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); } /**