Examples of BindingProperty


Examples of com.google.gwt.dev.cfg.BindingProperty

  void compileForWebMode(ModuleDef module, String... userAgents) throws UnableToCompleteException {
    if (userAgents != null && userAgents.length > 0) {
      Properties props = module.getProperties();
      Property userAgent = props.find("user.agent");
      if (userAgent instanceof BindingProperty) {
        BindingProperty bindingProperty = (BindingProperty) userAgent;
        bindingProperty.setAllowedValues(bindingProperty.getRootCondition(), userAgents);
      }
    }
    if (!new Compiler(options).run(getTopLogger(), module)) {
      throw new UnableToCompleteException();
    }
View Full Code Here

Examples of com.google.gwt.dev.cfg.BindingProperty

      throws UnableToCompleteException {
    if (userAgents != null && userAgents.length > 0) {
      Properties props = module.getProperties();
      Property userAgent = props.find("user.agent");
      if (userAgent instanceof BindingProperty) {
        BindingProperty bindingProperty = (BindingProperty) userAgent;
        bindingProperty.setAllowedValues(bindingProperty.getRootCondition(),
            userAgents);
      }
    }
    if (!new Compiler(options).run(getTopLogger(), module)) {
      throw new UnableToCompleteException();
View Full Code Here

Examples of com.google.gwt.dev.cfg.BindingProperty

  private static String collapse(StaticPropertyOracle... oracles) {
    // The map used to create the string key
    SortedMap<String, SortedSet<String>> collapsedPropertyMap = new TreeMap<String, SortedSet<String>>();
    for (StaticPropertyOracle oracle : oracles) {
      for (int i = 0, j = oracle.getOrderedProps().length; i < j; i++) {
        BindingProperty prop = oracle.getOrderedProps()[i];
        String value = oracle.getOrderedPropValues()[i];
        boolean isCollapsed = false;

        // Iterate over the equivalence sets defined in the property
        for (Set<String> equivalenceSet : prop.getCollapsedValues()) {
          if (equivalenceSet.contains(value)) {
            /*
             * If we find a set that contains the current value, add all the
             * values in the set. This accounts for the transitive nature of
             * equality.
             */
            SortedSet<String> toAdd = collapsedPropertyMap.get(prop.getName());
            if (toAdd == null) {
              toAdd = new TreeSet<String>();
              collapsedPropertyMap.put(prop.getName(), toAdd);
              isCollapsed = true;
            }
            toAdd.addAll(equivalenceSet);
          }
        }
        if (!isCollapsed) {
          // For "hard" properties, add the singleton value
          collapsedPropertyMap.put(prop.getName(), new TreeSet<String>(
              Arrays.asList(value)));
        }
      }
    }
    return collapsedPropertyMap.toString();
View Full Code Here

Examples of com.google.gwt.dev.cfg.BindingProperty

  @Override
  public SelectionProperty getSelectionProperty(TreeLogger logger,
      String propertyName) throws BadPropertyValueException {
    Property prop = getProperty(propertyName);
    if (prop instanceof BindingProperty) {
      final BindingProperty cprop = (BindingProperty) prop;
      final String name = cprop.getName();
      final String value;
      if (prevAnswers.containsKey(propertyName)) {
        value = prevAnswers.get(propertyName);
      } else {
        value = computePropertyValue(logger, propertyName, cprop);
        prevAnswers.put(propertyName, value);
      }
      final String fallback = cprop.getFallback();
      final SortedSet<String> possibleValues = new TreeSet<String>();
      for (String v : cprop.getDefinedValues()) {
        possibleValues.add(v);
      }
      return new DefaultSelectionProperty(value, fallback, name, possibleValues,
          cprop.getFallbackValuesMap());
    } else {
      throw new BadPropertyValueException(propertyName);
    }
  }
View Full Code Here

Examples of com.google.gwt.dev.cfg.BindingProperty

  public void processModule(ModuleDef module) {
    computePropertiesMap();
    if (properties.size() > 0) {
      Properties props = module.getProperties();
      for (Property property : properties) {
        BindingProperty binding = props.createBinding(property.name());
        if (!binding.isDefinedValue(property.value())) {
          binding.addTargetLibraryDefinedValue(binding.getRootCondition(), property.value());
        }
        binding.setAllowedValues(
            binding.getRootCondition(), property.value());
      }
    }
  }
View Full Code Here

Examples of com.google.gwt.dev.cfg.BindingProperty

      throws UnableToCompleteException {
    if (userAgents != null && !userAgents.isEmpty()) {
      Properties props = module.getProperties();
      Property userAgent = props.find("user.agent");
      if (userAgent instanceof BindingProperty) {
        BindingProperty bindingProperty = (BindingProperty) userAgent;
        bindingProperty.setAllowedValues(bindingProperty.getRootCondition(),
            userAgents.toArray(new String[0]));
      }
    }
    if (!new Compiler(options).run(getTopLogger(), module)) {
      throw new UnableToCompleteException();
View Full Code Here

Examples of com.googlecode.mgwt.linker.server.BindingProperty

    Assert.assertEquals("strong", permutationArtifact.getPermutationName());

    // are the bindind properties okay?
    Set<BindingProperty> bindingProperties = permutationArtifact.getBindingProperties();
    Assert.assertEquals(2, bindingProperties.size());
    Assert.assertTrue(bindingProperties.contains(new BindingProperty("prop1", "v1")));
    Assert.assertTrue(bindingProperties.contains(new BindingProperty("prop2", "v2")));

    // are the files okay?
    Set<String> permutationFiles = permutationArtifact.getPermutationFiles();

    Assert.assertEquals(2, permutationFiles.size());
View Full Code Here

Examples of com.googlecode.mgwt.linker.server.BindingProperty

    // lets put in two permutationartifacts
    HashSet<String> files = new HashSet<String>();
    files.add("perm1_file1");
    files.add("perm1_file2");
    HashSet<BindingProperty> bpSet = new HashSet<BindingProperty>();
    bpSet.add(new BindingProperty("sel1", "1"));

    artifactSet.add(new PermutationArtifact(PermutationMapLinker.class, "perm1", files, bpSet));

    files = new HashSet<String>();
    files.add("perm2_file1");
    files.add("perm2_file2");
    bpSet = new HashSet<BindingProperty>();
    bpSet.add(new BindingProperty("sel1", "2"));

    artifactSet.add(new PermutationArtifact(PermutationMapLinker.class, "perm2", files, bpSet));

    ArtifactSet linkedSet = permutationMapLinker.link(null, linkerContext, artifactSet, false);
View Full Code Here

Examples of com.googlecode.mgwt.linker.server.BindingProperty

    Assert.assertNotNull(map.get("9EFCF8D411F0BC1926A3031A56459663"));
    Assert.assertNotNull(map.get("7064A1A163CFC3C63ADF5DF50E91C5BB"));

    List<BindingProperty> list = map.get("C83A451EFE8ADF0BDB46AEAAC44B0063");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "blackberry")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("C5038CC6700BE1E13984B0C9B1C1CF39");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "android")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("BC0FBD6E19A643C849F55798FBDC6B7C");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "retina")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("CE6093653BC656C5325AD9A3AD53190F");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "ipad")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("AFE43E4243D6D9E467B4EF9AC1B9A556");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "desktop")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("214B4087FF08669D2E69F4A54A473857");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "iphone")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("04898CDE872132FE196264EA78903568");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "android")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("1DE681F76CF42D7DAB43FBA413692180");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "desktop")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "gecko1_8")));

    list = map.get("24CDDA719C9F0168D42F39A56432B111");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "blackberry")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("3375A4CB10F21AB527E717409E342385");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "android_tablet")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("337DF9DBA826DEEAAB23EC650DD4A527");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "ipad")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("7C2CC23ECDA1A4E8BC60B81F5AEAA04C");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "retina")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("65593A1B9B5E003CE88C406E73A3F475");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "iphone")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("9EFCF8D411F0BC1926A3031A56459663");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "desktop")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "mobilesafari")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

    list = map.get("7064A1A163CFC3C63ADF5DF50E91C5BB");
    Assert.assertEquals(3, list.size());
    Assert.assertTrue(list.contains(new BindingProperty("mgwt.os", "android_tablet")));
    Assert.assertTrue(list.contains(new BindingProperty("mobile.user.agent", "not_mobile")));
    Assert.assertTrue(list.contains(new BindingProperty("user.agent", "safari")));

  }
View Full Code Here

Examples of com.googlecode.mgwt.linker.server.BindingProperty

    set.add("3");
    set.add("4");
    set.add("5");

    HashSet<BindingProperty> bpSet = new HashSet<BindingProperty>();
    bpSet.add(new BindingProperty("mgwt.os", "iphone"));
    bpSet.add(new BindingProperty("user.agent", "safari"));

    String permutationInformation = xmlPermutationProvider.writePermutationInformation("permTest", bpSet, set);

    ByteArrayInputStream inputStream = new ByteArrayInputStream(permutationInformation.getBytes("UTf-8"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.