public final class BasicComponentPrinter extends Object implements ComponentPrinter
String
representation of Component
s to
facilitate debugging.Modifier | Constructor and Description |
---|---|
protected |
BasicComponentPrinter(ComponentHierarchy hierarchy)
Creates a new
. |
Modifier and Type | Method and Description |
---|---|
protected ComponentHierarchy |
hierarchy()
Returns the component hierarchy used by this printer.
|
void |
printComponents(PrintStream out)
Prints all the components in the hierarchy.
|
void |
printComponents(PrintStream out,
Class<? extends Component> type)
Prints only the components of the given type in the hierarchy.
|
void |
printComponents(PrintStream out,
Class<? extends Component> type,
Container root)
Prints all the components of the given type in the hierarchy under the given root.
|
void |
printComponents(PrintStream out,
ComponentMatcher matcher)
$Prints only the components that match the given search criteria in the hierarchy.
|
void |
printComponents(PrintStream out,
ComponentMatcher matcher,
Container root)
$Prints all the components that match the given search criteria under the given root.
|
void |
printComponents(PrintStream out,
Container root)
Prints all the components in the hierarchy under the given root.
|
static ComponentPrinter |
printerWithCurrentAwtHierarchy()
Creates a new
that has access to all the GUI components in the AWT
hierarchy. |
static ComponentPrinter |
printerWithNewAwtHierarchy()
Creates a new
with a new AWT hierarchy. |
protected BasicComponentPrinter(ComponentHierarchy hierarchy)
BasicComponentPrinter
.hierarchy
- the component hierarchy to use.public static ComponentPrinter printerWithNewAwtHierarchy()
BasicComponentPrinter
with a new AWT hierarchy. Component
s
created before the created BasicComponentPrinter
cannot be accessed by the created
BasicComponentPrinter
.public static ComponentPrinter printerWithCurrentAwtHierarchy()
BasicComponentPrinter
that has access to all the GUI components in the AWT
hierarchy.protected final ComponentHierarchy hierarchy()
@RunsInEDT public void printComponents(PrintStream out)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.Formatting.format(Component)
@RunsInEDT public void printComponents(PrintStream out, Container root)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.root
- the root used as the starting point of the search.Formatting.format(Component)
@RunsInEDT public void printComponents(PrintStream out, Class<? extends Component> type)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.type
- the type of components to print.Formatting.format(Component)
@RunsInEDT public void printComponents(PrintStream out, Class<? extends Component> type, Container root)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.type
- the type of components to print.root
- the root used as the starting point of the search.Formatting.format(Component)
public void printComponents(PrintStream out, ComponentMatcher matcher)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.matcher
- specifies the search criteria to use filter the components to print.Formatting.format(Component)
public void printComponents(PrintStream out, ComponentMatcher matcher, Container root)
printComponents
in interface ComponentPrinter
out
- the output stream where to print the components to.matcher
- specifies the search criteria to use filter the components to print.root
- the root used as the starting point of the search.Formatting.format(Component)
Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.