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 WorkingSetRegistryReader extends RegistryReader { 23 24 25 private WorkingSetRegistry registry; 26 27 30 public WorkingSetRegistryReader() { 31 super(); 32 } 33 34 39 public WorkingSetRegistryReader(WorkingSetRegistry registry) { 40 super(); 41 this.registry = registry; 42 } 43 44 49 public boolean readElement(IConfigurationElement element) { 50 if (element.getName().equals(IWorkbenchRegistryConstants.TAG_WORKING_SET)) { 51 try { 52 WorkingSetDescriptor desc = new WorkingSetDescriptor(element); 53 registry.addWorkingSetDescriptor(desc); 54 } catch (CoreException e) { 55 WorkbenchPlugin 57 .log( 58 "Unable to create working set descriptor.", e.getStatus()); } 60 return true; 61 } 62 63 return false; 64 } 65 66 72 public void readWorkingSets(IExtensionRegistry in, WorkingSetRegistry out) { 73 registry = out; 74 readRegistry(in, PlatformUI.PLUGIN_ID, 75 IWorkbenchRegistryConstants.PL_WORKINGSETS); 76 } 77 } 78 | Popular Tags |