59 |
import javax.swing.text.EditorKit; |
import javax.swing.text.EditorKit; |
60 |
import javax.swing.text.Element; |
import javax.swing.text.Element; |
61 |
import javax.swing.text.JTextComponent; |
import javax.swing.text.JTextComponent; |
62 |
|
import javax.swing.text.View; |
63 |
|
import javax.swing.text.ViewFactory; |
64 |
|
import javax.swing.text.WrappedPlainView; |
65 |
import javax.swing.text.html.HTML; |
import javax.swing.text.html.HTML; |
66 |
import javax.swing.text.html.HTMLDocument; |
import javax.swing.text.html.HTMLDocument; |
67 |
import javax.swing.text.html.HTMLEditorKit; |
import javax.swing.text.html.HTMLEditorKit; |
168 |
{ |
{ |
169 |
|
|
170 |
/** |
/** |
171 |
|
* Creates a new JEditorPaneAccessibleHypertextSupport object. |
172 |
|
*/ |
173 |
|
public JEditorPaneAccessibleHypertextSupport() |
174 |
|
{ |
175 |
|
super(); |
176 |
|
} |
177 |
|
|
178 |
|
/** |
179 |
* The accessible representation of a HTML link. |
* The accessible representation of a HTML link. |
180 |
* |
* |
181 |
* @author Roman Kennke (kennke@aicas.com) |
* @author Roman Kennke (kennke@aicas.com) |
477 |
} |
} |
478 |
} |
} |
479 |
|
|
480 |
|
/** |
481 |
|
* An EditorKit used for plain text. This is the default editor kit for |
482 |
|
* JEditorPanes. |
483 |
|
* |
484 |
|
* @author Roman Kennke (kennke@aicas.com) |
485 |
|
*/ |
486 |
|
private static class PlainEditorKit extends DefaultEditorKit |
487 |
|
{ |
488 |
|
|
489 |
|
/** |
490 |
|
* Returns a ViewFactory that supplies WrappedPlainViews. |
491 |
|
*/ |
492 |
|
public ViewFactory getViewFactory() |
493 |
|
{ |
494 |
|
return new ViewFactory() |
495 |
|
{ |
496 |
|
public View create(Element el) |
497 |
|
{ |
498 |
|
return new WrappedPlainView(el); |
499 |
|
} |
500 |
|
}; |
501 |
|
} |
502 |
|
} |
503 |
|
|
504 |
private static final long serialVersionUID = 3140472492599046285L; |
private static final long serialVersionUID = 3140472492599046285L; |
505 |
|
|
506 |
private URL page; |
private URL page; |
532 |
|
|
533 |
protected EditorKit createDefaultEditorKit() |
protected EditorKit createDefaultEditorKit() |
534 |
{ |
{ |
535 |
return new DefaultEditorKit(); |
return new PlainEditorKit(); |
536 |
} |
} |
537 |
|
|
538 |
public static EditorKit createEditorKitForContentType(String type) |
public static EditorKit createEditorKitForContentType(String type) |
539 |
{ |
{ |
540 |
return new DefaultEditorKit(); |
return new PlainEditorKit(); |
541 |
} |
} |
542 |
|
|
543 |
/** |
/** |