edu.rice.cs.drjava.model.repl
Class InteractionsEditorKit

java.lang.Object
  extended by javax.swing.text.EditorKit
      extended by javax.swing.text.DefaultEditorKit
          extended by javax.swing.text.StyledEditorKit
              extended by edu.rice.cs.drjava.model.repl.InteractionsEditorKit
All Implemented Interfaces:
Serializable, Cloneable

public class InteractionsEditorKit
extends StyledEditorKit

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: InteractionsEditorKit.java 5175 2010-01-20 08:46:32Z mgricken $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.StyledEditorKit
StyledEditorKit.AlignmentAction, StyledEditorKit.BoldAction, StyledEditorKit.FontFamilyAction, StyledEditorKit.FontSizeAction, StyledEditorKit.ForegroundAction, StyledEditorKit.ItalicAction, StyledEditorKit.StyledTextAction, StyledEditorKit.UnderlineAction
 
Nested classes/interfaces inherited from class javax.swing.text.DefaultEditorKit
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction
 
Field Summary
private static ViewFactory _factory
           
 
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
 
Constructor Summary
InteractionsEditorKit()
          Creates a new editor kit
 
Method Summary
private static GlyphView _createColoringView(Element elem)
          We only need to re-implement the painter for the GlyphView to modify its behavior.
 InteractionsDJDocument createDefaultDocument()
           
 String getContentType()
          Get the MIME content type of the document.
 ViewFactory getViewFactory()
          We want to use our ColoringView to render text, so here we return a factory that creates ColoringViews.
 
Methods inherited from class javax.swing.text.StyledEditorKit
clone, createInputAttributes, deinstall, getActions, getCharacterAttributeRun, getInputAttributes, install
 
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, read, read, write, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_factory

private static ViewFactory _factory
Constructor Detail

InteractionsEditorKit

public InteractionsEditorKit()
Creates a new editor kit

Method Detail

getContentType

public String getContentType()
Get the MIME content type of the document.

Overrides:
getContentType in class DefaultEditorKit
Returns:
"text/java"

getViewFactory

public final ViewFactory getViewFactory()
We want to use our ColoringView to render text, so here we return a factory that creates ColoringViews.

Overrides:
getViewFactory in class StyledEditorKit

createDefaultDocument

public InteractionsDJDocument createDefaultDocument()
Overrides:
createDefaultDocument in class StyledEditorKit

_createColoringView

private static GlyphView _createColoringView(Element elem)
We only need to re-implement the painter for the GlyphView to modify its behavior. The GlyphView delegates its paint method to the painter. It also allows the painter to obtain the document to which the element belongs.

Parameters:
elem - The Element to pass to the GlyphView
Returns:
A GlyphView with modified behavior