public class TreeViewFactory extends ViewFactory
ViewFactory.Effect
Modifier and Type | Field and Description |
---|---|
protected DocumentType |
docType |
protected boolean |
isDummyDocType |
protected TreeViewSettings |
settings |
doc, docView
properties
Constructor and Description |
---|
TreeViewFactory(DocumentView documentView)
Constructs a tree view factory for use by specified DocumentView.
|
Modifier and Type | Method and Description |
---|---|
void |
applySettings()
Rebuilds the whole node view tree applying current settings of this
factory.
|
ViewFactory.Effect |
attributeChanged(AttributeEvent event,
int viewIndex)
Invoked by the DocumentView when an element attribute has changed.
|
protected static CharView |
createCharView(TextNode text,
TreeViewSettings settings) |
TextNodeView |
createCommentView(Comment comment,
ElementView parentView)
Creates an TextNodeView for specified comment node.
|
ElementView |
createElementView(Element element,
ElementView parentView)
Creates an ElementView for specified element.
|
TextNodeView |
createProcessingInstructionView(ProcessingInstruction pi,
ElementView parentView)
Creates an TextNodeView for specified processing instruction node.
|
protected static TextNodeOutline |
createTextNodeOutline(TextNode text,
boolean preserveSpace,
TreeViewSettings settings) |
TextNodeView |
createTextView(Text text,
ElementView parentView)
Creates an TextNodeView for specified text node.
|
protected static WordView |
createWordView(TextNode text,
TreeViewSettings settings) |
protected ViewFactory.Effect |
directionalityAttributeChanged(Element attrParent,
Name attrName) |
TreeViewSettings |
getSettings()
Returns the current settings of this factory.
|
protected boolean |
hasPreserveSpace(TextNode textNode) |
void |
setDocument(Document document)
Invoked by the DocumentView to notify this factory that specified
document is displayed.
|
void |
setSettings(TreeViewSettings settings)
Changes current settings of this factory and then invokes
applySettings() . |
beginRebuildView, endRebuildView, getDocument, getDocumentView, treeChanged
getProperties, getProperty, getPropertyCount, hasProperty, putProperties, putProperty, removeAllProperties, removeProperty
protected TreeViewSettings settings
protected DocumentType docType
protected boolean isDummyDocType
public TreeViewFactory(DocumentView documentView)
public void setDocument(Document document)
ViewFactory
setDocument
in class ViewFactory
document
- document displayed by DocumentView; null
if DocumentView is empty.public void setSettings(TreeViewSettings settings)
applySettings()
.
Note that it is also allowed to use getSettings()
to get
current settings of this factory, to directly modify these
settings and then to invoke applySettings.
public void applySettings()
public TreeViewSettings getSettings()
public ViewFactory.Effect attributeChanged(AttributeEvent event, int viewIndex)
ViewFactory
This default implementation returns ViewFactory.Effect.REBUILD
.
attributeChanged
in class ViewFactory
event
- specifies the attribute changeviewIndex
- can be used to access the view of the element for
which an attribute has changed (with
event.getElementSource().getDocumentListenerData(viewIndex)
)ViewFactory.Effect.SKIP
or ViewFactory.Effect.REFRESH
or
ViewFactory.Effect.REBUILD
Node.getDocumentListenerData(int)
protected ViewFactory.Effect directionalityAttributeChanged(Element attrParent, Name attrName)
public ElementView createElementView(Element element, ElementView parentView)
ViewFactory
createElementView
in class ViewFactory
element
- element for which a view is to be createdparentView
- view of parent element; may be useful for some
factoriesStyledViewFactory
does this for
display: none)public TextNodeView createTextView(Text text, ElementView parentView)
ViewFactory
createTextView
in class ViewFactory
text
- text node for which a view is to be createdparentView
- view of parent element; may be useful for some
factoriesprotected boolean hasPreserveSpace(TextNode textNode)
public TextNodeView createCommentView(Comment comment, ElementView parentView)
ViewFactory
createCommentView
in class ViewFactory
comment
- comment node for which a view is to be createdparentView
- view of parent element; may be useful for some
factoriespublic TextNodeView createProcessingInstructionView(ProcessingInstruction pi, ElementView parentView)
ViewFactory
createProcessingInstructionView
in class ViewFactory
pi
- processing instruction node for which a view is to be createdparentView
- view of parent element; may be useful for some
factoriesprotected static CharView createCharView(TextNode text, TreeViewSettings settings)
protected static WordView createWordView(TextNode text, TreeViewSettings settings)
protected static TextNodeOutline createTextNodeOutline(TextNode text, boolean preserveSpace, TreeViewSettings settings)