|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.EditorKit javax.swing.text.DefaultEditorKit javax.swing.text.StyledEditorKit
This is the set of things needed by a text component to be a reasonably functioning editor for some type of text document. This implementation provides a default implementation which treats text as styled text and provides a minimal set of actions for editing styled text.
Nested Class Summary | |
static class |
StyledEditorKit.AlignmentAction
An action to set paragraph alignment. |
(package private) class |
StyledEditorKit.AttributeTracker
Tracks caret movement and keeps the input attributes set to reflect the current set of attribute definitions at the caret position. |
static class |
StyledEditorKit.BoldAction
An action to toggle the bold attribute. |
static class |
StyledEditorKit.FontFamilyAction
An action to set the font family in the associated JEditorPane. |
static class |
StyledEditorKit.FontSizeAction
An action to set the font size in the associated JEditorPane. |
static class |
StyledEditorKit.ForegroundAction
An action to set foreground color. |
static class |
StyledEditorKit.ItalicAction
An action to toggle the italic attribute. |
(package private) static class |
StyledEditorKit.StyledInsertBreakAction
StyledInsertBreakAction has similar behavior to that of DefaultEditorKit.InsertBreakAction . |
static class |
StyledEditorKit.StyledTextAction
An action that assumes it's being fired on a JEditorPane with a StyledEditorKit (or subclass) installed. |
(package private) static class |
StyledEditorKit.StyledViewFactory
|
static class |
StyledEditorKit.UnderlineAction
An action to toggle the underline attribute. |
Field Summary | |
(package private) Element |
currentParagraph
|
(package private) Element |
currentRun
|
private static Action[] |
defaultActions
|
private static ViewFactory |
defaultFactory
|
(package private) MutableAttributeSet |
inputAttributes
This is the set of attributes used to store the input attributes. |
private StyledEditorKit.AttributeTracker |
inputAttributeUpdater
This listener will be attached to the caret of the text component that the EditorKit gets installed into. |
Constructor Summary | |
StyledEditorKit()
Creates a new EditorKit used for styled documents. |
Method Summary | |
Object |
clone()
Creates a copy of the editor kit. |
Document |
createDefaultDocument()
Creates an uninitialized text storage model that is appropriate for this type of editor. |
private void |
createInputAttributes()
Creates the AttributeSet used for the selection. |
protected void |
createInputAttributes(Element element,
MutableAttributeSet set)
Copies the key/values in element s AttributeSet into
set . |
private void |
createInputAttributeUpdated()
Creates a new AttributeTracker . |
void |
deinstall(JEditorPane c)
Called when the kit is being removed from the JEditorPane. |
Action[] |
getActions()
Fetches the command list for the editor. |
Element |
getCharacterAttributeRun()
Fetches the element representing the current run of character attributes for the caret. |
MutableAttributeSet |
getInputAttributes()
Gets the input attributes for the pane. |
ViewFactory |
getViewFactory()
Fetches a factory that is suitable for producing views of any models that are produced by this kit. |
void |
install(JEditorPane c)
Called when the kit is being installed into a JEditorPane. |
Methods inherited from class javax.swing.text.DefaultEditorKit |
createCaret, getContentType, read, read, write, write |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final ViewFactory defaultFactory
Element currentRun
Element currentParagraph
MutableAttributeSet inputAttributes
private StyledEditorKit.AttributeTracker inputAttributeUpdater
private static final Action[] defaultActions
Constructor Detail |
public StyledEditorKit()
Method Detail |
public MutableAttributeSet getInputAttributes()
getInputAttributes
in class DefaultEditorKit
public Element getCharacterAttributeRun()
public Action[] getActions()
getActions
in class DefaultEditorKit
public Document createDefaultDocument()
createDefaultDocument
in class DefaultEditorKit
public void install(JEditorPane c)
install
in class EditorKit
c
- the JEditorPanepublic void deinstall(JEditorPane c)
deinstall
in class EditorKit
c
- the JEditorPanepublic ViewFactory getViewFactory()
getViewFactory
in class DefaultEditorKit
public Object clone()
clone
in class EditorKit
private void createInputAttributes()
private void createInputAttributeUpdated()
AttributeTracker
.
protected void createInputAttributes(Element element, MutableAttributeSet set)
element
s AttributeSet into
set
. This does not copy component, icon, or element
names attributes. Subclasses may wish to refine what is and what
isn't copied here. But be sure to first remove all the attributes that
are in set
.This is called anytime the caret moves over a different location.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |