Example usage for com.google.gwt.dev.cfg ConfigurationProperty getValues

List of usage examples for com.google.gwt.dev.cfg ConfigurationProperty getValues

Introduction

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

Prototype

public List<String> getValues() 

Source Link

Usage

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

License:Apache License

public com.google.gwt.core.ext.ConfigurationProperty getConfigurationProperty(String propertyName)
        throws BadPropertyValueException {
    ConfigurationProperty config = configPropertiesByName.get(propertyName);
    if (config == null) {
        throw new BadPropertyValueException(propertyName);
    }// ww w. j  a  va  2s. c o m
    return new DefaultConfigurationProperty(config.getName(), config.getValues());
}

From source file:xapi.dev.util.GenDebug.java

License:Open Source License

/**
 * In case you're too lazy to step through the debugger to find all set
 * properties, just make a call here to print out all known properties at gwt
 * compile time./* w  w w  .  j  a v  a2 s .  c o m*/
 *
 * @param oracle
 *          - The property oracle to inspect and print out
 */
public static void dumpProperties(final PropertyOracle oracle) {
    if (oracle instanceof SubsetFilteringPropertyOracle) {
        try {
            Field field = SubsetFilteringPropertyOracle.class.getDeclaredField("wrappedPropertyOracle");
            field.setAccessible(true);
            PropertyOracle subOracle = (PropertyOracle) field.get(oracle);
            dumpProperties(subOracle);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return;
    }
    if (oracle instanceof ModuleSpacePropertyOracle) {
        ModuleSpacePropertyOracle mod = (ModuleSpacePropertyOracle) oracle;
        Properties props;
        try {
            Field field = mod.getClass().getDeclaredField("props");
            field.setAccessible(true);
            props = (Properties) field.get(mod);
            for (BindingProperty binding : props.getBindingProperties()) {
                System.out.println(binding.getName() + " : " + binding.getConstrainedValue());
            }
            System.out.println();
            for (ConfigurationProperty prop : props.getConfigurationProperties()) {
                System.out.print(prop.getName() + " : ");
                System.out.println((prop.isMultiValued() || prop.allowsMultipleValues() ? prop.getValues()
                        : prop.getValue()));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else if (oracle instanceof DynamicPropertyOracle) {
        DynamicPropertyOracle stat = (DynamicPropertyOracle) oracle;
        System.out.println("Prescribed props: " + Arrays.asList(stat.getPrescribedPropertyValuesByName()));
        try {
            Properties configProps;
            Field field = stat.getClass().getDeclaredField("properties");
            field.setAccessible(true);
            configProps = (Properties) field.get(stat);
            System.out.println("Properties: ");
            for (ConfigurationProperty prop : configProps.getConfigurationProperties()) {
                System.out.print(prop.getName() + " : ");
                System.out.println((prop.isMultiValued() || prop.allowsMultipleValues() ? prop.getValues()
                        : prop.getValue()));
            }
        } catch (Exception e) {
            e.printStackTrace(System.out);
        }
    } else {
        System.out.println("Unhandled properties type: " + oracle.getClass() + ":\n" + oracle);
    }
}