source: josm/trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLEditorKit.java@ 8415

Last change on this file since 8415 was 8415, checked in by Don-vip, 9 years ago

code style/cleanup - Uncommented Empty Constructor

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.widgets;
3
4import javax.swing.text.html.HTMLEditorKit;
5import javax.swing.text.html.StyleSheet;
6
7/**
8 * A subclass of {@link HTMLEditorKit} that fixes an uncommon design choice that shares the set stylesheet between all instances.
9 * This class stores a single stylesheet per instance, as it should have be done by Sun in the first place.
10 * @since 6040
11 */
12public class JosmHTMLEditorKit extends HTMLEditorKit {
13
14 protected StyleSheet ss = super.getStyleSheet();
15
16 /**
17 * Set the set of styles to be used to render the various HTML elements.
18 * These styles are specified in terms of CSS specifications.
19 * Each document produced by the kit will have a copy of the sheet which
20 * it can add the document specific styles to.
21 *
22 * Unlike the base implementation, the StyleSheet specified is NOT shared
23 * by all HTMLEditorKit instances, to provide a finer granularity.
24
25 * @see #getStyleSheet
26 */
27 @Override
28 public void setStyleSheet(StyleSheet s) {
29 ss = s;
30 }
31
32 /**
33 * Get the set of styles currently being used to render the HTML elements.
34 *
35 * Unlike the base implementation, the StyleSheet specified is NOT shared
36 * by all HTMLEditorKit instances, to provide a finer granularity.
37 *
38 * @see #setStyleSheet
39 */
40 @Override
41 public StyleSheet getStyleSheet() {
42 return ss;
43 }
44}
Note: See TracBrowser for help on using the repository browser.