KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > api > editor > settings > FontColorSettings


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.api.editor.settings;
21
22 import javax.swing.text.AttributeSet JavaDoc;
23
24 /**
25  * The map of coloring names and their parameters.
26  *
27  * <p>The term coloring refers to a set attributes that can be used for rendering
28  * text in an editor window. These attributes may be but are not limited to a
29  * font, foreground and background color, etc.
30  *
31  * <p>The coloring names are defined by modules. Each coloring is represented by
32  * <code>AttributeSet</code>, which contains keys and values for all the attributes
33  * that should be used for rendering text that was colorified by the coloring.
34  * The keys that can be used to obtain particular attributes are defined in the
35  * {@link javax.swing.text.StyleConstants} and
36  * {@link org.netbeans.api.editor.settings.EditorStyleConstants} classes.
37  *
38  * <p>Supported keys for FontColorSettings are:
39  * <ol>
40  * <li> StyleConstants.FontFamily </li>
41  * <li> StyleConstants.FontSize </li>
42  * <li> StyleConstants.Bold </li>
43  * <li> StyleConstants.Italic </li>
44  * <li> StyleConstants.Foreground </li>
45  * <li> StyleConstants.Background </li>
46  * <li> StyleConstants.Underline </li>
47  * <li> StyleConstants.StrikeThrough </li>
48  * <li> and all attributes defined in {@link org.netbeans.api.editor.settings.EditorStyleConstants} </li>
49  * </ol>
50  *
51  * <p>Instances of this class should be retrieved from <code>MimeLookup</code>.
52  *
53  * <p><font color="red">This class must NOT be extended by any API clients.</font>
54  *
55  * @author Martin Roskanin
56  */

57 public abstract class FontColorSettings {
58
59     /**
60      * @deprecated This should have never been made public. Nobody can listen on this property.
61      */

62     public static final String JavaDoc PROP_FONT_COLORS = "fontColors"; //NOI18N
63

64     /**
65      * Construction prohibited for API clients.
66      */

67     public FontColorSettings() {
68         // Control instantiation of the allowed subclass only
69
if (!getClass().getName().startsWith("org.netbeans.modules.editor.settings.storage")) { // NOI18N
70
throw new IllegalStateException JavaDoc("Instantiation prohibited. " + getClass().getName()); // NOI18N
71
}
72     }
73     
74     /**
75      * Gets the font and colors.
76      *
77      * @param settingName font and colors setting name
78      *
79      * @return AttributeSet describing the font and colors.
80      */

81     public abstract AttributeSet JavaDoc getFontColors(String JavaDoc settingName);
82
83     /**
84      * Gets the token font and colors.
85      *
86      * @param tokenName token name
87      *
88      * @return AttributeSet describing the font and colors
89      */

90     public abstract AttributeSet JavaDoc getTokenFontColors(String JavaDoc tokenName);
91     
92 }
93
Popular Tags