1 11 package org.eclipse.pde.internal.ui.search; 12 13 import org.eclipse.core.resources.IMarker; 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.pde.internal.core.PDECore; 16 import org.eclipse.pde.internal.core.ischema.ISchema; 17 import org.eclipse.pde.internal.ui.PDEPlugin; 18 import org.eclipse.ui.*; 19 20 24 public class SchemaMarkerResolutionGenerator implements IMarkerResolutionGenerator { 25 28 private IMarkerResolution [] resolutions = new IMarkerResolution[1]; 29 30 class SchemaMarkerResolution implements IMarkerResolution { 31 private ShowDescriptionAction action; 32 public String getLabel() { 33 return PDEPlugin.getResourceString("SchemaMarkerResolutionGenerator.label"); } 35 36 public void run(IMarker marker) { 37 try { 38 String point = (String )marker.getAttribute("point"); if (point==null) return; 40 ISchema schema = PDECore.getDefault().getSchemaRegistry().getSchema(point); 41 42 if (action==null) 43 action = new ShowDescriptionAction(schema); 44 else 45 action.setSchema(schema); 46 action.run(); 47 } 48 catch (CoreException e) { 49 PDEPlugin.logException(e); 50 } 51 } 52 } 53 public SchemaMarkerResolutionGenerator() { 54 resolutions[0] = new SchemaMarkerResolution(); 55 } 56 57 61 public IMarkerResolution [] getResolutions(IMarker marker) { 62 return resolutions; 63 } 64 } 65 | Popular Tags |