1 11 package org.eclipse.team.internal.ui.wizards; 12 13 14 import org.eclipse.core.runtime.*; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.team.internal.ui.TeamUIPlugin; 17 import org.eclipse.ui.IPluginContribution; 18 import org.eclipse.ui.model.IWorkbenchAdapter; 19 import org.eclipse.ui.model.WorkbenchAdapter; 20 21 25 public class ConfigurationWizardElement extends WorkbenchAdapter implements IAdaptable, IPluginContribution { 26 private String id; 27 private String name; 28 private ImageDescriptor imageDescriptor; 29 private IConfigurationElement configurationElement; 30 31 36 public ConfigurationWizardElement(String name) { 37 this.name = name; 38 } 39 46 public Object createExecutableExtension() throws CoreException { 47 return TeamUIPlugin.createExtension(configurationElement, ConfigureProjectWizard.ATT_CLASS); 48 } 49 52 public Object getAdapter(Class adapter) { 53 if (adapter == IWorkbenchAdapter.class) { 54 return this; 55 } 56 return Platform.getAdapterManager().getAdapter(this, adapter); 57 } 58 63 public IConfigurationElement getConfigurationElement() { 64 return configurationElement; 65 } 66 72 public ImageDescriptor getImageDescriptor(Object element) { 73 return imageDescriptor; 74 } 75 81 public String getLabel(Object element) { 82 return name; 83 } 84 89 public String getID() { 90 return id; 91 } 92 97 public ImageDescriptor getImageDescriptor() { 98 return imageDescriptor; 99 } 100 105 public void setConfigurationElement(IConfigurationElement newConfigurationElement) { 106 configurationElement = newConfigurationElement; 107 } 108 113 public void setDescription(String value) { 114 } 116 121 public void setID(String value) { 122 id = value; 123 } 124 129 public void setImageDescriptor(ImageDescriptor value) { 130 imageDescriptor = value; 131 } 132 133 136 public String getLocalId() { 137 return configurationElement.getAttribute(ConfigureProjectWizard.ATT_ID); 138 } 139 140 143 public String getPluginId() { 144 return configurationElement.getNamespace(); 145 } 146 } 147 | Popular Tags |