1 11 package org.eclipse.ui.internal.registry; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.ui.PlatformUI; 15 import org.eclipse.ui.internal.IWorkbenchConstants; 16 import org.eclipse.ui.internal.WorkbenchPlugin; 17 18 21 public class ActionSetRegistryReader extends RegistryReader { 22 private static final String TAG_SET="actionSet"; private ActionSetRegistry registry; 24 25 28 public ActionSetRegistryReader() { 29 super(); 30 } 31 public ActionSetRegistryReader(ActionSetRegistry registry) { 33 this.registry = registry; 34 } 35 38 public boolean readElement(IConfigurationElement element) { 40 if (element.getName().equals(TAG_SET)) { 41 try { 42 ActionSetDescriptor desc = new ActionSetDescriptor(element); 43 registry.addActionSet(desc); 44 } catch (CoreException e) { 45 WorkbenchPlugin.log("Unable to create action set descriptor.",e.getStatus()); } 48 return true; 49 } else { 50 return false; 51 } 52 } 53 56 public void readRegistry(IExtensionRegistry in, ActionSetRegistry out) 57 { 58 registry = out; 59 readRegistry(in, PlatformUI.PLUGIN_ID, IWorkbenchConstants.PL_ACTION_SETS); 60 out.mapActionSetsToCategories(); 61 } 62 } 63 | Popular Tags |