This is an automated email from the ASF dual-hosted git repository. matthiasblaesing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
The following commit(s) were added to refs/heads/master by this push: new 1f490d4 [NETBEANS-1613] Fix for 'Select in Projects' not having an effect in Java Modular Projects (#1082) 1f490d4 is described below commit 1f490d4de336527f57683e6dc7ddc53b90454fc1 Author: peedeeboy <44434629+peedee...@users.noreply.github.com> AuthorDate: Sat Jan 19 17:48:05 2019 +0000 [NETBEANS-1613] Fix for 'Select in Projects' not having an effect in Java Modular Projects (#1082) --- .../common/project/ui/MultiModuleNodeFactory.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/MultiModuleNodeFactory.java b/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/MultiModuleNodeFactory.java index 809a838..018bf5f 100644 --- a/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/MultiModuleNodeFactory.java +++ b/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/MultiModuleNodeFactory.java @@ -64,6 +64,7 @@ import org.netbeans.modules.java.api.common.queries.MultiModuleGroupQuery; import org.netbeans.spi.java.project.support.ui.PackageView; import org.netbeans.spi.project.support.ant.PropertyEvaluator; import org.netbeans.spi.project.support.ant.ReferenceHelper; +import org.netbeans.spi.project.ui.PathFinder; import org.netbeans.spi.project.ui.support.CommonProjectActions; import org.netbeans.spi.project.ui.support.NodeFactory; import org.netbeans.spi.project.ui.support.NodeList; @@ -473,7 +474,7 @@ public final class MultiModuleNodeFactory implements NodeFactory { } setIconBaseWithExtension(ICON); setName(moduleName); - lookup.update(new ContentLkp(this, key.getProject())); + lookup.update(new ContentLkp(this, key.getProject(), new ModulePathFinder())); updateFileStatusListeners(); } @@ -884,6 +885,25 @@ public final class MultiModuleNodeFactory implements NodeFactory { return delegate.paste(); } } + + private static final class ModulePathFinder implements PathFinder { + ModulePathFinder() { + } + + @Override + public Node findPath(Node root, Object target) { + for(Node node : root.getChildren().getNodes(true)) { + PathFinder pf = node.getLookup().lookup(PathFinder.class); + if(pf != null) { + Node result = pf.findPath(node, target); + if(result != null) { + return result; + } + } + } + return null; + } + } } private static final class ModuleChildren extends Children.Keys<ModuleChildren.Key> implements PropertyChangeListener { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists