| java.lang.Object javax.swing.text.EditorKit javax.swing.text.DefaultEditorKit javax.swing.text.StyledEditorKit edu.rice.cs.drjava.model.definitions.DefinitionsEditorKit
DefinitionsEditorKit | public class DefinitionsEditorKit extends StyledEditorKit (Code) | | This is an editor kit for editing Java source files.
It functions as the controller in the MVC arrangement.
It implements a factory for new documents, and it also
has a factory for Views (the things that render the document).
version: $Id: DefinitionsEditorKit.java 4255 2007-08-28 19:17:37Z mgricken $ |
DefinitionsEditorKit | public DefinitionsEditorKit(GlobalEventNotifier notifier)(Code) | | Creates a new editor kit with the given listeners.
Parameters: notifier - Keeps track of the listeners to the model |
createNewDocument | public DefinitionsDocument createNewDocument()(Code) | | Creates a new DefinitionsDocument. This used to be named createDefaultDocument() so that the view
(DefinitionsPane) would create a DefinitionsDocument by default when it was constructed. However,
we already have an existing DefinitionsDocument we want to use when the DefinitionsPane is constructed,
so this default one was being created and thrown away (very expensive). Ideally, we would have the
DefinitionsPane use our existing document from the beginning, but the JEditorPane constructor does
not take in a Document. The only possible approach would be to have this EditorKit return the desired
existing document when the JEditorPane requests a new one, but since the EditorKit must be kept as a
static field on DefinitionsPane since we can't set one until after JEditorPane's constructor is
finished), there's no clean way to tell the EditorKit which document to return at which time. (It
would require a large synchronization effort each time a DefinitionsPane is constructed.)
As an easier alternative, we just let the DefaultEditorKit return a PlainDocument (much lighter weight),
which can then be thrown away when the true DefinitionsDocument is assigned.
Improvements to this approach are welcome... :)
|
getContentType | public String getContentType()(Code) | | Get the MIME content type of the document.
"text/java" |
getViewFactory | final public ViewFactory getViewFactory()(Code) | | We want to use our ColoringView to render text, so here we return
a factory that creates ColoringViews.
|
Methods inherited from javax.swing.text.DefaultEditorKit | public Caret createCaret()(Code)(Java Doc) public Document createDefaultDocument()(Code)(Java Doc) public Action[] getActions()(Code)(Java Doc) public String getContentType()(Code)(Java Doc) public ViewFactory getViewFactory()(Code)(Java Doc) public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc) public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc) public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc) public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc)
|
Methods inherited from javax.swing.text.EditorKit | public Object clone()(Code)(Java Doc) abstract public Caret createCaret()(Code)(Java Doc) abstract public Document createDefaultDocument()(Code)(Java Doc) public void deinstall(JEditorPane c)(Code)(Java Doc) abstract public Action[] getActions()(Code)(Java Doc) abstract public String getContentType()(Code)(Java Doc) abstract public ViewFactory getViewFactory()(Code)(Java Doc) public void install(JEditorPane c)(Code)(Java Doc) abstract public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc) abstract public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc) abstract public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc) abstract public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc)
|
|
|