|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.editor.BasicStyleMap
A BasicStyleMap keeps track of basic style names used by scanner implementations.
Each EditorDocument has an associated BasicStyleMap and matching Scanner. The Scanner fills in the EditorDocument.RunInfo structure, using constants from the BasicStyleMap (or subclass) to refer to particular Styles. When rendering the document, the EditorView uses the BasicStyleMap associated with the document to resolve the Style references into actual styles.
This class does not actually store the information for the styles it references; instead, they should be stored in the StyleContext retrieved from the EditorManager.
AbstractScanner
,
EditorDocument
,
EditorView
,
Scanner
,
EditorManager
Field Summary | |
static int |
CARET
The Caret style index |
static java.lang.String |
CARET_KEY
Internal name of the Caret element. |
static int |
COMMENT
The comment style index |
protected javax.swing.text.StyleContext |
context
If context is null, the shared styleContext from the EditorManager is used to retrieve styles, otherwise this member is used. |
static int |
DIFFADDITION
The diff color that indicates an addition |
static int |
DIFFDELETION
The diff color that indicates a deletion |
static int |
EXTRA_KEYWORD
The extended keyword style index |
static int |
IDENTIFIER
The identifier style index |
static int |
ILLEGAL
The illegal element style index |
static int |
INPUT_METHOD
The input method style index |
static java.lang.String |
INPUT_METHOD_KEY
Internal name of the input method element. |
static int |
MERGECONFLICT
The merge conflict style index |
static int |
NUMBER
The number style index |
static int |
PLAIN
The plain text style index |
static int |
PREPROCESSOR
The preprocessor element style index |
static int |
RESERVED_WORD
The reserved word style index |
static int |
SELECTION
The selected text style index |
static java.lang.String |
SELECTION_KEY
Internal name of the selection element. |
static int |
STRING
The string style index |
static int |
SYMBOL
The symbol style index |
static int |
TOTAL_BASIC_STYLES
How many basic style elements are defined. |
static int |
WHITESPACE
The white space style index |
static java.lang.String |
WHITESPACE_KEY
Internal name of the white space element. |
Constructor Summary | |
BasicStyleMap()
The default constructor will leave member 'context' null, which causes the context to be retrieved from the EditorManager. |
|
BasicStyleMap(javax.swing.text.StyleContext context)
Create a new instance, using the specified context to resolve Styles. |
Method Summary | |
static java.lang.String[] |
getElement(int index)
Return the style name and attribute string of a member of the style element map. |
java.awt.Font |
getFont(javax.swing.text.AttributeSet attr)
Get the Font for a particular AttributeSet (Style). |
javax.swing.text.Style |
getStyle(int styleType)
Get a particular style by integer reference. |
static void |
initOpenTool(byte majorVersion,
byte minorVersion)
Initialize the default BasicStyleMap by registering all of the styles we know about and storing them in the 'context' retrieved from the EditorManager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.text.StyleContext context
public static final int CARET
public static final int SELECTION
public static final int INPUT_METHOD
public static final int PLAIN
public static final int WHITESPACE
public static final int COMMENT
public static final int RESERVED_WORD
public static final int IDENTIFIER
public static final int SYMBOL
public static final int STRING
public static final int NUMBER
public static final int EXTRA_KEYWORD
public static final int ILLEGAL
public static final int PREPROCESSOR
public static final int MERGECONFLICT
public static final int DIFFADDITION
public static final int DIFFDELETION
public static final int TOTAL_BASIC_STYLES
public static final java.lang.String CARET_KEY
public static final java.lang.String SELECTION_KEY
public static final java.lang.String INPUT_METHOD_KEY
public static final java.lang.String WHITESPACE_KEY
Constructor Detail |
public BasicStyleMap()
public BasicStyleMap(javax.swing.text.StyleContext context)
Method Detail |
public static void initOpenTool(byte majorVersion, byte minorVersion)
EditorManager.getStyleContext()
public static java.lang.String[] getElement(int index)
index
- The relevant element in the range 0 - (TOTAL_BASIC_STYLES-1)public javax.swing.text.Style getStyle(int styleType)
styleType
- Style index in the range 0 - (TOTAL_BASIC_STYLES-1)public java.awt.Font getFont(javax.swing.text.AttributeSet attr)
attr
- The AttributeSet (Style) to get the font for.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |