01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.markers;
11:
12: import org.eclipse.core.resources.IMarker;
13: import org.eclipse.core.runtime.IProgressMonitor;
14: import org.eclipse.ui.IMarkerResolution2;
15: import org.eclipse.ui.views.markers.internal.Util;
16:
17: /**
18: * WorkbenchMarkerResolution is the resolution that can be grouped
19: * with others that are similar to allow multi selection.
20: * @since 3.2
21: *
22: */
23: public abstract class WorkbenchMarkerResolution implements
24: IMarkerResolution2 {
25:
26: /**
27: * Iterate through the list of supplied markers. Return any that can also have
28: * the receiver applied to them.
29: * @param markers
30: * @return IMarker[]
31: *
32: * */
33: public abstract IMarker[] findOtherMarkers(IMarker[] markers);
34:
35: /**
36: * Runs this resolution. Resolve all <code>markers</code>.
37: * <code>markers</code> must be a subset of the markers returned
38: * by <code>findOtherMarkers(IMarker[])</code>.
39: *
40: * @param markers The markers to resolve, not null
41: * @param monitor The monitor to report progress
42: */
43: public void run(IMarker[] markers, IProgressMonitor monitor) {
44:
45: for (int i = 0; i < markers.length; i++) {
46: monitor.subTask(Util.getProperty(IMarker.MESSAGE,
47: markers[i]));
48: run(markers[i]);
49: }
50: }
51: }
|