1 11 package org.eclipse.ui.internal.ide.dialogs; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.ui.IElementFactory; 15 import org.eclipse.ui.IMemento; 16 import org.eclipse.ui.internal.ide.AboutInfo; 17 18 21 public class WelcomeEditorInputFactory implements IElementFactory { 22 25 public WelcomeEditorInputFactory() { 26 super(); 27 } 28 29 44 public IAdaptable createElement(IMemento memento) { 45 String versionedFeatureId = memento 47 .getString(WelcomeEditorInput.FEATURE_ID); 48 if (versionedFeatureId == null) { 49 return null; 50 } 51 int colonPos = versionedFeatureId.indexOf(':'); 52 if (colonPos == -1) { 53 return null; 55 } 56 String featureId = versionedFeatureId.substring(0, colonPos); 57 String versionId = versionedFeatureId.substring(colonPos + 1); 58 AboutInfo info = AboutInfo.readFeatureInfo(featureId, versionId); 60 if (info == null) { 61 return null; 62 } 63 return new WelcomeEditorInput(info); 64 } 65 } 66 | Popular Tags |