Index: src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java,v retrieving revision 1.39 diff -u -r1.39 IDEWorkbenchAdvisor.java --- src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java 25 May 2004 20:16:11 -0000 1.39 +++ src/org/eclipse/ui/internal/ide/IDEWorkbenchAdvisor.java 2 Jun 2004 17:49:22 -0000 @@ -42,7 +42,6 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.Assert; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorReference; @@ -180,20 +179,22 @@ //Suspend background jobs while we startup Platform.getJobManager().suspend(); - // collect the welcome perspectives of the new installed features - initializeFeatureSets(); - Set s = getNewlyAddedFeatures(); - welcomePerspectiveInfos = new ArrayList(s.size()); - for (Iterator it = s.iterator(); it.hasNext(); ) { - String versionedId = (String) it.next(); - String featureId = versionedId.substring(0, versionedId.indexOf(':')); - String featureVersionId = versionedId.substring(versionedId.indexOf(':')+1); - AboutInfo info = AboutInfo.readFeatureInfo(featureId, featureVersionId, featureId); - if (info != null && info.getWelcomePerspectiveId() != null && info.getWelcomePageURL() != null) { - welcomePerspectiveInfos.add(info); + + // support old welcome perspectives if intro plugin is not present + if (!hasIntro()) { + Set s = getNewlyAddedFeatures(); + welcomePerspectiveInfos = new ArrayList(s.size()); + for (Iterator it = s.iterator(); it.hasNext(); ) { + String versionedId = (String) it.next(); + String featureId = versionedId.substring(0, versionedId.indexOf(':')); + String featureVersionId = versionedId.substring(versionedId.indexOf(':')+1); + AboutInfo info = AboutInfo.readFeatureInfo(featureId, featureVersionId, featureId); + if (info != null && info.getWelcomePerspectiveId() != null && info.getWelcomePageURL() != null) { + welcomePerspectiveInfos.add(info); + } } } - + //Register the build actions IProgressService service = PlatformUI.getWorkbench() .getProgressService(); @@ -641,14 +642,15 @@ * @return ordered set of versioned feature ids (element type: String) */ private Set getNewlyAddedFeatures() { - Assert.isNotNull(newlyAddedFeatures); + if (newlyAddedFeatures == null) + newlyAddedFeatures = createNewFeaturesSet(); return newlyAddedFeatures; } /** * Initializes the old, current, and newly added features. */ - private void initializeFeatureSets() { + private Set createNewFeaturesSet() { // retrieve list of installed feature from last session IDialogSettings settings = IDEWorkbenchPlugin.getDefault().getDialogSettings(); String[] previousFeaturesArray = settings.getArray(INSTALLED_FEATURES); @@ -666,9 +668,9 @@ settings.put(INSTALLED_FEATURES, currentFeaturesArray); // compute recently installed features - use TreeSet to get predictable order - newlyAddedFeatures = new TreeSet(currentFeatures); - newlyAddedFeatures.removeAll(previousFeatures); - + Set newFeatures = new TreeSet(currentFeatures); + newFeatures.removeAll(previousFeatures); + return newFeatures; } /* @@ -949,13 +951,21 @@ editorsAndIntrosOpened = true; // don't try to open the welcome editors if there is an intro - if (windowConfigurer.getWorkbenchConfigurer().getWorkbench().getIntroManager().hasIntro()) + if (hasIntro()) super.openIntro(windowConfigurer); else { openWelcomeEditors(windowConfigurer.getWindow()); // save any preferences changes caused by the above actions IDEWorkbenchPlugin.getDefault().savePluginPreferences(); } + } + + /** + * Return true if the intro plugin is present and false otherwise. + */ + private boolean hasIntro() { + IWorkbenchConfigurer wc = getWorkbenchConfigurer(); + return wc == null ? false : wc.getWorkbench().getIntroManager().hasIntro(); } /**