use of com.codename1.rad.models.Entity 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);
}
use of com.codename1.rad.models.Entity in project CodeRAD by shannah.
the class LabelEntityViewBuilder method build.
@Override
public LabelEntityView build() {
iconWidth = (iconWidth <= 0) ? CN.convertToPixels(1.5f, Style.UNIT_TYPE_REM) : iconWidth;
iconHeight = (iconHeight <= 0) ? CN.convertToPixels(1.5f, Style.UNIT_TYPE_REM) : iconHeight;
return new LabelEntityView(getContext().getController().createViewContext(Entity.class, entity), new Label(), iconWidth, iconHeight);
}
use of com.codename1.rad.models.Entity in project CodeRAD by shannah.
the class ProfileAvatarBuilder method build.
@Override
public ProfileAvatarView build() {
ViewNode n = new ViewNode();
n.setParent(node);
if (nameTag != null) {
n.setAttributes(UI.param(ProfileAvatarView.NAME_PROPERTY_TAGS, nameTag));
}
if (iconTag != null) {
n.setAttributes(UI.param(ProfileAvatarView.ICON_PROPERTY_TAGS, iconTag));
}
return new ProfileAvatarView(entity, n, size);
}
use of com.codename1.rad.models.Entity in project CodeRAD by shannah.
the class TabsEntityView method createViewTab.
private EntityView createViewTab(ViewNode vn) {
EntityViewFactory factory = vn.getViewFactory(null);
if (factory == null) {
return null;
}
Entity tabEntity = null;
PropertySelector sel = vn.createPropertySelector(getEntity());
if (sel == null) {
return null;
}
tabEntity = sel.getEntity(null);
if (tabEntity == null) {
return null;
}
return factory.createView(tabEntity, vn);
}
Aggregations