1 11 12 package org.eclipse.core.internal.registry; 13 14 import org.eclipse.core.runtime.*; 15 import org.eclipse.core.runtime.spi.IRegistryProvider; 16 17 20 public final class RegistryProviderFactory { 21 22 private static IRegistryProvider defaultRegistryProvider; 23 24 public static IRegistryProvider getDefault() { 25 return defaultRegistryProvider; 26 } 27 28 public static void setDefault(IRegistryProvider provider) throws CoreException { 29 if (defaultRegistryProvider != null) { 30 Status status = new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, RegistryMessages.registry_default_exists, null); 31 throw new CoreException(status); 32 } 33 defaultRegistryProvider = provider; 34 } 35 36 public static void releaseDefault() { 37 defaultRegistryProvider = null; 38 } 39 } 40 | Popular Tags |