KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > IMarkerUpdater


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 package org.eclipse.ui.texteditor;
12
13 import org.eclipse.jface.text.IDocument;
14 import org.eclipse.jface.text.Position;
15
16 import org.eclipse.core.resources.IMarker;
17
18
19 /**
20  * A marker updater is responsible for saving changes to markers.
21  * Marker updaters either update markers of a specific types or
22  * any type. Also they either assume update responsibility for a
23  * specific set of marker attributes or any marker attribute.
24  * Marker updater must be registered with an
25  * {@link org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel}.
26  */

27 public interface IMarkerUpdater {
28
29     /**
30      * Returns the marker type for which this updater is responsible. If
31      * the result is <code>null</code>, the updater assumes responsibility
32      * for any marker type.
33      *
34      * @return the marker type or <code>null</code> for any marker type
35      */

36     String JavaDoc getMarkerType();
37
38     /**
39      * Returns the attributes for which this updater is responsible. If the
40      * result is <code>null</code>, the updater assumes responsibility for
41      * any attributes.
42      *
43      * @return the attributes or <code>null</code> for any attribute
44      */

45     String JavaDoc[] getAttribute();
46
47     /**
48      * Updates the given marker according to the position of the given document.
49      * If the given position is <code>null</code>, the marker is assumed to
50      * carry the correct positional information.
51      *
52      * @param marker the marker to be updated
53      * @param document the document into which the given position points
54      * @param position the current position of the marker inside the given document
55      * @return <code>false</code> if the updater recognizes that the marker should be deleted
56      */

57     boolean updateMarker(IMarker marker, IDocument document, Position position);
58 }
59
Popular Tags