Package com.google.gwt.core.ext

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


            "[.$]", "_"));
    Set<String> permutationAxes = new HashSet<String>(requirements.axes);
    permutationAxes.add("locale");

    try {
      PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();
      for (String property : permutationAxes) {
        SelectionProperty prop = oracle.getSelectionProperty(logger, property);
        String value = prop.getCurrentValue();
        toReturn.append("_" + value);
      }
    } catch (BadPropertyValueException e) {
    }
View Full Code Here


        sourceWriter.outdent();
        sourceWriter.println("}");
    }

    private void generateMethods(SourceWriter sourceWriter, GeneratorContext context) throws Throwable {
        PropertyOracle propertyOracle = context.getPropertyOracle();

        // console.profile - mandatory
        String consoleProfile = failFastGetProperty(propertyOracle, "console.profile");
        sourceWriter.println("public ProductConfig.Profile getProfile() { ");
        sourceWriter.indent();
View Full Code Here

        packageName);
    PrintWriter printWriter = writers.tryToMakePrintWriterFor(implName);

    if (printWriter != null) {
      // BEGIN MODIFICATION
      PropertyOracle propertyOracle = genCtx.getPropertyOracle();
      generateOnce(interfaceType, implName, printWriter, logger, oracle,
          resourceOracle, propertyOracle, writers, designTime);
      // END MODIFICATION
    }
    return packageName + "." + implName;
View Full Code Here

  @Override
  public String generate(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException {

    TypeOracle typeOracle = context.getTypeOracle();
    PropertyOracle propOracle = context.getPropertyOracle();
    ResourceOracle resOracle = context.getResourcesOracle();
   
    JClassType classType;
    try {
      classType = typeOracle.getType(typeName);
    } catch (NotFoundException e) {
      e.printStackTrace();
      return null;
    }
   
    SelectionProperty localeProperty = null;
    try {
      localeProperty = propOracle.getSelectionProperty(logger, "locale");
    } catch (BadPropertyValueException e) {
      e.printStackTrace();
    }
   
    String locale = localeProperty.getCurrentValue();
View Full Code Here

      /*
       * The developer may choose to force strict behavior onto the system. If
       * the method does already have the @Strict annotation, print a warning.
       */
      try {
        PropertyOracle propertyOracle = context.getGeneratorContext().getPropertyOracle();
        String propertyValue = propertyOracle.getPropertyValue(logger,
            "CssResource.forceStrict");
        if (Boolean.valueOf(propertyValue)) {
          logger.log(TreeLogger.WARN, "CssResource.forceStrict is true, but "
              + method.getName() + "() is missing the @Strict annotation.");
          strict = true;
View Full Code Here

  @Override
  public void init(TreeLogger logger, ResourceContext context)
      throws UnableToCompleteException {
    try {
      PropertyOracle propertyOracle = context.getGeneratorContext().getPropertyOracle();
      String style = propertyOracle.getPropertyValue(logger,
          "CssResource.style").toLowerCase();
      prettyOutput = style.equals("pretty");

      String merge = propertyOracle.getPropertyValue(logger,
          "CssResource.enableMerge").toLowerCase();
      enableMerge = merge.equals("true");

      classPrefix = propertyOracle.getPropertyValue(logger,
          "CssResource.globalPrefix");
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.WARN, "Unable to query module property", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

      }
    }

    String locale;
    try {
      PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();
      locale = oracle.getPropertyValue(logger, "locale");
    } catch (BadPropertyValueException e) {
      locale = null;
    }

    URL[] toReturn = new URL[resources.length];
View Full Code Here

  @Override
  public String generate(TreeLogger logger, GeneratorContext context,
      String typeName) throws UnableToCompleteException {
    // The TypeOracle knows about all types in the type system
    TypeOracle typeOracle = context.getTypeOracle();
    PropertyOracle propertyOracle = context.getPropertyOracle();
    String[] views = new String[0];
    String viewsProperty;
    try {
      viewsProperty = propertyOracle.getPropertyValue(logger,
          GADGET_VIEW_PROPERTY);
      views = viewsProperty.split(",");
    } catch (BadPropertyValueException e) {
      throw new UnableToCompleteException();
    }
View Full Code Here

    PrintWriter pw = context.tryCreate(logger, packageName, className + "Impl");
    if (pw != null) {
      SourceWriter sw = composerFactory.createSourceWriter(context, pw);

      PropertyOracle propertyOracle = context.getPropertyOracle();
      String logPattern;
      try {
        ConfigurationProperty logPatternProperty = propertyOracle.getConfigurationProperty(PROPERTY_LOG_PATTERN);
        List<String> values = logPatternProperty.getValues();
        logPattern = values.get(0);
      } catch (BadPropertyValueException e) {
        logger.log(TreeLogger.ERROR, "Unable to find value for '" + PROPERTY_LOG_PATTERN + "'", e);
        throw new UnableToCompleteException();
View Full Code Here

    PrintWriter pw = context.tryCreate(logger, packageName, className + "Impl");
    if (pw != null) {
      SourceWriter sw = composerFactory.createSourceWriter(context, pw);

      PropertyOracle propertyOracle = context.getPropertyOracle();
      String logPattern;
      try {
        ConfigurationProperty logPatternProperty = propertyOracle.getConfigurationProperty(PROPERTY_LOG_PATTERN);
        List<String> values = logPatternProperty.getValues();
        logPattern = values.get(0);
      } catch (BadPropertyValueException e) {
        logger.log(TreeLogger.ERROR, "Unable to find value for '" + PROPERTY_LOG_PATTERN + "'", e);
        throw new UnableToCompleteException();
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.