From c0509643a47fceda84f816f0437d3d7433793903 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Mon, 7 Apr 2008 12:41:50 +0400 Subject: [PATCH] sort frameworks in project wizard --- .../newProjectWizard/AddSupportForFrameworksPanel.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java b/source/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java index 4acf764d66..43d340da00 100644 --- a/source/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java +++ b/source/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java @@ -241,6 +241,18 @@ public class AddSupportForFrameworksPanel { return list; } + private static void sortByTitle(List providers) { + Collections.sort(providers, new Comparator() { + public int compare(final FrameworkSupportProvider o1, final FrameworkSupportProvider o2) { + return getTitleWithoutMnemonic(o2).compareTo(getTitleWithoutMnemonic(o1)); + } + }); + } + + private static String getTitleWithoutMnemonic(final FrameworkSupportProvider provider) { + return StringUtil.replace(provider.getTitle(), String.valueOf(UIUtil.MNEMONIC), ""); + } + private static void addChildFrameworks(final List list, final ArrayList selected, final boolean selectedOnly) { for (FrameworkSupportSettings settings : list) { @@ -335,7 +347,7 @@ public class AddSupportForFrameworksPanel { public LibraryCompositionSettings getLibraryCompositionSettings() { if (myLibraryCompositionSettings == null || isObsolete(myLibraryCompositionSettings)) { - final String title = StringUtil.replace(myProvider.getTitle(), String.valueOf(UIUtil.MNEMONIC), ""); + final String title = getTitleWithoutMnemonic(myProvider); myLibraryCompositionSettings = new LibraryCompositionSettings(myConfigurable.getLibraries(), myConfigurable.getLibraryName(), getBaseModuleDirectoryPath(), title, myProvider.getIcon()); } @@ -347,7 +359,8 @@ public class AddSupportForFrameworksPanel { private final List myFrameworkSupportProviders; public ProvidersGraph(final List frameworkSupportProviders) { - myFrameworkSupportProviders = frameworkSupportProviders; + myFrameworkSupportProviders = new ArrayList(frameworkSupportProviders); + sortByTitle(myFrameworkSupportProviders); } public Collection getNodes() { @@ -370,6 +383,7 @@ public class AddSupportForFrameworksPanel { dependencies.add(dependency); } } + sortByTitle(dependencies); return dependencies.iterator(); } } -- 2.11.4.GIT