Search in sources :

Example 1 with ShortcutActionHandler

use of com.vaadin.client.ui.ShortcutActionHandler in project cuba by cuba-platform.

the class CubaTreeConnector method updateFromUIDL.

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    super.updateFromUIDL(uidl, client);
    getWidget().setDoubleClickHandling(false);
    getWidget().nodeCaptionsAsHtml = uidl.getBooleanAttribute("nodeCaptionsAsHtml");
    // We may have actions attached to this tree
    if (uidl.getChildCount() > 1) {
        final int cnt = uidl.getChildCount();
        for (int i = 1; i < cnt; i++) {
            UIDL childUidl = uidl.getChildUIDL(i);
            if (childUidl.getTag().equals("shortcuts")) {
                if (getWidget().getShortcutActionHandler() == null) {
                    getWidget().setShortcutActionHandler(new ShortcutActionHandler(uidl.getId(), client));
                }
                getWidget().getShortcutActionHandler().updateActionMap(childUidl);
            }
        }
    }
}
Also used : ShortcutActionHandler(com.vaadin.client.ui.ShortcutActionHandler)

Example 2 with ShortcutActionHandler

use of com.vaadin.client.ui.ShortcutActionHandler in project cuba by cuba-platform.

the class CubaDateFieldConnector method updateFromUIDL.

@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
    super.updateFromUIDL(uidl, client);
    getWidget().updateTextState();
    // We may have actions attached to this text field
    if (uidl.getChildCount() > 0) {
        final int cnt = uidl.getChildCount();
        for (int i = 0; i < cnt; i++) {
            UIDL childUidl = uidl.getChildUIDL(i);
            if (childUidl.getTag().equals("actions")) {
                if (getWidget().getShortcutActionHandler() == null) {
                    getWidget().setShortcutActionHandler(new ShortcutActionHandler(uidl.getId(), client));
                }
                getWidget().getShortcutActionHandler().updateActionMap(childUidl);
            }
        }
    }
}
Also used : ShortcutActionHandler(com.vaadin.client.ui.ShortcutActionHandler) UIDL(com.vaadin.client.UIDL)

Aggregations

ShortcutActionHandler (com.vaadin.client.ui.ShortcutActionHandler)2 UIDL (com.vaadin.client.UIDL)1