com.google.gwt.core.ext.ConfigurationProperty Java Examples

The following examples show how to use com.google.gwt.core.ext.ConfigurationProperty. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GssResourceGenerator.java    From gss.gwt with Apache License 2.0 6 votes vote down vote up
private Set<String> getPermutationsConditions(ResourceContext context,
    List<String> permutationAxes) {
  Builder<String> setBuilder = ImmutableSet.builder();
  PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();

  for (String permutationAxis : permutationAxes) {
    String propValue = null;
    try {
      SelectionProperty selProp = oracle.getSelectionProperty(null,
          permutationAxis);
      propValue = selProp.getCurrentValue();
    } catch (BadPropertyValueException e) {
      try {
        ConfigurationProperty confProp = oracle.getConfigurationProperty(permutationAxis);
        propValue = confProp.getValues().get(0);
      } catch (BadPropertyValueException e1) {
        e1.printStackTrace();
      }
    }

    if (propValue != null) {
      setBuilder.add(permutationAxis + ":" + propValue);
    }
  }
  return setBuilder.build();
}
 
Example #2
Source File: ProductConfigGenerator.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private String failFastGetProperty(PropertyOracle propertyOracle, String name) throws BadPropertyValueException {
    ConfigurationProperty property = propertyOracle.getConfigurationProperty(name);
    if (property != null) {
        List<String> values = property.getValues();
        if (values != null && !values.isEmpty()) {
            return values.get(0);
        } else {
            throw new BadPropertyValueException("Missing configuration property '" + name + "'!");
        }
    } else {
        throw new BadPropertyValueException("Missing configuration property '" + name + "'!");
    }
}
 
Example #3
Source File: ProductConfigGenerator.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private String failSafeGetProperty(PropertyOracle propertyOracle, String name, String defaultValue) {
    String value = defaultValue;
    try {
        ConfigurationProperty property = propertyOracle.getConfigurationProperty(name);
        if (property != null) {
            List<String> values = property.getValues();
            if (values != null && !values.isEmpty()) {
                value = values.get(0);
            }
        }
    } catch (BadPropertyValueException e) {
        // ignore and return defaul value
    }
    return value;
}
 
Example #4
Source File: PropertyOracleStub.java    From mvp4g with Apache License 2.0 4 votes vote down vote up
public ConfigurationProperty getConfigurationProperty(String propertyName)
  throws BadPropertyValueException {
  // nothing to do
  return null;
}