Class JosmHTMLEditorKit
- java.lang.Object
-
- javax.swing.text.EditorKit
-
- javax.swing.text.DefaultEditorKit
-
- javax.swing.text.StyledEditorKit
-
- javax.swing.text.html.HTMLEditorKit
-
- org.openstreetmap.josm.gui.widgets.JosmHTMLEditorKit
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,javax.accessibility.Accessible
public class JosmHTMLEditorKit extends javax.swing.text.html.HTMLEditorKit
A subclass ofHTMLEditorKit
that fixes an uncommon design choice that shares the set stylesheet between all instances. This class stores a single stylesheet per instance, as it should have be done by Sun in the first place. Moreover it allows to display SVG images.- Since:
- 6040
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.text.html.HTMLEditorKit
javax.swing.text.html.HTMLEditorKit.HTMLFactory, javax.swing.text.html.HTMLEditorKit.HTMLTextAction, javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction, javax.swing.text.html.HTMLEditorKit.LinkController, javax.swing.text.html.HTMLEditorKit.Parser, javax.swing.text.html.HTMLEditorKit.ParserCallback
-
Nested classes/interfaces inherited from class javax.swing.text.StyledEditorKit
javax.swing.text.StyledEditorKit.AlignmentAction, javax.swing.text.StyledEditorKit.BoldAction, javax.swing.text.StyledEditorKit.FontFamilyAction, javax.swing.text.StyledEditorKit.FontSizeAction, javax.swing.text.StyledEditorKit.ForegroundAction, javax.swing.text.StyledEditorKit.ItalicAction, javax.swing.text.StyledEditorKit.StyledTextAction, javax.swing.text.StyledEditorKit.UnderlineAction
-
Nested classes/interfaces inherited from class javax.swing.text.DefaultEditorKit
javax.swing.text.DefaultEditorKit.BeepAction, javax.swing.text.DefaultEditorKit.CopyAction, javax.swing.text.DefaultEditorKit.CutAction, javax.swing.text.DefaultEditorKit.DefaultKeyTypedAction, javax.swing.text.DefaultEditorKit.InsertBreakAction, javax.swing.text.DefaultEditorKit.InsertContentAction, javax.swing.text.DefaultEditorKit.InsertTabAction, javax.swing.text.DefaultEditorKit.PasteAction
-
-
Field Summary
Fields Modifier and Type Field Description private static javax.swing.text.ViewFactory
FACTORY
Shared factory for creating HTML Views.private javax.swing.text.html.StyleSheet
ss
-
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, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, 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
Constructors Constructor Description JosmHTMLEditorKit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.text.html.StyleSheet
getStyleSheet()
Get the set of styles currently being used to render the HTML elements.javax.swing.text.ViewFactory
getViewFactory()
void
setStyleSheet(javax.swing.text.html.StyleSheet s)
Set the set of styles to be used to render the various HTML elements.-
Methods inherited from class javax.swing.text.html.HTMLEditorKit
clone, createDefaultDocument, createInputAttributes, deinstall, getAccessibleContext, getActions, getContentType, getDefaultCursor, getInputAttributes, getLinkCursor, getParser, insertHTML, install, isAutoFormSubmission, read, setAutoFormSubmission, setDefaultCursor, setLinkCursor, write
-
-
-
-
Constructor Detail
-
JosmHTMLEditorKit
public JosmHTMLEditorKit()
-
-
Method Detail
-
setStyleSheet
public void setStyleSheet(javax.swing.text.html.StyleSheet s)
Set the set of styles to be used to render the various HTML elements. These styles are specified in terms of CSS specifications. Each document produced by the kit will have a copy of the sheet which it can add the document specific styles to. Unlike the base implementation, the StyleSheet specified is NOT shared by all HTMLEditorKit instances, to provide a finer granularity.- Overrides:
setStyleSheet
in classjavax.swing.text.html.HTMLEditorKit
- See Also:
getStyleSheet()
-
getStyleSheet
public javax.swing.text.html.StyleSheet getStyleSheet()
Get the set of styles currently being used to render the HTML elements. Unlike the base implementation, the StyleSheet specified is NOT shared by all HTMLEditorKit instances, to provide a finer granularity.- Overrides:
getStyleSheet
in classjavax.swing.text.html.HTMLEditorKit
- See Also:
setStyleSheet(javax.swing.text.html.StyleSheet)
-
getViewFactory
public javax.swing.text.ViewFactory getViewFactory()
- Overrides:
getViewFactory
in classjavax.swing.text.html.HTMLEditorKit
-
-