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 Components to
facilitate debugging.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ComponentMatcherprivate final ComponentHierarchyprivate static final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBasicComponentPrinter(ComponentHierarchy hierarchy) Creates a new.BasicComponentPrinter -
Method Summary
Modifier and TypeMethodDescriptionprivate static ComponentMatcherprotected final ComponentHierarchyReturns the component hierarchy used by this printer.private ComponentHierarchyprivate static voidprint(Component c, int level, PrintStream out) private static voidprint(Component c, ComponentHierarchy h, ComponentMatcher matcher, int level, PrintStream out) private static voidprint(ComponentHierarchy hierarchy, ComponentMatcher matcher, PrintStream out) voidPrints all the components in the hierarchy.voidprintComponents(PrintStream out, Container root) Prints all the components in the hierarchy under the given root.voidprintComponents(PrintStream out, Class<? extends Component> type) Prints only the components of the given type in the hierarchy.voidprintComponents(PrintStream out, Class<? extends Component> type, Container root) Prints all the components of the given type in the hierarchy under the given root.voidprintComponents(PrintStream out, ComponentMatcher matcher) $Prints only the components that match the given search criteria in the hierarchy.voidprintComponents(PrintStream out, ComponentMatcher matcher, Container root) $Prints all the components that match the given search criteria under the given root.static ComponentPrinterCreates a newthat has access to all the GUI components in the AWT hierarchy.BasicComponentPrinterstatic ComponentPrinterCreates a newwith a new AWT hierarchy.BasicComponentPrinterprivate 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 newwith a new AWT hierarchy.BasicComponentPrinters created before the createdComponentcannot be accessed by the createdBasicComponentPrinter.BasicComponentPrinter- Returns:
- the created finder.
-
printerWithCurrentAwtHierarchy
Creates a newthat 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:
printComponentsin 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:
printComponentsin 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:
printComponentsin 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:
printComponentsin 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:
printComponentsin 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:
printComponentsin 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
-