Example usage for com.google.gwt.dev.cfg BindingProperty getFallbackValuesMap

List of usage examples for com.google.gwt.dev.cfg BindingProperty getFallbackValuesMap

Introduction

In this page you can find the example usage for com.google.gwt.dev.cfg BindingProperty getFallbackValuesMap.

Prototype

public Map<String, ? extends List<? extends Set<String>>> getFallbackValuesMap() 

Source Link

Document

Returns the map of values to fall back values.

Usage

From source file:com.googlecode.gwt.test.internal.handlers.StaticPropertyOracle.java

License:Apache License

public com.google.gwt.core.ext.SelectionProperty getSelectionProperty(TreeLogger logger, String propertyName)
        throws BadPropertyValueException {
    // In practice there will probably be so few properties that a linear
    // search is at least as fast as a map lookup by name would be.
    // If that turns out not to be the case, the ctor could build a
    // name-to-index map.
    for (int i = 0; i < orderedProps.length; i++) {
        final BindingProperty prop = orderedProps[i];
        final String name = prop.getName();
        if (name.equals(propertyName)) {
            final String value = orderedPropValues[i];
            String[] values = prop.getDefinedValues();
            final TreeSet<String> possibleValues = new TreeSet<String>();
            for (String v : values) {
                possibleValues.add(v);//from w  w w  . j a va2  s.  c  o m
            }
            return new DefaultSelectionProperty(value, prop.getFallback(), name, possibleValues,
                    prop.getFallbackValuesMap());
        }
    }
    throw new BadPropertyValueException(propertyName);
}