use of com.codename1.rad.nodes.FieldNode in project CodeRAD by shannah.
the class EntityListTableCellEditor method getTableCellEditorComponent.
@Override
public Component getTableCellEditorComponent(Table table, Object value, boolean isSelected, int row, int column) {
EntityListTableModel model = (EntityListTableModel) table.getModel();
FieldNode field = model.getColumnField(column);
Entity entity = model.getEntity(row);
if (entity == null) {
if (parent != null) {
return parent.getTableCellEditorComponent(table, value, isSelected, row, column);
} else {
return new com.codename1.ui.Label();
}
}
return viewFactory.createPropertyView(entity, field);
}
use of com.codename1.rad.nodes.FieldNode in project CodeRAD by shannah.
the class EntityListTableModel method getValueAt.
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
Entity e = entities.get(rowIndex);
FieldNode column = columns.getColumn(columnIndex);
PropertyNode prop = column.getProperty();
if (prop != null) {
return prop.getValue().getValue(e.getEntity());
} else {
return "";
}
}
use of com.codename1.rad.nodes.FieldNode in project CodeRAD by shannah.
the class FieldNode method copy.
public FieldNode copy() {
FieldNode out = new FieldNode();
for (Attribute att : attributes) {
out.setAttributes(att);
}
out.setProxying(getProxying());
out.setParent(getParent());
return out;
}
use of com.codename1.rad.nodes.FieldNode in project CodeRAD by shannah.
the class TableColumns method setAttributes.
@Override
public void setAttributes(Attribute... atts) {
if (fields == null) {
fields = new ArrayList<>();
}
for (Attribute att : atts) {
if (att instanceof FieldNode) {
FieldNode fn = (FieldNode) att;
fn = fn.createProxy(this);
fields.add(fn);
} else {
super.setAttributes(att);
}
}
}
use of com.codename1.rad.nodes.FieldNode 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