47 |
import javax.swing.text.PlainView; |
import javax.swing.text.PlainView; |
48 |
import javax.swing.text.View; |
import javax.swing.text.View; |
49 |
|
|
50 |
|
/** |
51 |
|
* The UI class for {@link JEditorPane}s. |
52 |
|
* |
53 |
|
* @author original author unknown |
54 |
|
* @author Roman Kennke (roman@kennke.org) |
55 |
|
*/ |
56 |
public class BasicEditorPaneUI extends BasicTextUI |
public class BasicEditorPaneUI extends BasicTextUI |
57 |
{ |
{ |
58 |
|
/** |
59 |
|
* Creates an instance of <code>BasicEditorPaneUI</code> for the text |
60 |
|
* component <code>comp</code>. |
61 |
|
* |
62 |
|
* @param comp the component for which to create an UI |
63 |
|
* |
64 |
|
* @return the UI for <code>comp</code> |
65 |
|
*/ |
66 |
public static ComponentUI createUI(JComponent comp) |
public static ComponentUI createUI(JComponent comp) |
67 |
{ |
{ |
68 |
return new BasicEditorPaneUI(); |
return new BasicEditorPaneUI(); |
69 |
} |
} |
70 |
|
|
71 |
|
/** |
72 |
|
* Creates a new <code>BasicEditorPaneUI</code> |
73 |
|
*/ |
74 |
public BasicEditorPaneUI() |
public BasicEditorPaneUI() |
75 |
{ |
{ |
76 |
// Do nothing here. |
// Do nothing here. |
77 |
} |
} |
78 |
|
|
79 |
|
// FIXME: Should not be overridden here but instead be handled by the |
80 |
|
// JEditorPane's EditorKit. However, as long as we don't have styles in |
81 |
|
// place this doesn't make much sense. |
82 |
public View create(Element elem) |
public View create(Element elem) |
83 |
{ |
{ |
84 |
return new PlainView(elem); |
return new PlainView(elem); |
85 |
} |
} |
86 |
|
|
87 |
|
/** |
88 |
|
* Returns the property prefix to be used by this UI class. This is |
89 |
|
* <code>EditorPane</code> in this case. |
90 |
|
* |
91 |
|
* @return <code>EditorPane</code> |
92 |
|
*/ |
93 |
protected String getPropertyPrefix() |
protected String getPropertyPrefix() |
94 |
{ |
{ |
95 |
return "EditorPane"; |
return "EditorPane"; |