Search in sources :

Example 36 with Node

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));
}
Also used : Container(com.codename1.ui.Container) BorderLayout(com.codename1.ui.layouts.BorderLayout) Layout(com.codename1.ui.layouts.Layout) BoxLayout(com.codename1.ui.layouts.BoxLayout) BorderLayout(com.codename1.ui.layouts.BorderLayout) GridLayout(com.codename1.ui.layouts.GridLayout)

Example 37 with Node

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));
}
Also used : FirstCharEntityImageRenderer(com.codename1.rad.ui.image.FirstCharEntityImageRenderer) ActionNode(com.codename1.rad.nodes.ActionNode) ListNode(com.codename1.rad.nodes.ListNode) Node(com.codename1.rad.nodes.Node) ActionsNode(com.codename1.rad.nodes.ActionsNode) ActionNode(com.codename1.rad.nodes.ActionNode) UIID(com.codename1.rad.attributes.UIID) ListNode(com.codename1.rad.nodes.ListNode)

Example 38 with Node

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);
}
Also used : ProfileAvatarView(com.codename1.rad.ui.entityviews.ProfileAvatarView) ViewNode(com.codename1.rad.nodes.ViewNode)

Example 39 with Node

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);
}
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 40 with Node

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;
}
Also used : ViewNode(com.codename1.rad.nodes.ViewNode) ListNode(com.codename1.rad.nodes.ListNode)

Aggregations

BorderLayout (com.codename1.ui.layouts.BorderLayout)11 ViewNode (com.codename1.rad.nodes.ViewNode)10 ActionNode (com.codename1.rad.nodes.ActionNode)8 Container (com.codename1.ui.Container)7 ListNode (com.codename1.rad.nodes.ListNode)6 PropertySelectorAttribute (com.codename1.rad.attributes.PropertySelectorAttribute)5 Node (com.codename1.rad.nodes.Node)5 BoxLayout (com.codename1.ui.layouts.BoxLayout)5 MultiButtonEntityView (com.codename1.rad.ui.entityviews.MultiButtonEntityView)4 Label (com.codename1.ui.Label)4 GridLayout (com.codename1.ui.layouts.GridLayout)4 Log (com.codename1.io.Log)3 NodeDecoratorAttribute (com.codename1.rad.attributes.NodeDecoratorAttribute)3 ViewPropertyParameterAttribute (com.codename1.rad.attributes.ViewPropertyParameterAttribute)3 Entity (com.codename1.rad.models.Entity)3 EntityList (com.codename1.rad.models.EntityList)3 EntityTypeBuilder.entityTypeBuilder (com.codename1.rad.models.EntityTypeBuilder.entityTypeBuilder)3 Thing (com.codename1.rad.schemas.Thing)3 WrapperEntityView (com.codename1.rad.ui.entityviews.WrapperEntityView)3 Button (com.codename1.ui.Button)3