use of com.codename1.components.ButtonList in project CodeRAD by shannah.
the class ButtonListPropertyView method decorateButtonList.
private static ButtonList decorateButtonList(FieldNode field, ButtonList bl) {
ButtonListLayoutAttribute att = (ButtonListLayoutAttribute) field.findInheritedAttribute(ButtonListLayoutAttribute.class);
if (att != null) {
switch(att.getValue()) {
case Flow:
bl.setLayout(new FlowLayout());
break;
case Y:
bl.setLayout(BoxLayout.y());
break;
case X:
bl.setLayout(BoxLayout.x());
break;
case Grid:
Columns cols = (Columns) field.findAttribute(Columns.class);
int numCols = 2;
if (cols != null) {
numCols = cols.getValue();
}
bl.setLayout(new GridLayout(numCols));
break;
}
}
String uiid = field.getUIID(null);
if (uiid != null) {
bl.setUIID(uiid);
bl.setCellUIID(uiid + "Cell");
}
return bl;
}
Aggregations