KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > text > rtf > RTFAttribute


1 /*
2  * @(#)RTFAttribute.java 1.10 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing.text.rtf;
8
9 import javax.swing.text.AttributeSet JavaDoc;
10 import javax.swing.text.MutableAttributeSet JavaDoc;
11 import java.io.IOException JavaDoc;
12
13 /**
14  * This interface describes a class which defines a 1-1 mapping between
15  * an RTF keyword and a SwingText attribute.
16  */

17 interface RTFAttribute
18 {
19     static final int D_CHARACTER = 0;
20     static final int D_PARAGRAPH = 1;
21     static final int D_SECTION = 2;
22     static final int D_DOCUMENT = 3;
23     static final int D_META = 4;
24
25     /* These next three should really be public variables,
26        but you can't declare public variables in an interface... */

27     /* int domain; */
28     public int domain();
29     /* String swingName; */
30     public Object JavaDoc swingName();
31     /* String rtfName; */
32     public String JavaDoc rtfName();
33
34     public boolean set(MutableAttributeSet JavaDoc target);
35     public boolean set(MutableAttributeSet JavaDoc target, int parameter);
36
37     public boolean setDefault(MutableAttributeSet JavaDoc target);
38
39     /* TODO: This method is poorly thought out */
40     public boolean write(AttributeSet JavaDoc source,
41                  RTFGenerator JavaDoc target,
42              boolean force)
43         throws IOException JavaDoc;
44
45     public boolean writeValue(Object JavaDoc value,
46                   RTFGenerator JavaDoc target,
47                   boolean force)
48         throws IOException JavaDoc;
49 }
50
Popular Tags