home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / JEditorPane$PlainEditorKit.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  41 lines

  1. package javax.swing;
  2.  
  3. import javax.swing.text.BoxView;
  4. import javax.swing.text.DefaultEditorKit;
  5. import javax.swing.text.Document;
  6. import javax.swing.text.Element;
  7. import javax.swing.text.View;
  8. import javax.swing.text.ViewFactory;
  9. import javax.swing.text.WrappedPlainView;
  10.  
  11. class JEditorPane$PlainEditorKit extends DefaultEditorKit implements ViewFactory {
  12.    public Object clone() {
  13.       return new JEditorPane$PlainEditorKit();
  14.    }
  15.  
  16.    public ViewFactory getViewFactory() {
  17.       return this;
  18.    }
  19.  
  20.    public View create(Element var1) {
  21.       Document var2 = var1.getDocument();
  22.       Object var3 = var2.getProperty("i18n");
  23.       return (View)(var3 != null && var3.equals(Boolean.TRUE) ? this.createI18N(var1) : new WrappedPlainView(var1));
  24.    }
  25.  
  26.    View createI18N(Element var1) {
  27.       String var2 = var1.getName();
  28.       if (var2 != null) {
  29.          if (var2.equals("content")) {
  30.             return new JEditorPane.PlainEditorKit.PlainParagraph(var1);
  31.          }
  32.  
  33.          if (var2.equals("paragraph")) {
  34.             return new BoxView(var1, 1);
  35.          }
  36.       }
  37.  
  38.       return null;
  39.    }
  40. }
  41.