1 11 package org.eclipse.ui.internal.registry; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.eclipse.core.runtime.IExtensionRegistry; 16 import org.eclipse.ui.PlatformUI; 17 import org.eclipse.ui.internal.WorkbenchPlugin; 18 19 22 public class PerspectiveRegistryReader extends RegistryReader { 23 private PerspectiveRegistry registry; 24 25 30 public PerspectiveRegistryReader(PerspectiveRegistry out) { 31 super(); 32 registry = out; 33 } 34 35 38 protected boolean readElement(IConfigurationElement element) { 40 if (element.getName().equals(IWorkbenchRegistryConstants.TAG_PERSPECTIVE)) { 41 try { 42 PerspectiveDescriptor desc = new PerspectiveDescriptor(element.getAttribute(IWorkbenchRegistryConstants.ATT_ID), element); 43 registry.addPerspective(desc); 44 } catch (CoreException e) { 45 WorkbenchPlugin.log( 47 "Unable to create layout descriptor.", e.getStatus()); } 49 return true; 50 } 51 52 return false; 53 } 54 55 60 public void readPerspectives(IExtensionRegistry in) { 61 readRegistry(in, PlatformUI.PLUGIN_ID, 62 IWorkbenchRegistryConstants.PL_PERSPECTIVES); 63 } 64 } 65 | Popular Tags |