Search in sources :

Example 31 with UIID

use of com.codename1.rad.attributes.UIID in project CodeRAD by shannah.

the class PropertyView method update.

public void update() {
    String oldUiid = getComponent().getUIID();
    UIID newUIID = (UIID) getField().findAttribute(UIID.class);
    if (newUIID != null) {
        String newUIIDStr = newUIID.getValue(getEntity());
        if (newUIIDStr != null && !Objects.equals(newUIIDStr, oldUiid)) {
            getComponent().setUIID(newUIIDStr);
        }
    }
}
Also used : UIID(com.codename1.rad.attributes.UIID)

Example 32 with UIID

use of com.codename1.rad.attributes.UIID 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 33 with UIID

use of com.codename1.rad.attributes.UIID in project CodeRAD by shannah.

the class TabsEntityView method createTabs.

protected Tabs createTabs() {
    Tabs out = new Tabs();
    out.setTabPlacement(TOP);
    UIID uiid = (UIID) node.findAttribute(UIID.class);
    if (uiid != null) {
        out.setUIID(uiid.getValue());
    }
    return out;
}
Also used : UIID(com.codename1.rad.attributes.UIID) Tabs(com.codename1.ui.Tabs)

Example 34 with UIID

use of com.codename1.rad.attributes.UIID 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)

Aggregations

UIID (com.codename1.rad.attributes.UIID)7 Style (com.codename1.ui.plaf.Style)7 Container (com.codename1.ui.Container)4 BorderLayout (com.codename1.ui.layouts.BorderLayout)4 File (java.io.File)4 Component (com.codename1.ui.Component)3 Label (com.codename1.ui.Label)3 UIManager (com.codename1.ui.plaf.UIManager)3 IOException (java.io.IOException)3 ComponentImage (ca.weblite.shared.components.ComponentImage)2 MultiButton (com.codename1.components.MultiButton)2 BadgeUIID (com.codename1.rad.attributes.BadgeUIID)2 IconUIID (com.codename1.rad.attributes.IconUIID)2 ActionNode (com.codename1.rad.nodes.ActionNode)2 ListNode (com.codename1.rad.nodes.ListNode)2 Node (com.codename1.rad.nodes.Node)2 EntityView (com.codename1.rad.ui.EntityView)2 Button (com.codename1.ui.Button)2 Font (com.codename1.ui.Font)2 Image (com.codename1.ui.Image)2