1 11 12 package org.eclipse.ui.ide.undo; 13 14 import java.util.Map ; 15 16 import org.eclipse.core.resources.IMarker; 17 import org.eclipse.core.runtime.CoreException; 18 import org.eclipse.core.runtime.IAdaptable; 19 import org.eclipse.core.runtime.IProgressMonitor; 20 import org.eclipse.core.runtime.IStatus; 21 import org.eclipse.core.runtime.NullProgressMonitor; 22 import org.eclipse.ui.internal.ide.undo.UndoMessages; 23 24 35 public class UpdateMarkersOperation extends AbstractMarkersOperation { 36 37 private boolean mergeAttributes; 40 41 61 public UpdateMarkersOperation(IMarker marker, Map attributes, String name, 62 boolean mergeAttributes) { 63 super(new IMarker[] { marker }, null, attributes, name); 64 this.mergeAttributes = mergeAttributes; 65 } 66 67 84 public UpdateMarkersOperation(IMarker[] markers, Map attributes, 85 String name, boolean mergeAttributes) { 86 super(markers, null, attributes, name); 87 this.mergeAttributes = mergeAttributes; 88 } 89 90 98 protected void doExecute(IProgressMonitor monitor, IAdaptable info) 99 throws CoreException { 100 if (monitor == null) { 101 monitor = new NullProgressMonitor(); 102 } 103 monitor.beginTask("", 100); monitor.setTaskName(UndoMessages.MarkerOperation_UpdateProgress); 105 updateMarkers(100, monitor, mergeAttributes); 106 monitor.done(); 107 } 108 109 117 protected void doUndo(IProgressMonitor monitor, IAdaptable info) 118 throws CoreException { 119 doExecute(monitor, info); 122 } 123 124 131 protected IStatus getBasicUndoStatus() { 132 return getMarkerUpdateStatus(); 133 } 134 135 142 protected IStatus getBasicRedoStatus() { 143 return getMarkerUpdateStatus(); 144 } 145 } 146 | Popular Tags |