Examples of StringSet


Examples of org.waveprotocol.wave.model.util.StringSet

    }

    if (permittedValues.length == 0) {
      attrs.put(attrName, null);
    } else {
      StringSet values = attrs.get(attrName);
      if (values == null) {
        attrs.put(attrName, values = CollectionUtils.createStringSet());
      }

      for (String value : permittedValues) {
        values.add(value);
      }
    }
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.util.StringSet

  @Override
  public boolean permitsChild(String parentType, String childType) {
    parentType = fixType(parentType);
    checkNotTopLevel(childType);
    StringSet permitted = permittedChildren.get(parentType);
    return permitted != null && permitted.contains(childType);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.util.StringSet

   *
   * @return a new string set each time, containing the class names of all
   *         registered update event listeners. it is safe to modify this set.
   */
  public StringSet debugGetAllUpdateEventNames() {
    StringSet events = CollectionUtils.createStringSet();
    for (EditorUpdateEvent.EditorUpdateListener l : updateListeners) {
      events.add(l.getClass().getName());
    }
    return events;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.util.StringSet

   * whitelist.
   *
   * @param known
   */
  private ReadableStringSet filterContentAnnotations(ReadableStringSet known) {
    final StringSet interested = CollectionUtils.createStringSet();
    known.each(new Proc() {
      @Override
      public void apply(final String key) {
        AnnotationBehaviour behaviour = annotationLogic.getClosestBehaviour(key);
        if (behaviour != null && behaviour.getAnnotationFamily() == AnnotationFamily.CONTENT) {
          interested.add(key);
        }
      }
    });
    return interested;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.util.StringSet

    // init to default state:
    leftSide.clear();
    rightSide.clear();
    final StringMap<String> leftValues = CollectionUtils.createStringMap();
    final StringMap<String> rightValues = CollectionUtils.createStringMap();
    final StringSet keysToCheck = CollectionUtils.createStringSet();

    // collection up non-null annotations on both sides
    if (location > 0) {
      doc.forEachAnnotationAt(location - 1, new ProcV<String>() {
        public void apply(String key, String value) {
          if (value != null) {
            leftValues.put(key, value);
            keysToCheck.add(key);
          }
        }
      });
    }
    if (location < doc.size()) {
      doc.forEachAnnotationAt(location, new ProcV<String>() {
        public void apply(String key, String value) {
          if (value != null) {
            rightValues.put(key, value);
            keysToCheck.add(key);
          }
        }
      });
    }

    // fill in values that change
    keysToCheck.each(new Proc() {
      public void apply(String key) {
        String left = leftValues.get(key);
        String right = rightValues.get(key);
        if (ValueUtils.notEqual(left, right)) {
          leftSide.put(key, left);
View Full Code Here

Examples of org.zanata.apicompat.rest.StringSet

        ISourceDocResource sourceDocClient =
                super.createProxy(createClientProxyFactory(ADMIN, ADMIN_KEY),
                        ISourceDocResource.class,
                        "/projects/p/sample-project/iterations/i/1.0/r/");
        ClientResponse<String> response =
                sourceDocClient.post(res, new StringSet(PoHeader.ID + ";"
                        + SimpleComment.ID), true);

        assertThat(response.getStatus(), is(Status.CREATED.getStatusCode())); // 201
        response.releaseConnection();

        // Post Twice (should conflict)
        response =
                sourceDocClient.post(res, new StringSet(PoHeader.ID + ";"
                        + SimpleComment.ID), true);

        assertThat(response.getStatus(), is(Status.CONFLICT.getStatusCode())); // 409
        response.releaseConnection();
    }
View Full Code Here

Examples of org.zanata.rest.StringSet

                // translate it
                Set<String> extensions;
                if (params.get("fileName").getString().endsWith(".po")) {
                    extensions =
                            new StringSet(ExtensionType.GetText.toString());
                } else {
                    extensions = Collections.<String> emptySet();
                }
                MergeType mergeType =
                        Boolean.parseBoolean(params.get("merge").getString()) ? MergeType.AUTO
View Full Code Here

Examples of org.zanata.rest.StringSet

            doc.setLang(new LocaleId(sourceFileUpload.getSourceLang()));

            // TODO Copy Trans values
            documentServiceImpl.saveDocument(projectSlug, versionSlug, doc,
                    new StringSet(ExtensionType.GetText.toString()), false);

            showUploadSuccessMessage();
        } catch (ZanataServiceException e) {
            conversationScopeMessages.setMessage(FacesMessage.SEVERITY_ERROR,
                    e.getMessage() + "-" + sourceFileUpload.getFileName());
View Full Code Here

Examples of org.zanata.rest.StringSet

                            versionSlug, translationFileUpload.docId);

            // translate it
            Set<String> extensions;
            if (translationFileUpload.getFileName().endsWith(".po")) {
                extensions = new StringSet(ExtensionType.GetText.toString());
            } else {
                extensions = Collections.<String> emptySet();
            }
            List<String> warnings =
                    translationServiceImpl
View Full Code Here

Examples of org.zanata.rest.StringSet

    @In("filePersistService")
    private FilePersistService filePersistService;

    @Override
    public Response acceptedFileTypes() {
        StringSet acceptedTypes = new StringSet("");
        acceptedTypes.addAll(translationFileServiceImpl
                .getSupportedExtensions());
        return Response.ok(acceptedTypes.toString()).build();
    }
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.