Search in sources :

Example 11 with EntityView

use of com.codename1.rad.ui.EntityView in project CodeRAD by shannah.

the class TabsEntityView method createListTab.

private EntityView createListTab(ListNode ln) {
    PropertySelector selector = ln.createPropertySelector(getEntity());
    if (selector == null) {
        return null;
    }
    EntityList tabEntity = selector.getEntityList(null);
    if (tabEntity == null) {
        return null;
    }
    ln.setAttributesIfNotExists(UI.param(SCROLLABLE_Y, true));
    return new EntityListView(tabEntity, ln);
}
Also used : PropertySelector(com.codename1.rad.models.PropertySelector) EntityList(com.codename1.rad.models.EntityList)

Example 12 with EntityView

use of com.codename1.rad.ui.EntityView 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)

Example 13 with EntityView

use of com.codename1.rad.ui.EntityView in project CodeRAD by shannah.

the class TabsEntityView method initUI.

private void initUI() {
    tabs = createTabs();
    for (Node n : getViewNode().getChildNodes()) {
        UIID uiid = (UIID) n.findAttribute(UIID.class);
        if (uiid != null) {
            tabs.setTabUIID(uiid.getValue());
        }
        Label l = (Label) n.findAttribute(Label.class);
        if (l == null) {
            continue;
        }
        EntityView content = createTab(n);
        if (content == null) {
            continue;
        }
        tabs.addTab(l.getValue(getEntity().getEntity()), (Component) content);
    }
    setLayout(new BorderLayout());
    add(BorderLayout.CENTER, tabs);
}
Also used : BorderLayout(com.codename1.ui.layouts.BorderLayout) AbstractEntityView(com.codename1.rad.ui.AbstractEntityView) EntityView(com.codename1.rad.ui.EntityView) ViewNode(com.codename1.rad.nodes.ViewNode) ListNode(com.codename1.rad.nodes.ListNode) Node(com.codename1.rad.nodes.Node) UIID(com.codename1.rad.attributes.UIID) Label(com.codename1.rad.models.Property.Label)

Example 14 with EntityView

use of com.codename1.rad.ui.EntityView in project CodeRAD by shannah.

the class TabsEntityView method createTab.

private EntityView createTab(Node node) {
    ViewNode vn = (ViewNode) node.as(ViewNode.class);
    if (vn != null) {
        return createViewTab(vn);
    }
    ListNode ln = (ListNode) node.as(ListNode.class);
    if (ln != null) {
        return createListTab(ln);
    }
    return null;
}
Also used : ViewNode(com.codename1.rad.nodes.ViewNode) ListNode(com.codename1.rad.nodes.ListNode)

Aggregations

EntityView (com.codename1.rad.ui.EntityView)5 Component (com.codename1.ui.Component)5 Container (com.codename1.ui.Container)5 Entity (com.codename1.rad.models.Entity)4 ActionNode (com.codename1.rad.nodes.ActionNode)4 ViewNode (com.codename1.rad.nodes.ViewNode)4 AbstractEntityView (com.codename1.rad.ui.AbstractEntityView)4 MultiButtonEntityView (com.codename1.rad.ui.entityviews.MultiButtonEntityView)4 ListNode (com.codename1.rad.nodes.ListNode)3 WrapperEntityView (com.codename1.rad.ui.entityviews.WrapperEntityView)3 Badge (com.codename1.rad.attributes.Badge)2 BadgeUIID (com.codename1.rad.attributes.BadgeUIID)2 Condition (com.codename1.rad.attributes.Condition)2 SelectedCondition (com.codename1.rad.attributes.SelectedCondition)2 EntityList (com.codename1.rad.models.EntityList)2 PropertySelector (com.codename1.rad.models.PropertySelector)2 EnabledCondition (com.codename1.rad.nodes.ActionNode.EnabledCondition)2 SwipeContainer (com.codename1.rad.nodes.SwipeContainer)2 Form (com.codename1.ui.Form)2 SwipeableContainer (com.codename1.ui.SwipeableContainer)2