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