Package com.google.gwt.core.ext

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


  @Override
  public final String generate(TreeLogger logger, final GeneratorContext context,
      String typeName) throws UnableToCompleteException {
    TypeOracle typeOracle = context.getTypeOracle();
    // Get the current locale and interface type.
    PropertyOracle propertyOracle = context.getPropertyOracle();
    LocaleUtils localeUtils = LocaleUtils.getInstance(logger, propertyOracle,
        context);

    JClassType targetClass;
    try {
View Full Code Here


   * @return the current locale
   */
  private static String getLocale(TreeLogger logger, GeneratorContext genContext) {
    String locale;
    try {
      PropertyOracle oracle = genContext.getPropertyOracle();
      SelectionProperty prop = oracle.getSelectionProperty(logger, "locale");
      locale = prop.getCurrentValue();
    } catch (BadPropertyValueException e) {
      locale = null;
    }
    return locale;
View Full Code Here

    // agree with one another
    //
    RemoteServiceAsyncValidator rsav = new RemoteServiceAsyncValidator(logger, typeOracle);
    Map<JMethod, JMethod> syncMethToAsyncMethMap = rsav.validate(logger, serviceIntf, serviceAsync);

    final PropertyOracle propertyOracle = context.getPropertyOracle();

    // Load the blacklist/whitelist
    TypeFilter blacklistTypeFilter = new BlacklistTypeFilter(logger, propertyOracle);

    // Determine the set of serializable types
View Full Code Here

    gssEnabled = false;

    String classPrefix;
    try {
      PropertyOracle propertyOracle =
        context.getGeneratorContext().getPropertyOracle();
      ConfigurationProperty styleProp =
        propertyOracle.getConfigurationProperty(KEY_STYLE);
      obfuscationStyle = CssObfuscationStyle.getObfuscationStyle(
          styleProp.getValues().get(0));

      ConfigurationProperty mergeProp =
        propertyOracle.getConfigurationProperty(KEY_MERGE_ENABLED);
      String merge = mergeProp.getValues().get(0);
      enableMerge = merge.equals("true");

      ConfigurationProperty classPrefixProp =
        propertyOracle.getConfigurationProperty(KEY_OBFUSCATION_PREFIX);
      classPrefix = classPrefixProp.getValues().get(0);

      // add these configuration properties to our requirements
      ClientBundleRequirements requirements = context.getRequirements();
      requirements.addConfigurationProperty(KEY_STYLE);
View Full Code Here

  }

  private boolean checkIfGssEnabled(ResourceContext context, TreeLogger logger)
      throws UnableToCompleteException {
    try {
      PropertyOracle propertyOracle =
          context.getGeneratorContext().getPropertyOracle();

      ConfigurationProperty enableGssProp =
          propertyOracle.getConfigurationProperty(KEY_ENABLE_GSS);
      String enableGss = enableGssProp.getValues().get(0);

      return "true".equals(enableGss);

    } catch (BadPropertyValueException ex) {
View Full Code Here

        sourceWriter.println("}");
    }

    private void generateMethods(SourceWriter sourceWriter, GeneratorContext context) throws Throwable
    {
        PropertyOracle propertyOracle = context.getPropertyOracle();
        String profile = failSafeGetProperty(propertyOracle, "console.profile", null);
        if (null == profile)
        {
            throw new BadPropertyValueException("Missing configuration property 'console.profile'!");
        }
View Full Code Here

  @Override
  public final String generate(TreeLogger logger, GeneratorContext context,
      String typeName) throws UnableToCompleteException {
    TypeOracle typeOracle = context.getTypeOracle();
    // Get the current locale and interface type.
    PropertyOracle propertyOracle = context.getPropertyOracle();
    String locale = null;
    String[] localeValues = null;
    try {
      locale = propertyOracle.getPropertyValue(logger, PROP_LOCALE);
      localeValues = propertyOracle.getPropertyValueSet(logger, PROP_LOCALE);
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.TRACE, "LocaleInfo used without I18N module, using defaults", e);
      return LocaleInfoImpl.class.getName();
    }
View Full Code Here

      ResourceFactory.clearCache();
      lastReloadCount = typeOracle.getReloadCount();
    }

    // Get the current locale and interface type.
    PropertyOracle propertyOracle = context.getPropertyOracle();
    String locale;
    try {
      // Look at the code for the "locale" property provider in
      // I18N.gwt.xml to see the possible values for the locale
      // property. Basically,
      //
      // 1) If the locale is specified by the user using a request parameter
      //    or a meta tag, AND
      // 2) The locale matches or is a parent of one of the locales
      //    exposed in the application's gwt.xml file, THEN
      //
      // the value returned by getPropertyValue() will be:
      //
      // a) the locale specified by the user, OR
      // b) the parent locale, if an exact match between the user-specified
      //    locale and the exposed locales cannot be found
      //
      // If the locale is not specified by the user as a request parameter
      // or via a meta tag, or if the locale is formatted incorrectly,
      // getPropertyValue() will return "default".
      locale = propertyOracle.getPropertyValue(logger, PROP_LOCALE);  
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Could not parse specified locale", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

      String typeName) throws UnableToCompleteException {
    assert CURRENCY_LIST.equals(typeName);
    TypeOracle typeOracle = context.getTypeOracle();

    // Get the current locale.
    PropertyOracle propertyOracle = context.getPropertyOracle();
    String locale = "default";
    try {
      locale = propertyOracle.getPropertyValue(logger, PROP_LOCALE);
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.WARN, "locale property not defined, using defaults", e);
    }

    JClassType targetClass;
View Full Code Here

    }

    Event generatorEvent =
        SpeedTracerLogger.start(type, "class", generatorClassName, "type", typeName);

    PropertyOracle originalPropertyOracle = propertyOracle;
    try {
      RebindResult result;
      // TODO(stalcup): refactor the Generator/PropertyOracle system (in a potentially backwards
      // incompatible way) so that all Generators are forced to accurately declare the names of
      // properties they care about.
View Full Code Here

TOP

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

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.