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


    try {
      // no further additions to the permutation axes allowed after this point
      requirements.lockPermutationAxes();
     
      PropertyOracle oracle = context.getGeneratorContext().getPropertyOracle();
      for (String property : requirements.getPermutationAxes()) {
        SelectionProperty prop = oracle.getSelectionProperty(logger, property);
        String value = prop.getCurrentValue();
        toReturn.append("_" + value);
      }
    } catch (BadPropertyValueException e) {
    }
View Full Code Here

  @Override
  public void init(TreeLogger logger, ResourceContext context)
      throws UnableToCompleteException {
    String classPrefix;
    try {
      PropertyOracle propertyOracle =
        context.getGeneratorContext().getPropertyOracle();
      ConfigurationProperty styleProp =
        propertyOracle.getConfigurationProperty(KEY_STYLE);
      String style = styleProp.getValues().get(0);
      prettyOutput = style.equals("pretty");

      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

  public String deploy(String suggestedFileName, String mimeType, byte[] data,
      boolean forceExternal) throws UnableToCompleteException {
    TreeLogger logger = getLogger();
    GeneratorContext context = getGeneratorContext();
    PropertyOracle propertyOracle = context.getPropertyOracle();

    // See if filename obfuscation should be enabled
    String enableRenaming = null;
    try {
      ConfigurationProperty prop = propertyOracle.getConfigurationProperty(ENABLE_RENAMING);
      getRequirements().addConfigurationProperty(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

      logger.log(TreeLogger.ERROR, remoteService.getQualifiedSourceName()
          + " is not an interface", null);
      throw new UnableToCompleteException();
    }

    PropertyOracle propertyOracle = context.getPropertyOracle();

    boolean userAgentRuntimeWarning = true;
    try {
      ConfigurationProperty property =
          propertyOracle.getConfigurationProperty(PROPERTY_USER_AGENT_RUNTIME_WARNING);
      userAgentRuntimeWarning = Boolean.valueOf(property.getValues().get(0));
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.WARN, "Unable to find value for '"
          + PROPERTY_USER_AGENT_RUNTIME_WARNING + "'", e);
    }

    String userAgentValue;
    SelectionProperty selectionProperty;
    try {
      selectionProperty = propertyOracle.getSelectionProperty(logger,
          PROPERTY_USER_AGENT);
      userAgentValue = selectionProperty.getCurrentValue();
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Unable to find value for '"
          + PROPERTY_USER_AGENT + "'", e);
View Full Code Here

   * @param context
   * @return
   */
  public GwtLocale getCurrentGenerationLocale(TreeLogger logger, GeneratorContext context) {
      // Get the current locale
      PropertyOracle propertyOracle = context.getPropertyOracle();
      LocaleUtils localeUtils = LocaleUtils.getInstance(logger, propertyOracle, context);
      GwtLocale locale = localeUtils.getCompileLocale();
      return locale;     
  }
View Full Code Here

  @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

  @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

    if (userType.isInterface() == null) {
      logger.log(TreeLogger.ERROR, userType.getQualifiedSourceName() + " is not an interface", null);
      throw new UnableToCompleteException();
    }

    PropertyOracle propertyOracle = context.getPropertyOracle();

    String userAgentValue;
    SelectionProperty selectionProperty;
    try {
      selectionProperty = propertyOracle.getSelectionProperty(logger, PROPERTY_USER_AGENT);
      userAgentValue = selectionProperty.getCurrentValue();
    } catch (BadPropertyValueException e) {
      logger.log(TreeLogger.ERROR, "Unable to find value for '" + PROPERTY_USER_AGENT + "'", e);
      throw new UnableToCompleteException();
    }
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.