KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > editor > view > spi > ViewFragment


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.editor.view.spi;
21
22 import javax.swing.text.View JavaDoc;
23
24 /**
25  * Interface describing a view being fragment of some original view.
26  * <br>
27  * It provides information that the fragment usually has to know anyway
28  * but that it's not available through
29  * the {@link javax.swing.text.View} class that the fragment is instance of.
30  *
31  * <p>
32  * The instances of this interface are created once fragments
33  * of a view have to created e.g. for line-wrapping purposes.
34  * <br>
35  * If the returned fragment does not implement this interface
36  * a default wrapper gets created.
37  *
38  * @author Miloslav Metelka
39  * @version 1.00
40  */

41
42 public interface ViewFragment {
43
44     /**
45      * Return original view for which this wrapper is being created.
46      */

47     public View JavaDoc getOriginalView();
48     
49     /**
50      * Return relative starting offset against the starting offset
51      * of the original view.
52      */

53     public int getRelativeStartOffset();
54     
55     /**
56      * Return relative ending offset against the starting offset
57      * of the original view.
58      */

59     public int getRelativeEndOffset();
60
61 }
62
Popular Tags