jwo.utils.gui.html
Class ImprovedHTMLEditorKit

java.lang.Object
  extended byjavax.swing.text.EditorKit
      extended byjavax.swing.text.DefaultEditorKit
          extended byjavax.swing.text.StyledEditorKit
              extended byjavax.swing.text.html.HTMLEditorKit
                  extended byjwo.utils.gui.html.ImprovedHTMLEditorKit
All Implemented Interfaces:
Accessible, Cloneable, Serializable

public class ImprovedHTMLEditorKit
extends HTMLEditorKit

HTML editor kit to replace the default one used by JEditorPane. This one adopts a more sophisticated mechanism for looking for relative image links. Based on the JavaWorld Tip 109.

Version:
2.1, 18th July, 2003
Author:
Rob Kenworthy, modified by Jo Wood.
See Also:
Serialized Form

Nested Class Summary
static class ImprovedHTMLEditorKit.HTMLFactoryX
          A customised view factory that contains an image viewer that can cope with relative links.
 
Nested classes inherited from class javax.swing.text.html.HTMLEditorKit
HTMLEditorKit.HTMLFactory, HTMLEditorKit.HTMLTextAction, HTMLEditorKit.InsertHTMLTextAction, HTMLEditorKit.LinkController, HTMLEditorKit.Parser, HTMLEditorKit.ParserCallback
 
Nested classes inherited from class javax.swing.text.StyledEditorKit
StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineAction
 
Nested classes 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
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit
BOLD_ACTION, COLOR_ACTION, DEFAULT_CSS, FONT_CHANGE_BIGGER, FONT_CHANGE_SMALLER, IMG_ALIGN_BOTTOM, IMG_ALIGN_MIDDLE, IMG_ALIGN_TOP, IMG_BORDER, ITALIC_ACTION, LOGICAL_STYLE_ACTION, PARA_INDENT_LEFT, PARA_INDENT_RIGHT
 
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deletePrevCharAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
 
Constructor Summary
ImprovedHTMLEditorKit()
           
 
Method Summary
 ViewFactory getViewFactory()
          Overrides the default view factory by returning a customised HTML view factory that looks for relative links.
 void setNewStyleSheet(String css)
          Sets the style sheet of the editor kit to the given css file.
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit
clone, createDefaultDocument, createInputAttributes, deinstall, getAccessibleContext, getActions, getContentType, getDefaultCursor, getInputAttributes, getLinkCursor, getParser, getStyleSheet, insertHTML, install, read, setDefaultCursor, setLinkCursor, setStyleSheet, write
 
Methods inherited from class javax.swing.text.StyledEditorKit
getCharacterAttributeRun
 
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, read, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImprovedHTMLEditorKit

public ImprovedHTMLEditorKit()
Method Detail

getViewFactory

public ViewFactory getViewFactory()
Overrides the default view factory by returning a customised HTML view factory that looks for relative links.

Returns:
An HTML view factory.

setNewStyleSheet

public void setNewStyleSheet(String css)
Sets the style sheet of the editor kit to the given css file. This file should be relative to the directory identified by system.css.path.key or identified as an absolute URL.

Parameters:
css - Css file to use for update.


Copyright Jo Wood, 1996-2004, last modified, 3rd September, 2004