Package com.google.gwt.core.ext

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


      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


    // 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

        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

    PropertyOracle propertyOracle = context.getPropertyOracle();

    // See if filename obfuscation should be enabled
    String enableRenaming = null;
    try {
      ConfigurationProperty prop = propertyOracle.getConfigurationProperty(ENABLE_RENAMING);
      enableRenaming = prop.getValues().get(0);
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Bad value for " + ENABLE_RENAMING, e);
      throw new UnableToCompleteException();
    }
View Full Code Here

   * property.
   * @return a Set of Strings, or null.
   */
  static Set<String> getEnhancedTypes(PropertyOracle propertyOracle) {
    try {
      ConfigurationProperty prop = propertyOracle.getConfigurationProperty(RPC_ENHANCED_CLASSES);
      return Collections.unmodifiableSet(new HashSet<String>(prop.getValues()));
    } catch (BadPropertyValueException e) {
      return null;
    }
  }
View Full Code Here

  private final RpcBlacklist blacklist;
  private TreeLogger logger;

  public BlacklistTypeFilter(TreeLogger logger, PropertyOracle propertyOracle)
      throws UnableToCompleteException {
    ConfigurationProperty prop;
    try {
      prop = propertyOracle.getConfigurationProperty(PROP_RPC_BLACKLIST);
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Could not find property "
          + PROP_RPC_BLACKLIST);
      throw new UnableToCompleteException();
    }

    this.logger = logger.branch(TreeLogger.DEBUG,
        "Analyzing RPC blacklist information");
    blacklist = new RpcBlacklist(logger, prop.getValues());
  }
View Full Code Here

    addRoots(logger, typeOracle, typesSentFromBrowserBuilder,
        typesSentToBrowserBuilder);

    try {
      ConfigurationProperty prop = context.getPropertyOracle().getConfigurationProperty(
          TypeSerializerCreator.GWT_ELIDE_TYPE_NAMES_FROM_RPC);
      elideTypeNames = Boolean.parseBoolean(prop.getValues().get(0));
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Configuration property "
          + TypeSerializerCreator.GWT_ELIDE_TYPE_NAMES_FROM_RPC
          + " is not defined. Is RemoteService.gwt.xml inherited?");
      throw new UnableToCompleteException();
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.