1 11 12 package org.eclipse.ui.ide.undo; 13 14 import org.eclipse.core.resources.IMarker; 15 import org.eclipse.core.runtime.CoreException; 16 import org.eclipse.core.runtime.IAdaptable; 17 import org.eclipse.core.runtime.IProgressMonitor; 18 import org.eclipse.core.runtime.IStatus; 19 import org.eclipse.core.runtime.NullProgressMonitor; 20 import org.eclipse.ui.internal.ide.undo.UndoMessages; 21 22 33 public class DeleteMarkersOperation extends AbstractMarkersOperation { 34 35 44 public DeleteMarkersOperation(IMarker[] markers, String name) { 45 super(markers, null, null, name); 46 } 47 48 56 protected void doExecute(IProgressMonitor monitor, IAdaptable info) 57 throws CoreException { 58 if (monitor == null) { 59 monitor = new NullProgressMonitor(); 60 } 61 monitor.beginTask("", 100); monitor.setTaskName(UndoMessages.MarkerOperation_DeleteProgress); 63 deleteMarkers(100, monitor); 64 monitor.done(); 65 } 66 67 75 protected void doUndo(IProgressMonitor monitor, IAdaptable info) 76 throws CoreException { 77 if (monitor == null) { 78 monitor = new NullProgressMonitor(); 79 } 80 monitor.beginTask("", 100); monitor.setTaskName(UndoMessages.MarkerOperation_CreateProgress); 82 createMarkers(100, monitor); 83 monitor.done(); 84 } 85 86 93 protected IStatus getBasicUndoStatus() { 94 return getMarkerCreationStatus(); 95 } 96 97 104 protected IStatus getBasicRedoStatus() { 105 return getMarkerDeletionStatus(); 106 } 107 } 108 | Popular Tags |