Example usage for com.google.gwt.user.datepicker.client DatePicker removeStyleFromDates

List of usage examples for com.google.gwt.user.datepicker.client DatePicker removeStyleFromDates

Introduction

In this page you can find the example usage for com.google.gwt.user.datepicker.client DatePicker removeStyleFromDates.

Prototype

public void removeStyleFromDates(String styleName, Iterable<Date> dates) 

Source Link

Document

Removes the styleName from the given dates (even if it is transient).

Usage

From source file:com.ponysdk.ui.terminal.ui.PTDatePicker.java

License:Apache License

@Override
public void update(final PTInstruction update, final UIService uiService) {
    final DatePicker picker = cast();
    if (update.containsKey(PROPERTY.VALUE)) {
        picker.setValue(asDate(update.getString(PROPERTY.VALUE)));
    } else if (update.containsKey(PROPERTY.MONTH)) {
        picker.setCurrentMonth(asDate(update.getString(PROPERTY.MONTH)));
    } else if (update.containsKey(PROPERTY.DATE_ENABLED)) {
        final Boolean enabled = update.getBoolean(PROPERTY.ENABLED);
        final JSONArray jsonArray = update.get(PROPERTY.DATE_ENABLED).isArray();
        for (int i = 0; i < jsonArray.size(); i++) {
            picker.setTransientEnabledOnDates(enabled, asDate(jsonArray.get(i).isString().stringValue()));
        }//from  www .  j av a 2s .c o  m
    } else if (update.containsKey(PROPERTY.ADD_DATE_STYLE)) {
        final String style = update.getString(PROPERTY.STYLE_NAME);
        final JSONArray jsonArray = update.get(PROPERTY.ADD_DATE_STYLE).isArray();
        for (int i = 0; i < jsonArray.size(); i++) {
            picker.addStyleToDates(style, asDate(jsonArray.get(i).isString().stringValue()));
        }
    } else if (update.containsKey(PROPERTY.REMOVE_DATE_STYLE)) {
        final String style = update.getString(PROPERTY.STYLE_NAME);
        final JSONArray jsonArray = update.get(PROPERTY.REMOVE_DATE_STYLE).isArray();
        for (int i = 0; i < jsonArray.size(); i++) {
            picker.removeStyleFromDates(style, asDate(jsonArray.get(i).isString().stringValue()));
        }
    } else {
        super.update(update, uiService);
    }
}