1 11 12 package org.eclipse.ui.internal.preferences; 13 14 import java.util.ArrayList ; 15 import java.util.Collection ; 16 17 import org.eclipse.core.runtime.IConfigurationElement; 18 import org.eclipse.core.runtime.IExtensionRegistry; 19 import org.eclipse.core.runtime.Platform; 20 import org.eclipse.ui.internal.WorkbenchPlugin; 21 import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; 22 import org.eclipse.ui.internal.registry.RegistryReader; 23 24 33 public class SettingsTransferRegistryReader extends RegistryReader { 34 35 Collection settingsTransfers = new ArrayList (); 36 37 40 public SettingsTransferRegistryReader() { 41 42 } 43 44 49 public IConfigurationElement[] getSettingTransfers() { 50 51 settingsTransfers = new ArrayList (); 52 IExtensionRegistry registry = Platform.getExtensionRegistry(); 53 readRegistry(registry, WorkbenchPlugin.PI_WORKBENCH, 54 IWorkbenchRegistryConstants.PL_PREFERENCE_TRANSFER); 55 56 IConfigurationElement[] transfers = new IConfigurationElement[settingsTransfers 57 .size()]; 58 settingsTransfers.toArray(transfers); 59 return transfers; 60 61 } 62 63 68 protected boolean readElement(IConfigurationElement element) { 69 if (element.getName().equals( 70 IWorkbenchRegistryConstants.TAG_SETTINGS_TRANSFER)) { 71 72 settingsTransfers.add(element); 73 return true; 74 } 75 76 return element.getName().equals( 78 IWorkbenchRegistryConstants.TAG_TRANSFER); 79 } 80 81 } 82 | Popular Tags |