Package org.fest.swing.core
Class BasicComponentPrinter
java.lang.Object
org.fest.swing.core.BasicComponentPrinter
- All Implemented Interfaces:
ComponentPrinter
Understands printing the
String
representation of Component
s to
facilitate debugging.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ComponentMatcher
private final ComponentHierarchy
private static final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BasicComponentPrinter
(ComponentHierarchy hierarchy) Creates a new
.BasicComponentPrinter
-
Method Summary
Modifier and TypeMethodDescriptionprivate static ComponentMatcher
protected final ComponentHierarchy
Returns the component hierarchy used by this printer.private ComponentHierarchy
private static void
print
(Component c, int level, PrintStream out) private static void
print
(Component c, ComponentHierarchy h, ComponentMatcher matcher, int level, PrintStream out) private static void
print
(ComponentHierarchy hierarchy, ComponentMatcher matcher, PrintStream out) void
Prints all the components in the hierarchy.void
printComponents
(PrintStream out, Container root) Prints all the components in the hierarchy under the given root.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.static ComponentPrinter
Creates a new
that has access to all the GUI components in the AWT hierarchy.BasicComponentPrinter
static ComponentPrinter
Creates a new
with a new AWT hierarchy.BasicComponentPrinter
private void
-
Field Details
-
INDENTATION
- See Also:
-
ALWAYS_MATCHES
-
hierarchy
-
-
Constructor Details
-
BasicComponentPrinter
Creates a new
.BasicComponentPrinter
- Parameters:
hierarchy
- the component hierarchy to use.
-
-
Method Details
-
alwaysMatches
-
printerWithNewAwtHierarchy
Creates a new
with a new AWT hierarchy.BasicComponentPrinter
s created before the createdComponent
cannot be accessed by the createdBasicComponentPrinter
.BasicComponentPrinter
- Returns:
- the created finder.
-
printerWithCurrentAwtHierarchy
Creates a new
that has access to all the GUI components in the AWT hierarchy.BasicComponentPrinter
- Returns:
- the created printer.
-
hierarchy
Returns the component hierarchy used by this printer.- Returns:
- the component hierarchy used by this printer.
-
printComponents
Prints all the components in the hierarchy.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
out
- the output stream where to print the components to.- See Also:
-
printComponents
Prints all the components in the hierarchy under the given root.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
out
- the output stream where to print the components to.root
- the root used as the starting point of the search.- See Also:
-
printComponents
Prints only the components of the given type in the hierarchy.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
out
- the output stream where to print the components to.type
- the type of components to print.- See Also:
-
printComponents
@RunsInEDT public 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.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
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.- See Also:
-
printComponents
$Prints only the components that match the given search criteria in the hierarchy.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
out
- the output stream where to print the components to.matcher
- specifies the search criteria to use filter the components to print.- See Also:
-
printComponents
$Prints all the components that match the given search criteria under the given root.- Specified by:
printComponents
in interfaceComponentPrinter
- Parameters:
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.- See Also:
-
validateNotNull
-
hierarchy
-
print
@RunsInEDT private static void print(ComponentHierarchy hierarchy, ComponentMatcher matcher, PrintStream out) -
print
@RunsInCurrentThread private static void print(Component c, ComponentHierarchy h, ComponentMatcher matcher, int level, PrintStream out) -
print
-