Search in sources :

Example 71 with Entity

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);
}
Also used : Entity(com.codename1.rad.models.Entity) FieldNode(com.codename1.rad.nodes.FieldNode) Editable(com.codename1.rad.models.Property.Editable)

Example 72 with Entity

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);
}
Also used : Entity(com.codename1.rad.models.Entity) LabelEntityView(com.codename1.rad.ui.entityviews.LabelEntityView) Label(com.codename1.ui.Label)

Example 73 with Entity

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);
}
Also used : ProfileAvatarView(com.codename1.rad.ui.entityviews.ProfileAvatarView) ViewNode(com.codename1.rad.nodes.ViewNode)

Example 74 with Entity

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);
}
Also used : EntityViewFactory(com.codename1.rad.ui.EntityViewFactory) Entity(com.codename1.rad.models.Entity) PropertySelector(com.codename1.rad.models.PropertySelector)

Aggregations

Entity (com.codename1.rad.models.Entity)38 Property (com.codename1.rad.models.Property)15 EntityList (com.codename1.rad.models.EntityList)13 Container (com.codename1.ui.Container)12 BorderLayout (com.codename1.ui.layouts.BorderLayout)11 ActionNode (com.codename1.rad.nodes.ActionNode)10 FieldNode (com.codename1.rad.nodes.FieldNode)10 Form (com.codename1.ui.Form)8 ViewNode (com.codename1.rad.nodes.ViewNode)7 GridLayout (com.codename1.ui.layouts.GridLayout)7 SimpleDateFormat (com.codename1.l10n.SimpleDateFormat)6 ResultParser (com.codename1.rad.io.ResultParser)6 Component (com.codename1.ui.Component)6 Element (com.codename1.xml.Element)6 BadgeUIID (com.codename1.rad.attributes.BadgeUIID)5 Thing (com.codename1.rad.schemas.Thing)5 Button (com.codename1.ui.Button)5 BoxLayout (com.codename1.ui.layouts.BoxLayout)5 Map (java.util.Map)5 Log (com.codename1.io.Log)4