KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > correction > ChooseClassXMLResolution


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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 JavaDoc object = findNode(model);
29         if (!(object instanceof PluginAttribute))
30             return;
31         PluginAttribute attrib = (PluginAttribute)object;
32         IDocumentNode element = attrib.getEnclosingElement();
33         String JavaDoc type = PDEJavaHelperUI.selectType(fResource, IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES);
34         if (type != null)
35             element.setXMLAttribute(attrib.getName(), type);
36     }
37
38     public String JavaDoc getDescription() {
39         return getLabel();
40     }
41
42     public String JavaDoc getLabel() {
43         return PDEUIMessages.ChooseClassXMLResolution_label;
44     }
45
46 }
47
Popular Tags