use of com.codename1.ui.table.Table in project CodeRAD by shannah.
the class UI method table.
public static FieldNode table(Attribute... atts) {
FieldNode fieldNode = new FieldNode(atts);
fieldNode.setAttributes(TABLE);
return fieldNode;
}
use of com.codename1.ui.table.Table in project CodeRAD by shannah.
the class AbstractTableCellRenderer method createCellConstraint.
@Override
public TableLayout.Constraint createCellConstraint(Table table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
TableLayout tl = (TableLayout) table.getLayout();
TableLayout.Constraint cnst = tl.createConstraint(row, column);
return cnst;
}
use of com.codename1.ui.table.Table in project CodeRAD by shannah.
the class DefaultTableCellEditor method getTableCellEditorComponent.
@Override
public Component getTableCellEditorComponent(Table table, Object value, boolean isSelected, int row, int column) {
TextField tf = new TextField();
TableModel model = table.getModel();
ContentType contentType = model.getCellContentType(row, column);
String strVal = value == null ? "" : String.valueOf(value);
tf.setText(strVal);
tf.addDataChangedListener((type, index) -> {
table.getModel().setValueAt(ContentType.convert(Text, tf.getText(), contentType), row, column);
});
return tf;
}
use of com.codename1.ui.table.Table in project CodeRAD by shannah.
the class EntityListTableCellRenderer method getTableCellRendererComponent.
@Override
public Component getTableCellRendererComponent(Table table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
EntityListTableModel model = (EntityListTableModel) table.getModel();
FieldNode field = model.getColumnField(column);
FieldNode fieldCopy = field.copy();
fieldCopy.setAttributes(new Editable(false));
Entity entity = model.getEntity(row);
if (entity == null) {
if (parent != null) {
return parent.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
} else {
return new com.codename1.ui.Label();
}
}
return viewFactory.createPropertyView(entity, fieldCopy);
}
Aggregations