1 11 package org.eclipse.pde.internal.ui.correction; 12 13 import org.eclipse.core.resources.IMarker; 14 import org.eclipse.jdt.ui.IJavaElementSearchConstants; 15 import org.eclipse.pde.core.plugin.IPluginModelBase; 16 import org.eclipse.pde.internal.core.text.IDocumentNode; 17 import org.eclipse.pde.internal.core.text.plugin.PluginAttribute; 18 import org.eclipse.pde.internal.ui.PDEUIMessages; 19 import org.eclipse.pde.internal.ui.util.PDEJavaHelperUI; 20 21 public class ChooseClassXMLResolution extends AbstractXMLMarkerResolution { 22 23 public ChooseClassXMLResolution(int resolutionType, IMarker marker) { 24 super(resolutionType, marker); 25 } 26 27 protected void createChange(IPluginModelBase model) { 28 Object object = findNode(model); 29 if (!(object instanceof PluginAttribute)) 30 return; 31 PluginAttribute attrib = (PluginAttribute)object; 32 IDocumentNode element = attrib.getEnclosingElement(); 33 String type = PDEJavaHelperUI.selectType(fResource, IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES); 34 if (type != null) 35 element.setXMLAttribute(attrib.getName(), type); 36 } 37 38 public String getDescription() { 39 return getLabel(); 40 } 41 42 public String getLabel() { 43 return PDEUIMessages.ChooseClassXMLResolution_label; 44 } 45 46 } 47 | Popular Tags |