Skip to content

Commit

Permalink
Automatically Expand Paths of single children #1063
Browse files Browse the repository at this point in the history
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
eclipse-platform/eclipse.platform.ui#1063
  • Loading branch information
Maximilian Wittmer authored and Maximilian Wittmer committed Apr 3, 2024
1 parent 8aef553 commit 5d49f6d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,20 @@ public void treeExpanded(TreeExpansionEvent event) {


private class PackageExplorerProblemTreeViewer extends ProblemTreeViewer {
/**
* Number of levels to automatically expand when an element only has a single
* child.
*
* @see AbstractTreeViewer#setAutoExpandOnSingleChildLevels(int)
*/
private static final int AUTO_EXPAND_ON_SINGLE_CHILD_LEVELS= 10;
// fix for 64372 Projects showing up in Package Explorer twice [package explorer]
private final List<Object> fPendingRefreshes;

public PackageExplorerProblemTreeViewer(Composite parent, int style) {
super(parent, style);
fPendingRefreshes= Collections.synchronizedList(new ArrayList<>());
setAutoExpandOnSingleChildLevels(AUTO_EXPAND_ON_SINGLE_CHILD_LEVELS);
}
@Override
public void add(Object parentElement, Object... childElements) {
Expand Down

0 comments on commit 5d49f6d

Please sign in to comment.