sos.reports
Interface TextHighlighter

All Known Implementing Classes:
DefaultTextHighlighter

public interface TextHighlighter

An object that specifies report text highlighting. It maps report elements to a list of javax.swing.text.Highlighter.Highlight descriptions, which include a start offset, an end offset, and a painter.

Since:
1.0
See Also:
JReportPane

Method Summary
 void addHighlight(Element element, javax.swing.text.Highlighter.Highlight highlight)
          Adds the specified text highlight to the list of highlights associated with the specified element.
 void clear()
          Removes all text highlighting for all report elements.
 java.util.List getHighlights(Element element)
          Returns the list of text highlights associated with the specified element.
 void removeAllHighlights(Element element)
          Removes all text highlights associated with the specified element.
 void removeHighlight(Element element, javax.swing.text.Highlighter.Highlight highlight)
          Removes the specified text highlight for the list of highlights associated with the specified element.
 

Method Detail

addHighlight

public void addHighlight(Element element,
                         javax.swing.text.Highlighter.Highlight highlight)
Adds the specified text highlight to the list of highlights associated with the specified element. When the element is rendered, the region of text, as described by the highlight, is highlighted.

Parameters:
element - report element for which to use the highlighting
highlight - a start offset, end offset, and painter describing how to highlight the element's text
Throws:
java.lang.NullPointerException - if element or highlight is null
See Also:
getHighlights(sos.reports.Element), removeHighlight(sos.reports.Element, javax.swing.text.Highlighter.Highlight)

clear

public void clear()
Removes all text highlighting for all report elements.

See Also:
removeAllHighlights(sos.reports.Element)

getHighlights

public java.util.List getHighlights(Element element)
Returns the list of text highlights associated with the specified element.

Parameters:
element - report element for which the associated highlights are requested
Returns:
an unmodifiable list of element's highlights
Throws:
java.lang.NullPointerException - if element is null

removeAllHighlights

public void removeAllHighlights(Element element)
Removes all text highlights associated with the specified element.

Parameters:
element - report element for which to remove all associated highlights
Throws:
java.lang.NullPointerException - if element is null
See Also:
clear()

removeHighlight

public void removeHighlight(Element element,
                            javax.swing.text.Highlighter.Highlight highlight)
Removes the specified text highlight for the list of highlights associated with the specified element.

Parameters:
element - report element for which to remove the highlighting
highlight - text highlighting to unassociate with element
Throws:
java.lang.NullPointerException - if element or highlight is null
See Also:
addHighlight(sos.reports.Element, javax.swing.text.Highlighter.Highlight)


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.