< prev index next >

src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java

Print this page




 594         if (o != null) {
 595             o.input = null;
 596             o.linkHandler = new LinkController();
 597         }
 598         return o;
 599     }
 600 
 601     /**
 602      * Fetch the parser to use for reading HTML streams.
 603      * This can be reimplemented to provide a different
 604      * parser.  The default implementation is loaded dynamically
 605      * to avoid the overhead of loading the default parser if
 606      * it's not used.  The default parser is the HotJava parser
 607      * using an HTML 3.2 DTD.
 608      *
 609      * @return the parser
 610      */
 611     protected Parser getParser() {
 612         if (defaultParser == null) {
 613             try {
 614                 Class<?> c = Class.forName("javax.swing.text.html.parser.ParserDelegator");
 615                 defaultParser = (Parser) c.newInstance();

 616             } catch (Throwable e) {
 617             }
 618         }
 619         return defaultParser;
 620     }
 621 
 622     // ----- Accessibility support -----
 623     private AccessibleContext accessibleContext;
 624 
 625     /**
 626      * returns the AccessibleContext associated with this editor kit
 627      *
 628      * @return the AccessibleContext associated with this editor kit
 629      * @since 1.4
 630      */
 631     public AccessibleContext getAccessibleContext() {
 632         if (theEditor == null) {
 633             return null;
 634         }
 635         if (accessibleContext == null) {




 594         if (o != null) {
 595             o.input = null;
 596             o.linkHandler = new LinkController();
 597         }
 598         return o;
 599     }
 600 
 601     /**
 602      * Fetch the parser to use for reading HTML streams.
 603      * This can be reimplemented to provide a different
 604      * parser.  The default implementation is loaded dynamically
 605      * to avoid the overhead of loading the default parser if
 606      * it's not used.  The default parser is the HotJava parser
 607      * using an HTML 3.2 DTD.
 608      *
 609      * @return the parser
 610      */
 611     protected Parser getParser() {
 612         if (defaultParser == null) {
 613             try {
 614                 @SuppressWarnings("deprecation")
 615                 Object o = Class.forName("javax.swing.text.html.parser.ParserDelegator").newInstance();
 616                 defaultParser = (Parser) o;
 617             } catch (Throwable e) {
 618             }
 619         }
 620         return defaultParser;
 621     }
 622 
 623     // ----- Accessibility support -----
 624     private AccessibleContext accessibleContext;
 625 
 626     /**
 627      * returns the AccessibleContext associated with this editor kit
 628      *
 629      * @return the AccessibleContext associated with this editor kit
 630      * @since 1.4
 631      */
 632     public AccessibleContext getAccessibleContext() {
 633         if (theEditor == null) {
 634             return null;
 635         }
 636         if (accessibleContext == null) {


< prev index next >