com.inet.html.views
Class InsertedContentView

java.lang.Object
  extended by javax.swing.text.View
      extended by com.inet.html.views.BoxView
          extended by com.inet.html.views.ContentView
              extended by com.inet.html.views.InsertedContentView
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.SwingConstants

public class InsertedContentView
extends ContentView
implements java.lang.Cloneable

This view can be used to insert content without changing the document. It's primary use are :before, :after and list numbering.


Field Summary
 
Fields inherited from class com.inet.html.views.ContentView
CJK_TYPE_CHARACTER, CJK_TYPE_NONE, CJK_TYPE_PUNCTUATION
 
Fields inherited from class com.inet.html.views.BoxView
BASELINE, STATUS_REQ_LAYOUT, STATUS_REQ_PRELAYOUT, STATUS_UPTODATE
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
InsertedContentView(javax.swing.text.Element elem)
          Creates a new, empty view
InsertedContentView(javax.swing.text.Element elem, ViewPainter viewPainter)
          Creates a new, empty view
InsertedContentView(javax.swing.text.Element elem, ViewPainter viewPainter, ContentPainter contentPainter)
          Creates a new, empty view with a specific content painter
 
Method Summary
 float getMinimumSpan(int axis)
          
 int getTextLength()
          Returns the number of displayed by this view.
 void setNewContent(java.lang.String newContent)
          Set the content which this view displays.
 void setParent(javax.swing.text.View parent)
          
 java.lang.String toString()
          
 
Methods inherited from class com.inet.html.views.ContentView
createFragment, getBottomInset, getCJKType, getContentPainter, getFont, getLeftInset, getMargins, getPreferredSpan, getRightInset, getTopInset, insertUpdate, isBlock, isBreakable, modelToView, paint, paramString, performLayout, performLayoutVAlign, performLayoutWidth, setBreakable, setCJKType, setIsNativeLTR, setSize, setSizeContent, viewToModel
 
Methods inherited from class com.inet.html.views.BoxView
addBoxPainter, factoryPreset, forceLayout, forceLayout, getAlignment, getAutoMarginJustify, getBackgroundValue, getBorderBottomColor, getBorderLeftColor, getBorderRightColor, getBorderTopColor, getBox, getBoxPainter, getClear, getCompleteHight, getContentHeight, getContentVerticalOffset, getContentWidth, getDirection, getDisplay, getEndOffset, getFirstLineBaseLine, getFloat, getFontSize, getHeightUnit, getHTMLRoot, getJustification, getLineHeight, getOuterHeight, getOuterWidth, getOverflow, getPainter, getPosition, getRenderContext, getResizeWeight, getSpan, getStartOffset, getStatus, getSwingAlign, getUnicodeBidi, getViewForPosition, getViewIndex, getViewIndex, getVisibility, getWhiteSpace, getWidthUnit, isAbsolutePositioned, isBreak, isFloating, isInFlow, isListItemWithMarker, isLTR, isMarker, isNativeLTR, isTableCell, isWidthSet, performPreLayout, setBackgroundValue, setBorderBottomColor, setBorderLeftColor, setBorderRightColor, setBorderTopColor, setContentVerticalOffset, setContentWidth, setFirstLineBaseLine, setJustification, setMarker, setPainter, setRoot, setStartAndEndOffset, setStatus, setStatusLocal
 
Methods inherited from class javax.swing.text.View
append, breakView, changedUpdate, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getNextVisualPositionFrom, getParent, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, viewToModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InsertedContentView

public InsertedContentView(javax.swing.text.Element elem)
Creates a new, empty view

Parameters:
elem - the parent element, which is in this case the surrounding block

InsertedContentView

public InsertedContentView(javax.swing.text.Element elem,
                           ViewPainter viewPainter)
Creates a new, empty view

Parameters:
elem - the parent element, which is in this case the surrounding block
viewPainter - painter to use for painting the view

InsertedContentView

public InsertedContentView(javax.swing.text.Element elem,
                           ViewPainter viewPainter,
                           ContentPainter contentPainter)
Creates a new, empty view with a specific content painter

Parameters:
elem - the parent element, which is in this case the surrounding block
viewPainter - painter to use for painting the view
contentPainter - the painter to be used by this view
Method Detail

setParent

public void setParent(javax.swing.text.View parent)

Overrides:
setParent in class ContentView

setNewContent

public void setNewContent(java.lang.String newContent)
Set the content which this view displays.
NOTE: The HTML within this content will not be parsed!

Parameters:
newContent - content string.

getMinimumSpan

public float getMinimumSpan(int axis)

Overrides:
getMinimumSpan in class ContentView

toString

public java.lang.String toString()

Overrides:
toString in class ContentView

getTextLength

public int getTextLength()
Returns the number of displayed by this view. Since the length of the displayed text may differ to the number of characters in the model covered by this view, please call this function whenever referring to the number of really displayed characters!

Overrides:
getTextLength in class ContentView
Returns:
the number of displayed by this view