No problem. But, you would have to write a little loop (possibly a
recursive method) to navigate through all the children of the TabPane
and set the style. Here is some sample code I wrote for doing a similar
thing (only with a new font):
/**
* Recursively set the font on all necessary
subcomponents
* of the given component (which initially should be the
* {@link #resultsPane}. Traverse the hierarchy
appropriately.
*/
private void setOutputFont(Component component) {
if (component instanceof TabPane) {
TabPane tabPane = (TabPane)component;
for (Component tab : tabPane.getTabs())
{
setOutputFont(tab);
}
}
else if (component instanceof ScrollPane) {
ScrollPane scrollPane =
(ScrollPane)component;
setOutputFont(scrollPane.getView());
if (scrollPane.getColumnHeader() !=
null)
setOutputFont(scrollPane.getColumnHeader());
}
else if (component instanceof Border) {
setOutputFont(((Border)component).getContent());
}
else if (component instanceof Container) {
for (Component child :
(Container)component) {
setOutputFont(child);
}
}
else if (component instanceof TableView ||
component instanceof
TableViewHeader ||
component instanceof ListView) {
component.getStyles().put("font",
outputFont);
}
}
~Roger
From: Ajay Bhat [mailto:[email protected]]
Sent: Tuesday, August 27, 2013 10:21 AM
To: [email protected]
Subject: Coloring similar UI components
Hi,
Suppose I have a set of different panes (like Table Pane, Label etc) in
different tabs. Would it be possible to color all the panes of same type
across the different tabs using the method as shown in Pivot tutorial
[1]
function onColorChange() {
var color = colorChooser.selectedColor;
sampleBorder.styles.put("backgroundColor", color);
}
[1] http://pivot.apache.org/tutorials/color-choosers.html
--
Thanks and regards,
Ajay Bhat