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);
}
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);
}
}
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();
}
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);
}
Aggregations