use of com.codename1.rad.nodes.Node in project CodeRAD by shannah.
the class NodeUtilFunctions method buildTopActionsBar.
static void buildTopActionsBar(Node node, Container target, Entity entity) {
Layout targetLayout = target.getLayout();
if (targetLayout instanceof BorderLayout) {
Container north = new Container(BoxLayout.y());
target.add(NORTH, north);
target = north;
}
buildActionsBar(node, target, entity, node.getActions(FormNode.TOP_RIGHT_MENU), node.getActions(FormNode.TOP_LEFT_MENU), node.getActions(FormNode.OVERFLOW_MENU), node.getActions(FormNode.TOP_MENU));
}
use of com.codename1.rad.nodes.Node in project CodeRAD by shannah.
the class ContactListDecorator method decorate.
@Override
public void decorate(Node node) {
if (!(node instanceof ListNode)) {
return;
}
ListNode listNode = (ListNode) node;
Node rowTemplate = listNode.getRowTemplate();
rowTemplate.setAttributes(UI.param(MultiButtonEntityView.LINE1_UIID, "ContactListLine1"));
rowTemplate.setAttributes(UI.param(MultiButtonEntityView.LINE2_UIID, "ContactListLine2"));
for (ActionNode n : rowTemplate.getActions(ActionCategories.LEFT_SWIPE_MENU)) {
n.setAttributes(UI.actionStyle(ActionStyle.IconOnly));
n.setAttributes(new UIID("SwipeableContainerButton"));
}
ActionNode removeAction = listNode.getAction(ActionCategories.LIST_REMOVE_ACTION);
if (removeAction != null) {
removeAction.setAttributes(UI.actionStyle(ActionStyle.IconOnly));
removeAction.setAttributes(new UIID("SwipeableContainerButton"));
}
// swipeLeftNode.setAttributes(LEFT_SWIPE_MENU);
// listNode.getRowTemplate().setAttributes(swipeLeftNode);
node.setAttributes(iconRenderer(new FirstCharEntityImageRenderer(10)));
node.setAttributes(UI.param(MultiButtonEntityView.ICON, Thing.name));
}
use of com.codename1.rad.nodes.Node 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);
}
use of com.codename1.rad.nodes.Node 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.nodes.Node 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