Package com.google.gwt.core.ext

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


        copyFile(srcFile, destFile, filter, assets);
    }
  }

  private AssetFilter getAssetFilter (GeneratorContext context) {
    ConfigurationProperty assetFilterClassProperty = null;
    try {
      assetFilterClassProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetfilterclass");
    } catch (BadPropertyValueException e) {
      return new DefaultAssetFilter();
    }
    if (assetFilterClassProperty.getValues().size() == 0) {
      return new DefaultAssetFilter();
    }
    String assetFilterClass = assetFilterClassProperty.getValues().get(0);
    if (assetFilterClass == null) return new DefaultAssetFilter();
    try {
      return (AssetFilter)Class.forName(assetFilterClass).newInstance();
    } catch (Exception e) {
      throw new RuntimeException("Couldn't instantiate custom AssetFilter '" + assetFilterClass
View Full Code Here


        + "', make sure the class is public and has a public default constructor", e);
    }
  }

  private String getAssetPath (GeneratorContext context) {
    ConfigurationProperty assetPathProperty = null;
    try {
      assetPathProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetpath");
    } catch (BadPropertyValueException e) {
      throw new RuntimeException(
        "No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
    }
    if (assetPathProperty.getValues().size() == 0) {
      throw new RuntimeException(
        "No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
    }
    String paths = assetPathProperty.getValues().get(0);
    if(paths == null) {
      throw new RuntimeException(
        "No gdx.assetpath defined. Add <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> to your GWT projects gwt.xml file");
    } else {
      ArrayList<String> existingPaths = new ArrayList<String>();
View Full Code Here

        "No valid gdx.assetpath defined. Fix <set-configuration-property name=\"gdx.assetpath\" value=\"relative/path/to/assets/\"/> in your GWT projects gwt.xml file");
    }
  }
 
  private String getAssetOutputPath (GeneratorContext context) {
    ConfigurationProperty assetPathProperty = null;
    try {
      assetPathProperty = context.getPropertyOracle().getConfigurationProperty("gdx.assetoutputpath");
    } catch (BadPropertyValueException e) {
      return null;
    }
    if (assetPathProperty.getValues().size() == 0) {
      return null;
    }
    String paths = assetPathProperty.getValues().get(0);
    if(paths == null) {
      return null;
    } else {
      ArrayList<String> existingPaths = new ArrayList<String>();
      String[] tokens = paths.split(",");
View Full Code Here

  }

  private List<String> getClasspathFiles(GeneratorContext context) {
    List<String> classpathFiles = new ArrayList<String>();
    try {
      ConfigurationProperty prop = context.getPropertyOracle().getConfigurationProperty("gdx.files.classpath");
      for (String value : prop.getValues()) {
        classpathFiles.add(value);
      }
    } catch (BadPropertyValueException e) {
      // Ignore
    }   
View Full Code Here

      throws UnableToCompleteException {
    super.init(logger, context);

    try {
      // get module base url config value
      ConfigurationProperty property =
          context.getGeneratorContext().getPropertyOracle().getConfigurationProperty("mgwt.css.inject");
      injectAtStart = "start".equals(property.getValues().get(0));
    } catch (BadPropertyValueException e) {
      // if we can`t find it die
      logger
          .log(TreeLogger.ERROR,
              "Configuration property mgwt.css.inject is not defined. Is UI.gwt.xml inherited?");
View Full Code Here

    return fullName;
  }

  private String getSingleValue(PropertyOracle propertyOracle, String name, TreeLogger logger) throws UnableToCompleteException {
    ConfigurationProperty configProperty = getConfigurationProperty(propertyOracle, logger, name);
    return configProperty.getValues().get(0);
  }
View Full Code Here

    ConfigurationProperty configProperty = getConfigurationProperty(propertyOracle, logger, name);
    return configProperty.getValues().get(0);
  }

  private List<String> getValues(PropertyOracle propertyOracle, String name, TreeLogger logger) throws UnableToCompleteException {
    ConfigurationProperty configProperty = getConfigurationProperty(propertyOracle, logger, name);
    return configProperty.getValues();
  }
View Full Code Here

  @Override
  public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {
    // get the property oracle
    PropertyOracle propertyOracle = context.getPropertyOracle();
    ConfigurationProperty property = null;
    try {
      // get mgwt.superdevmode variable
      property = propertyOracle.getConfigurationProperty("mgwt.superdevmode");
    } catch (BadPropertyValueException e) {
      // if we can`t find it die
      logger.log(TreeLogger.ERROR, "can not resolve mgwt.superdevmode variable", e);
      throw new UnableToCompleteException();
    }

    ConfigurationProperty superDevModeServer = null;
    try {
      // get mgwt.superdevmode variable
      superDevModeServer = propertyOracle.getConfigurationProperty("mgwt.superdevmode_host");
    } catch (BadPropertyValueException e) {
      // if we can`t find it die
View Full Code Here

    // filter reflection scope based on configuration in gwt xml module
    boolean keep = false;
    String name = type.getQualifiedSourceName();
    try {
      ConfigurationProperty prop;
      keep |= !name.contains(".");
      prop = context.getPropertyOracle().getConfigurationProperty("gdx.reflect.include");
      for (String s : prop.getValues())
        keep |= name.contains(s);
      prop = context.getPropertyOracle().getConfigurationProperty("gdx.reflect.exclude");
      for (String s : prop.getValues())
        keep &= !name.equals(s);
    } catch (BadPropertyValueException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
View Full Code Here

      throws UnableToCompleteException {
    return getSingleValuedConfigurationProperty(MENU_ELEMENT_ID_CONFIG_PROPERTY, logger, context);
  }

  private String getSingleValuedConfigurationProperty(String propertyName, TreeLogger logger, GeneratorContext context) throws UnableToCompleteException {
    ConfigurationProperty property;
    try {
      property = context.getPropertyOracle().getConfigurationProperty(
          propertyName);
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.Type.ERROR,
          "Missing configuration parameter: "
              + propertyName, e);
      throw new UnableToCompleteException();
    }

    // non-multi-valued property
    return property.getValues().get(0);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.ConfigurationProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.