| javax.swing.text.DefStyledDoc_Helpers
DefStyledDoc_Helpers | final public class DefStyledDoc_Helpers extends Assert (Code) | | Contains "complex" assert methods as well as logging versions
of DefaultStyledDocument and
DefaultStyledDocument.ElementBuffer which facilitate testing
and debugging.
|
Method Summary | |
public static void | assertChange(Object object, Element element, int removed, int added) Asserts that the expected number of children was removed and/or added
to an element. | public static void | assertChange(ElementChange change, int[] removedOffsets, int[] addedOffsets) Asserts that the removed and/or added children have the expected offsets. | public static void | assertChange(Object change, Element element, int index, int[] removed, int[] added) Asserts that ElementChange has expected field values. | public static void | assertChildren(Element element, int[] offsets) Asserts that an element has children with the expected offsets. | public static void | assertChildren(Element element, int[] offsets, AttributeSet[] attributes) Asserts that an element has children with the expected offsets and
attributes. | public static void | assertSpec(ElementSpec spec, short type, short direction, int offset, int length, boolean isNullArray) Asserts that an element spec is as expected. | public static void | assertSpec(ElementSpec spec, short type, short direction, int offset, int length) Asserts that an element spec is as expected. | public static void | assertSpec(ElementSpec expected, ElementSpec actual) Compares two ElementSpec objects. | public static void | assertSpecs(ElementSpec[] expected, ElementSpec[] actual) Compares two arrays of ElementSpec objects. | public static Vector> | getEdits(DefaultDocumentEvent event) Returns the list of edits stored in DefaultDocumentEvent
object.
Parameters: event - the event from which to extract the field. | public static void | printChange(ElementChange change) Dumps the changes stored in change . | public static void | printChanges(List> edits) Prints all the changes to elements performed. | public static void | printElementSpecs(ElementSpec[] spec) Prints the specs contained in an array. | public static void | printElements(Element[] elems) Prints elements contained in an array. |
logging | public static boolean logging(Code) | | |
assertChange | public static void assertChange(Object object, Element element, int removed, int added)(Code) | | Asserts that the expected number of children was removed and/or added
to an element.
Parameters: object - ElementChange implementation which storesthe information. Parameters: element - the element modified. Parameters: removed - the number of children removed. Parameters: added - the number of children added |
assertChange | public static void assertChange(ElementChange change, int[] removedOffsets, int[] addedOffsets)(Code) | | Asserts that the removed and/or added children have the expected offsets.
Parameters: change - the changes performed to an element. Parameters: removedOffsets - the offsets of children removed in the form{start1, end1, start2, end2, ...} . Parameters: addedOffsets - the offsets of children added in the same form asremovedOffsets . |
assertChange | public static void assertChange(Object change, Element element, int index, int[] removed, int[] added)(Code) | | Asserts that ElementChange has expected field values.
Parameters: change - the change Parameters: element - element where the change occurred Parameters: index - index where the change occurred Parameters: removed - offsets of the elements removed Parameters: added - offsets of the elements added |
assertChildren | public static void assertChildren(Element element, int[] offsets)(Code) | | Asserts that an element has children with the expected offsets.
Parameters: element - the element where to check children. Parameters: offsets - the expected offsets in the form{start1, end1, start2, end2, ...} . |
assertChildren | public static void assertChildren(Element element, int[] offsets, AttributeSet[] attributes)(Code) | | Asserts that an element has children with the expected offsets and
attributes.
Parameters: element - the element where to check children. Parameters: offsets - the expected offsets. Parameters: attributes - the expected attributes; null if noattributes expected. |
assertSpec | public static void assertSpec(ElementSpec spec, short type, short direction, int offset, int length, boolean isNullArray)(Code) | | Asserts that an element spec is as expected.
Parameters: spec - the spec to check. Parameters: type - the type of the spec. Parameters: direction - the direction of the spec. Parameters: offset - the offset of the spec. Parameters: length - the length of the spec. |
assertSpec | public static void assertSpec(ElementSpec spec, short type, short direction, int offset, int length)(Code) | | Asserts that an element spec is as expected.
Parameters: spec - the spec to check. Parameters: type - the type of the spec. Parameters: direction - the direction of the spec. Parameters: offset - the offset of the spec. Parameters: length - the length of the spec. |
assertSpec | public static void assertSpec(ElementSpec expected, ElementSpec actual)(Code) | | Compares two ElementSpec objects.
Parameters: expected - the expected spec. Parameters: actual - the actual spec. |
assertSpecs | public static void assertSpecs(ElementSpec[] expected, ElementSpec[] actual)(Code) | | Compares two arrays of ElementSpec objects.
Parameters: expected - array with expected specs. Parameters: actual - array with the actual specs. |
getEdits | public static Vector> getEdits(DefaultDocumentEvent event)(Code) | | Returns the list of edits stored in DefaultDocumentEvent
object.
Parameters: event - the event from which to extract the field. returns the edits fromjavax.swing.undo.CompoundEdit , or null if something goes wrong. |
printChange | public static void printChange(ElementChange change)(Code) | | Dumps the changes stored in change .
Parameters: change - the change to print removed and added children from. |
printChanges | public static void printChanges(List> edits)(Code) | | Prints all the changes to elements performed.
Parameters: edits - the list extracted from a DefaultDocumentEvet object. |
printElementSpecs | public static void printElementSpecs(ElementSpec[] spec)(Code) | | Prints the specs contained in an array.
Parameters: spec - the array containing specs of interest. |
printElements | public static void printElements(Element[] elems)(Code) | | Prints elements contained in an array.
Parameters: elems - the array containing elements of interest. |
|
|