Beispiel #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);
       }
     };
   }
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #7
0
 public Document createDefaultDocument() {
   Document ret = delegate.createDefaultDocument();
   if (Settings.debug) System.err.println("Delegating createDefaultDocument: " + ret);
   return ret;
 }
Beispiel #8
0
 public Caret createCaret() {
   if (Settings.debug) System.err.println("Delegating createCaret");
   return delegate.createCaret();
 }
Beispiel #9
0
 public Action[] getActions() {
   if (Settings.debug) System.err.println("Delegating getActions");
   return delegate.getActions();
 }
Beispiel #10
0
 // Delegated methods:
 public String getContentType() {
   String ret = delegate.getContentType();
   if (Settings.debug) System.err.println("Delegating getContentType: " + ret);
   return ret;
 }
Beispiel #11
0
 public void deinstall(JEditorPane pane) {
   if (Settings.debug) System.err.println("Deinstalling kit from pane");
   panes.remove(pane);
   delegate.deinstall(pane);
 }