1 11 12 package org.eclipse.ui.internal.ide.undo; 13 14 import java.util.Map ; 15 16 import org.eclipse.core.resources.IMarker; 17 import org.eclipse.core.resources.IResource; 18 import org.eclipse.core.runtime.CoreException; 19 20 29 public class MarkerDescription { 30 String type; 31 32 Map attributes; 33 34 IResource resource; 35 36 44 public MarkerDescription(IMarker marker) throws CoreException { 45 this.type = marker.getType(); 46 this.attributes = marker.getAttributes(); 47 this.resource = marker.getResource(); 48 49 } 50 51 62 public MarkerDescription(String type, Map attributes, IResource resource) { 63 this.type = type; 64 this.attributes = attributes; 65 this.resource = resource; 66 } 67 68 74 public IMarker createMarker() throws CoreException { 75 IMarker marker = resource.createMarker(type); 76 marker.setAttributes(attributes); 77 return marker; 78 } 79 80 87 public void updateMarker(IMarker marker) throws CoreException { 88 marker.setAttributes(attributes); 89 } 90 91 96 public IResource getResource() { 97 return resource; 98 } 99 100 105 public String getType() { 106 return type; 107 } 108 } | Popular Tags |