From bb94a2217cf8659499a4c5f07f4e72542d8adf2c Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 26 Jul 2006 13:53:55 +0400 Subject: [PATCH] sort dependencies --- .../projectRoot/ProjectRootConfigurable.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectRootConfigurable.java b/source/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectRootConfigurable.java index 59e0d5386d..e57999474a 100644 --- a/source/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectRootConfigurable.java +++ b/source/com/intellij/openapi/roots/ui/configuration/projectRoot/ProjectRootConfigurable.java @@ -587,7 +587,7 @@ public class ProjectRootConfigurable extends MasterDetailsComponent implements P } private void showDependencies() { - final List dependencies = getDependencies(); + final Set dependencies = getDependencies(); if (dependencies == null || dependencies.size() == 0){ Messages.showInfoMessage(myTree, FindBundle.message("find.usage.view.no.usages.text"), FindBundle.message("find.pointcut.applications.not.found.title")); return; @@ -596,7 +596,8 @@ public class ProjectRootConfigurable extends MasterDetailsComponent implements P final Rectangle rowBounds = myTree.getRowBounds(selectedRow); final Point location = rowBounds.getLocation(); location.x += rowBounds.width; - JBPopupFactory.getInstance().createWizardStep(new BaseListPopupStep(ProjectBundle.message("dependencies.used.in.popup.title"), dependencies) { + JBPopupFactory.getInstance().createWizardStep(new BaseListPopupStep(ProjectBundle.message("dependencies.used.in.popup.title"), + dependencies.toArray(new String[dependencies.size()])) { public PopupStep onChosen(final String nameToSelect, final boolean finalChoice) { selectNodeInTree(nameToSelect); @@ -611,7 +612,7 @@ public class ProjectRootConfigurable extends MasterDetailsComponent implements P } @Nullable - private List getDependencies() { + private Set getDependencies() { final Object selectedObject = getSelectedObject(); if (selectedObject instanceof Module) { return getDependencies(new Condition() { @@ -623,9 +624,9 @@ public class ProjectRootConfigurable extends MasterDetailsComponent implements P else if (selectedObject instanceof Library) { if (((Library)selectedObject).getTable() == null) { //module library navigation final MyNode node = (MyNode)myTree.getSelectionPath().getLastPathComponent(); - final List list = new ArrayList(); - list.add(((MyNode)node.getParent()).getDisplayName()); - return list; + final Set set = new HashSet(); + set.add(((MyNode)node.getParent()).getDisplayName()); + return set; } return getDependencies(new Condition() { public boolean value(final OrderEntry orderEntry) { @@ -647,8 +648,8 @@ public class ProjectRootConfigurable extends MasterDetailsComponent implements P return null; } - private List getDependencies(Condition condition) { - final List result = new ArrayList(); + private Set getDependencies(Condition condition) { + final Set result = new TreeSet(); final Module[] modules = myModulesConfigurator.getModules(); for (Module module : modules) { final ModifiableRootModel rootModel = myModulesConfigurator.getModuleEditor(module).getModifiableRootModel(); -- 2.11.4.GIT