if (attributeGroup == null) {
throw new NullPointerException("The attributeGroup parameter can not be null.");
}
this.attributeGroup = attributeGroup;
VBox root = new VBox();
this.getChildren().add(root);
final boolean nameVisible = attributeGroup.getName() != null;
if (nameVisible) {
// TODO set styleable
collapseLabel = new CollapseLabel();
collapseLabel.widthProperty().bind(this.clientWidthProperty());
collapseLabel.textProperty().set(attributeGroup.getName());
collapseLabel.collapsedProperty().bidirectionalBind(collapsed);
root.getChildren().add(collapseLabel);
root.addEmptyCell(2);
Panel pnlSep = new Panel();
pnlSep.widthProperty().bind(clientWidthProperty());
// TODO set styleable
pnlSep.heightProperty().set(1);
// TODO set styleable
pnlSep.backgroundProperty().set(new ColorBackground(Color.BLACK));
root.getChildren().add(pnlSep);
root.addEmptyCell(2);
}
attributesPanel = new Panel();
attributesPanel.widthProperty().bind(new AExpression<Integer>() {
{
bind(clientWidthProperty());
}
@Override
public Integer calculate() {
return clientWidthProperty().get() - 10;
}
});
attributesPanel.translateXProperty().set(10);
root.getChildren().add(attributesPanel);
vbAttributes = new VBox();
attributesPanel.getChildren().add(vbAttributes);
for (AAttribute<?> attribute : attributeGroup.getAttributes()) {
AttributePanelItem item = new AttributePanelItem(attribute);
item.widthProperty().bind(attributesPanel.clientWidthProperty());