APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicEditorPaneUI

extends BasicTextUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.basic.BasicTextPaneUI, javax.swing.plaf.synth.SynthEditorPaneUI, com.sun.java.swing.plaf.motif.MotifEditorPaneUI
Annotations
@SuppressWarnings:serial
Imports
java.awt.*, java.awt.event.*, java.beans.*, java.net.URL, .MalformedURLException, javax.swing.*, javax.swing.text.*, javax.swing.text.html.*, javax.swing.plaf.*, javax.swing.border.*

Provides the look and feel for a JEditorPane.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Timothy Prinzing

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final String
FONT_ATTRIBUTE_KEY

Attribute key to reference the default font.

Inherited from javax.swing.plaf.basic.BasicTextUI:
editorpaintedrootViewupdateHandler

Constructor Summary

AccessConstructor and Description
public
BasicEditorPaneUI()

Creates a new BasicEditorPaneUI.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addActions(ActionMap map, Action[] actions)

pack-priv void
public static ComponentUI

Returns:

the UI
createUI
(JComponent
the JTextPane component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Creates a UI for the JTextPane.

pack-priv ActionMap
getActionMap()

Overrides javax.swing.plaf.basic.BasicTextUI.getActionMap.

Fetch an action map to use.

public EditorKit

Returns:

the editor capabilities
getEditorKit
(JTextComponent tc)

Overrides javax.swing.plaf.basic.BasicTextUI.getEditorKit.

Fetches the EditorKit for the UI.

protected String

Returns:

the name ("EditorPane")
getPropertyPrefix
()

Implements abstract javax.swing.plaf.basic.BasicTextUI.getPropertyPrefix.

Fetches the name used as a key to lookup properties through the UIManager.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicTextUI.installUI.

Installs the UI for a component.

protected void
propertyChange(PropertyChangeEvent
the property change event
evt
)

Overrides javax.swing.plaf.basic.BasicTextUI.propertyChange.

This method gets called when a bound property is changed on the associated JTextComponent.

pack-priv void
removeActions(ActionMap map, Action[] actions)

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicTextUI.uninstallUI.

Deinstalls the UI for a component.

private void
updateCSS(Font font, Color fg)

pack-priv void
private void
updateFont(Font
the new font to use or null to remove the font attribute from the document's style
font
)

Update the font in the default style of the document.

private void
updateForeground(Color
the new color to use or null to remove the color attribute from the document's style
color
)

Update the color in the default style of the document.

private void
Inherited from javax.swing.plaf.basic.BasicTextUI:
createcreatecreateActionMapcreateCaretcreateHighlightercreateKeymapdamageRangedamageRangegetComponentgetInputMapgetKeymapNamegetMaximumSizegetMinimumSizegetNextVisualPositionFromgetPreferredSizegetRootViewgetToolTipTextgetTransferHandlergetVisibleEditorRectinstallDefaultsinstallKeyboardActionsinstallListenersmodelChangedmodelToViewmodelToViewmodelToView2DpaintpaintBackgroundpaintSafelysetViewuninstallDefaultsuninstallKeyboardActionsuninstallListenersupdateupdateFocusAcceleratorBindingupdateFocusTraversalKeysviewToModelviewToModelviewToModel2D

Field Detail

FONT_ATTRIBUTE_KEYback to summary
private static final String FONT_ATTRIBUTE_KEY

Attribute key to reference the default font. used in javax.swing.text.StyleContext.getFont to resolve the default font.

Constructor Detail

BasicEditorPaneUIback to summary
public BasicEditorPaneUI()

Creates a new BasicEditorPaneUI.

Method Detail

addActionsback to summary
pack-priv void addActions(ActionMap map, Action[] actions)
cleanDisplayPropertiesback to summary
pack-priv void cleanDisplayProperties()
createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Creates a UI for the JTextPane.

Parameters
c:JComponent

the JTextPane component

Returns:ComponentUI

the UI

getActionMapback to summary
pack-priv ActionMap getActionMap()

Overrides javax.swing.plaf.basic.BasicTextUI.getActionMap.

Fetch an action map to use. The map for a JEditorPane is not shared because it changes with the EditorKit.

getEditorKitback to summary
public EditorKit getEditorKit(JTextComponent tc)

Overrides javax.swing.plaf.basic.BasicTextUI.getEditorKit.

Fetches the EditorKit for the UI. This is whatever is currently set in the associated JEditorPane.

Returns:EditorKit

the editor capabilities

See Also
TextUI#getEditorKit
getPropertyPrefixback to summary
protected String getPropertyPrefix()

Implements abstract javax.swing.plaf.basic.BasicTextUI.getPropertyPrefix.

Fetches the name used as a key to lookup properties through the UIManager. This is used as a prefix to all the standard text properties.

Returns:String

the name ("EditorPane")

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicTextUI.installUI.

Doc from javax.swing.plaf.basic.BasicTextUI.installUI.

Installs the UI for a component. This does the following things.

  1. Sets the associated component to opaque if the opaque property has not already been set by the client program. This will cause the component's background color to be painted.
  2. Installs the default caret and highlighter into the associated component. These properties are only set if their current value is either null or an instance of UIResource.
  3. Attaches to the editor and model. If there is no model, a default one is created.
  4. Creates the view factory and the view hierarchy used to represent the model.
Since
1.5
propertyChangeback to summary
protected void propertyChange(PropertyChangeEvent evt)

Overrides javax.swing.plaf.basic.BasicTextUI.propertyChange.

This method gets called when a bound property is changed on the associated JTextComponent. This is a hook which UI implementations may change to reflect how the UI displays bound properties of JTextComponent subclasses. This is implemented to rebuild the ActionMap based upon an EditorKit change.

Parameters
evt:PropertyChangeEvent

the property change event

removeActionsback to summary
pack-priv void removeActions(ActionMap map, Action[] actions)
uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicTextUI.uninstallUI.

Doc from javax.swing.plaf.basic.BasicTextUI.uninstallUI.

Deinstalls the UI for a component. This removes the listeners, uninstalls the highlighter, removes views, and nulls out the keymap.

Since
1.5
updateCSSback to summary
private void updateCSS(Font font, Color fg)
updateDisplayPropertiesback to summary
pack-priv void updateDisplayProperties(Font font, Color fg)
updateFontback to summary
private void updateFont(Font font)

Update the font in the default style of the document.

Parameters
font:Font

the new font to use or null to remove the font attribute from the document's style

updateForegroundback to summary
private void updateForeground(Color color)

Update the color in the default style of the document.

Parameters
color:Color

the new color to use or null to remove the color attribute from the document's style

updateStyleback to summary
private void updateStyle(Font font, Color fg)
javax.swing.plaf.basic back to summary

pack-priv Class BasicEditorPaneUI.StyleSheetUIResource

extends StyleSheet
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from javax.swing.text.html.StyleSheet:
addAttributeaddAttributesaddCSSAttributeaddCSSAttributeFromHTMLaddRuleaddStyleSheetcreateLargeAttributeSetcreateSmallAttributeSetgetBackgroundgetBasegetBoxPaintergetDeclarationgetFontgetForegroundgetIndexOfSizegetListPaintergetPointSizegetPointSizegetRulegetRulegetStyleSheetsgetViewAttributesimportStyleSheetloadRulesremoveAttributeremoveAttributesremoveAttributesremoveStyleremoveStyleSheetsetBasesetBaseFontSizesetBaseFontSizestringToColortranslateHTMLToCSS

Constructor Detail

StyleSheetUIResourceback to summary
pack-priv StyleSheetUIResource()