Author: fbricon
Date: 2012-02-24 03:41:59 -0500 (Fri, 24 Feb 2012)
New Revision: 39090
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-11039 : fix unsorted Wizards in the New Project section
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
---
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-24
08:39:27 UTC (rev 39089)
+++
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2012-02-24
08:41:59 UTC (rev 39090)
@@ -14,6 +14,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -553,35 +554,28 @@
IExtensionPoint extensionPoint =
extensionRegistry.getExtensionPoint("org.eclipse.ui.newWizards");
IExtension[] extensions = extensionPoint.getExtensions();
- List<String> wizardIDs =
ProjectExamplesActivator.getDefault().getConfigurator().getWizardIds();
+ List<String> sortedWizardIds =
ProjectExamplesActivator.getDefault().getConfigurator().getWizardIds();
- List<String> createdIDs = new ArrayList<String>();
+ Map<String, IConfigurationElement> wizards = new HashMap<String,
IConfigurationElement>(sortedWizardIds.size());
for (IExtension extension : extensions) {
- IConfigurationElement[] elements = extension
- .getConfigurationElements();
+ IConfigurationElement[] elements = extension.getConfigurationElements();
for (IConfigurationElement element : elements) {
String id = element.getAttribute("id");
- if (wizardIDs.contains(id) && !createdIDs.contains(id)) {
- createProjectLink(toolkit, projectsComposite, element);
- createdIDs.add(id);
+ if (sortedWizardIds.contains(id) && wizards.get(id) == null) {
+ wizards.put(id, element);
}
}
}
+ for (String wid : sortedWizardIds){
+ IConfigurationElement element = wizards.get(wid);
+ if (element != null) {
+ createProjectLink(toolkit, projectsComposite, element);
+ }
+ }
projectsSection.setClient(projectsComposite);
}
- private void addProjectExamples(FormToolkit toolkit,
- Composite projectsComposite) {
- List<ProjectExample> wizards = RefreshTutorialsJob.INSTANCE.getWizardProjects();
- Collections.sort(wizards);
- for (final ProjectExample wizard : wizards) {
- FormText text = toolkit.createFormText(projectsComposite, true);
- configureTutorialText(text, wizard);
-
- }
-
- }
private void createProjectLink(FormToolkit toolkit, Composite composite,
final IConfigurationElement element) {
@@ -1247,8 +1241,8 @@
return;
}
setBusyIndicator(tutorialsLoadingComposite, false);
- addProjectExamples(toolkit, projectsComposite);
refreshTutorials();
+
}
});
Show replies by date