Search in sources :

Example 1 with EntityListView

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

the class DefaultEntityListCellRenderer method getListCellRendererComponent.

@Override
public EntityView getListCellRendererComponent(EntityListView list, Entity value, int index, boolean isSelected, boolean isFocused) {
    ListNode listNode = (ListNode) list.getViewNode();
    MultiButtonEntityView out = new MultiButtonEntityView(value, listNode.getRowTemplate());
    ActionNode node = listNode.getAction(ActionCategories.LIST_SELECT_ACTION);
    if (node != null) {
        out.setAction(node);
    }
    return makeSwipeable(value, listNode.getRowTemplate(), out);
}
Also used : ActionNode(com.codename1.rad.nodes.ActionNode) MultiButtonEntityView(com.codename1.rad.ui.entityviews.MultiButtonEntityView) ListNode(com.codename1.rad.nodes.ListNode)

Example 2 with EntityListView

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

the class EntityEditor method buildList.

private void buildList() {
    if (entity instanceof EntityList) {
        EntityListView listView = new EntityListView((EntityList) entity, getRootList());
        add(BorderLayout.CENTER, listView);
    }
}
Also used : EntityListView(com.codename1.rad.ui.entityviews.EntityListView) EntityList(com.codename1.rad.models.EntityList)

Example 3 with EntityListView

use of com.codename1.rad.ui.entityviews.EntityListView in project CodenameOne by codenameone.

the class EntityListTransactionsSample method start.

public void start() {
    if (current != null) {
        current.show();
        return;
    }
    entityList = new EntityList();
    entityListView = new ProfileListView(entityList);
    entityListView.setScrollableY(true);
    Button addTen = new Button("Add 10 rows");
    addTen.addActionListener(evt -> {
        addRows(10);
    });
    Button addHundred = new Button("Add 100 rows");
    addHundred.addActionListener(evt -> {
        addRows(100);
    });
    Button removeTen = new Button("Remove 10 rows");
    removeTen.addActionListener(evt -> {
        removeRows(10);
    });
    Form hi = new Form("Hi World", new BorderLayout());
    hi.add(NORTH, GridLayout.encloseIn(3, addTen, addHundred, removeTen));
    hi.add(CENTER, entityListView);
    hi.show();
}
Also used : BorderLayout(com.codename1.ui.layouts.BorderLayout) Button(com.codename1.ui.Button) Form(com.codename1.ui.Form) EntityList(com.codename1.rad.models.EntityList) ProfileListView(com.codename1.rad.ui.entityviews.ProfileListView)

Example 4 with EntityListView

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

Aggregations

EntityList (com.codename1.rad.models.EntityList)3 PropertySelector (com.codename1.rad.models.PropertySelector)1 ActionNode (com.codename1.rad.nodes.ActionNode)1 ListNode (com.codename1.rad.nodes.ListNode)1 EntityListView (com.codename1.rad.ui.entityviews.EntityListView)1 MultiButtonEntityView (com.codename1.rad.ui.entityviews.MultiButtonEntityView)1 ProfileListView (com.codename1.rad.ui.entityviews.ProfileListView)1 Button (com.codename1.ui.Button)1 Form (com.codename1.ui.Form)1 BorderLayout (com.codename1.ui.layouts.BorderLayout)1