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