KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > markers > WorkbenchMarkerResolution


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.views.markers;
13
14 import org.eclipse.core.resources.IMarker;
15 import org.eclipse.core.runtime.IProgressMonitor;
16 import org.eclipse.ui.IMarkerResolution2;
17 import org.eclipse.ui.views.markers.internal.Util;
18
19 /**
20  * WorkbenchMarkerResolution is the resolution that can be grouped
21  * with others that are similar to allow multi selection.
22  * @since 3.2
23  *
24  */

25 public abstract class WorkbenchMarkerResolution implements IMarkerResolution2 {
26     
27     /**
28      * Iterate through the list of supplied markers. Return any that can also have
29      * the receiver applied to them.
30      * @param markers
31      * @return IMarker[]
32      *
33      * */

34     public abstract IMarker[] findOtherMarkers(IMarker[] markers);
35
36     /**
37      * Runs this resolution. Resolve all <code>markers</code>.
38      * <code>markers</code> must be a subset of the markers returned
39      * by <code>findOtherMarkers(IMarker[])</code>.
40      *
41      * @param markers The markers to resolve, not null
42      * @param monitor The monitor to report progress
43      */

44     public void run(IMarker[] markers, IProgressMonitor monitor) {
45         
46         for (int i = 0; i < markers.length; i++) {
47             monitor.subTask(Util.getProperty(IMarker.MESSAGE, markers[i]));
48             run(markers[i]);
49         }
50     }
51 }
52
Popular Tags