Example #1
0
 // DefaultEditorKit does not provide a view factory. The private
 // class JEditorPane.PlainEditorKit does the exact same thing.
 public ViewFactory getViewFactory() {
   ViewFactory ret = delegate.getViewFactory();
   if (ret != null) {
     if (Settings.debug) System.err.println("Delegating getViewFactory: " + ret);
     return ret;
   } else {
     if (Settings.debug) System.err.println("Providing own view factory");
     return new ViewFactory() {
       public View create(Element elem) {
         return new WrappedPlainView(elem);
       }
     };
   }
 }
Example #2
0
 // Here's where the font is set on the editor pane, and we also keep
 // track of the panes in use for future font updates.
 public void install(JEditorPane pane) {
   if (Settings.debug) System.err.println("Installing kit into pane");
   delegate.install(pane);
   panes.add(pane);
   pane.setFont(Settings.font);
 }
Example #3
0
 public void write(Writer wr, Document doc, int pos, int length)
     throws IOException, BadLocationException {
   if (Settings.debug) System.err.println("Delegating write to Writer");
   delegate.write(wr, doc, pos, length);
 }
Example #4
0
 public void write(OutputStream os, Document doc, int pos, int length)
     throws IOException, BadLocationException {
   if (Settings.debug) System.err.println("Delegating write to OutputStream");
   delegate.write(os, doc, pos, length);
 }
Example #5
0
 public void read(Reader rd, Document doc, int pos) throws IOException, BadLocationException {
   if (Settings.debug) System.err.println("Delegating read from Reader");
   delegate.read(rd, doc, pos);
 }
Example #6
0
 public void read(InputStream is, Document doc, int pos) throws IOException, BadLocationException {
   if (Settings.debug) System.err.println("Delegating read from InputStream");
   delegate.read(is, doc, pos);
 }
Example #7
0
 public Document createDefaultDocument() {
   Document ret = delegate.createDefaultDocument();
   if (Settings.debug) System.err.println("Delegating createDefaultDocument: " + ret);
   return ret;
 }
Example #8
0
 public Caret createCaret() {
   if (Settings.debug) System.err.println("Delegating createCaret");
   return delegate.createCaret();
 }
Example #9
0
 public Action[] getActions() {
   if (Settings.debug) System.err.println("Delegating getActions");
   return delegate.getActions();
 }
Example #10
0
 // Delegated methods:
 public String getContentType() {
   String ret = delegate.getContentType();
   if (Settings.debug) System.err.println("Delegating getContentType: " + ret);
   return ret;
 }
Example #11
0
 public void deinstall(JEditorPane pane) {
   if (Settings.debug) System.err.println("Deinstalling kit from pane");
   panes.remove(pane);
   delegate.deinstall(pane);
 }