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