javax.swing.text
Class StyledEditorKit
- Cloneable, Serializable
An
EditorKit
that supports editing styled text.
EndOfLineStringProperty , backwardAction , beepAction , beginAction , beginLineAction , beginParagraphAction , beginWordAction , copyAction , cutAction , defaultKeyTypedAction , deleteNextCharAction , deletePrevCharAction , downAction , endAction , endLineAction , endParagraphAction , endWordAction , forwardAction , insertBreakAction , insertContentAction , insertTabAction , nextWordAction , pageDownAction , pageUpAction , pasteAction , previousWordAction , readOnlyAction , selectAllAction , selectLineAction , selectParagraphAction , selectWordAction , selectionBackwardAction , selectionBeginAction , selectionBeginLineAction , selectionBeginParagraphAction , selectionBeginWordAction , selectionDownAction , selectionEndAction , selectionEndLineAction , selectionEndParagraphAction , selectionEndWordAction , selectionForwardAction , selectionNextWordAction , selectionPreviousWordAction , selectionUpAction , upAction , writableAction |
clone , createCaret , createDefaultDocument , deinstall , getActions , getContentType , getViewFactory , install , read , read , write , write |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
StyledEditorKit
public StyledEditorKit()
Creates a new instance of StyledEditorKit
.
clone
public Object clone()
Creates an exact copy of this StyledEditorKit
.
- clone in interface EditorKit
- an exact copy of this
StyledEditorKit
createInputAttributes
protected void createInputAttributes(Element element,
MutableAttributeSet set)
Copies the text attributes from 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, Icon
s
and Component
s.
element
- the Element
from which to copy the text
attributesset
- the inputAttributes to copy the attributes to
deinstall
public void deinstall(JEditorPane component)
Deinstalls this
EditorKit
from the specified
JEditorPane
. This basically involves removing all listeners from
JEditorPane
that have been set up by this
EditorKit
.
- deinstall in interface EditorKit
component
- the JEditorPane
from which to deinstall this
EditorKit
getCharacterAttributeRun
public Element getCharacterAttributeRun()
Returns the
Element
that represents the character run at the
current caret position.
- the
Element
that represents the character run at the
current caret position
getInputAttributes
public MutableAttributeSet getInputAttributes()
Returns the current input attributes. These are automatically set on
any newly inserted content, if not specified otherwise.
- the current input attributes
install
public void install(JEditorPane component)
Installs this
EditorKit
on the specified
JEditorPane
.
This basically involves setting up required listeners on the
JEditorPane
.
- install in interface EditorKit
component
- the JEditorPane
to install this
EditorKit
on
StyledEditorKit.java --
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.