kawigi.editor
Class ObedientViewFactory

java.lang.Object
  extended by kawigi.editor.ObedientViewFactory
All Implemented Interfaces:
javax.swing.text.ViewFactory

public class ObedientViewFactory
extends java.lang.Object
implements javax.swing.text.ViewFactory

Obedient because it returns what I tell it to. Also sounds better than "HackedViewFactory".


Field Summary
protected  java.lang.Class viewClass
          Class from which Views are made in this ViewFactory.
 
Constructor Summary
ObedientViewFactory()
          Creates an ObedientViewFactory with no default View implementation.
ObedientViewFactory(java.lang.Class v)
          Creates an ObedientViewFactory using v as the View implementation class.
 
Method Summary
 javax.swing.text.View create(javax.swing.text.Element elem)
          Creates a View instance of the class designated to this ViewFactory.
 void setViewClass(java.lang.Class v)
          Sets the class of the View implementation to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewClass

protected java.lang.Class viewClass
Class from which Views are made in this ViewFactory.

Constructor Detail

ObedientViewFactory

public ObedientViewFactory()
Creates an ObedientViewFactory with no default View implementation.


ObedientViewFactory

public ObedientViewFactory(java.lang.Class v)
Creates an ObedientViewFactory using v as the View implementation class. v should be compatible with javax.swing.text.View.

Method Detail

setViewClass

public void setViewClass(java.lang.Class v)
Sets the class of the View implementation to be used. v should be compatible with javax.swing.text.View.


create

public javax.swing.text.View create(javax.swing.text.Element elem)
Creates a View instance of the class designated to this ViewFactory. If it fails for some reason (i.e. - no View class specified or the given view class doesn't except a single Element parameter for its constructor), a GenericView is returned.

Specified by:
create in interface javax.swing.text.ViewFactory