|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
javax.swing.text.StyledEditorKit
public class StyledEditorKit
An EditorKit that supports editing styled text.
| Nested Class Summary | |
|---|---|
static class |
StyledEditorKit.AlignmentAction
Sets the alignment attribute on the selected text. |
static class |
StyledEditorKit.BoldAction
Toggles the bold attribute for the selected text. |
static class |
StyledEditorKit.FontFamilyAction
Sets the font family attribute on the selected text. |
static class |
StyledEditorKit.FontSizeAction
Sets the font size attribute on the selected text. |
static class |
StyledEditorKit.ForegroundAction
Sets the foreground color attribute on the selected text. |
static class |
StyledEditorKit.ItalicAction
Toggles the italic attribute for the selected text. |
static class |
StyledEditorKit.StyledTextAction
The abstract superclass of all styled TextActions. |
static class |
StyledEditorKit.UnderlineAction
Toggles the underline attribute for the selected text. |
| Nested classes/interfaces inherited from class javax.swing.text.DefaultEditorKit |
|---|
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
StyledEditorKit()
Creates a new instance of StyledEditorKit. |
|
| Method Summary | |
|---|---|
Object |
clone()
Creates an exact copy of this StyledEditorKit. |
Document |
createDefaultDocument()
Creates the default Document supported by this
EditorKit. |
protected void |
createInputAttributes(Element element,
MutableAttributeSet set)
Copies the text attributes from element to set. |
void |
deinstall(JEditorPane component)
Deinstalls this EditorKit from the specified
JEditorPane. |
Action[] |
getActions()
Returns the Actions supported by this EditorKit. |
Element |
getCharacterAttributeRun()
Returns the Element that represents the character run at the
current caret position. |
MutableAttributeSet |
getInputAttributes()
Returns the current input attributes. |
ViewFactory |
getViewFactory()
Returns a ViewFactory that is able to create Views
for Elements that are supported by this EditorKit,
namely the following types of Elements:
AbstractDocument.ContentElementName
AbstractDocument.ParagraphElementName
AbstractDocument.SectionElementName
StyleConstants.ComponentElementName
StyleConstants.IconElementName
|
void |
install(JEditorPane component)
Installs this EditorKit on the specified 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 |
| Constructor Detail |
|---|
public StyledEditorKit()
StyledEditorKit.
| Method Detail |
|---|
public Object clone()
StyledEditorKit.
clone in class EditorKitStyledEditorKitCloneablepublic Action[] getActions()
Actions supported by this EditorKit.
This includes the StyledEditorKit.BoldAction, StyledEditorKit.ItalicAction and
StyledEditorKit.UnderlineAction as well as the Actions supported
by DefaultEditorKit.
The other Actions of StyledEditorKit are not
returned here, since they require a parameter and thus custom
instantiation.
getActions in class DefaultEditorKitActions supported by this EditorKitpublic MutableAttributeSet getInputAttributes()
public Element getCharacterAttributeRun()
Element that represents the character run at the
current caret position.
Element that represents the character run at the
current caret positionpublic Document createDefaultDocument()
Document supported by this
EditorKit. This is an instance of
DefaultStyledDocument in this case but may be overridden by
subclasses.
createDefaultDocument in class DefaultEditorKitDefaultStyledDocumentpublic void install(JEditorPane component)
EditorKit on the specified JEditorPane.
This basically involves setting up required listeners on the
JEditorPane.
install in class EditorKitcomponent - the JEditorPane to install this
EditorKit onpublic void deinstall(JEditorPane component)
EditorKit from the specified
JEditorPane. This basically involves removing all listeners from
JEditorPane that have been set up by this
EditorKit.
deinstall in class EditorKitcomponent - the JEditorPane from which to deinstall this
EditorKitpublic ViewFactory getViewFactory()
ViewFactory that is able to create Views
for Elements that are supported by this EditorKit,
namely the following types of Elements:
AbstractDocument.ContentElementNameAbstractDocument.ParagraphElementNameAbstractDocument.SectionElementNameStyleConstants.ComponentElementNameStyleConstants.IconElementName
getViewFactory in class DefaultEditorKitViewFactory that is able to create Views
for Elements that are supported by this EditorKit
protected void createInputAttributes(Element element,
MutableAttributeSet set)
element to set.
This is called everytime when the caret position changes to keep
track of the current input attributes. The attributes in set
are cleaned before adding the attributes of element.
This method filters out attributes for element names, Icons
and Components.
element - the Element from which to copy the text
attributesset - the inputAttributes to copy the attributes to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||