Package com.google.wave.api

Examples of com.google.wave.api.BlipContentRefs


        String user = event.getModifiedBy();
        UserInfo userInfo = util.getUserInfo(user);
        if (userInfo == null) {
          appendAuthSubGadget(blip, user);
        } else {
          BlipContentRefs blipContentRefs = blip.range(annotation.getRange().getStart(), annotation
              .getRange().getEnd());
          blipContentRefs.annotate(this.HIGHLIGHT_ANNOTATION_NAME, "done");

          Set<String> participants = new HashSet<String>();
          participants.add(event.getModifiedBy());
         
          Wavelet newWavelet = null;         
          try {
            newWavelet = this.newWave(this.getDomain(), participants, "test", event.getBundle().getProxyingFor(), this.getRpcServerUrl());
            newWavelet.setTitle(DEFAULT_ISSUE_TITLE);

            newWavelet.getDataDocuments().set("issue-tracker-project",
                event.getBundle().getProxyingFor());
            newWavelet.getRootBlip().append(new Line());
            newWavelet.getRootBlip().append(blipContentRefs.value());
            newWavelet.getRootBlip().append(new Line());
            newWavelet.getRootBlip().append(new Line());
            this.appendButton(newWavelet.getRootBlip(), "createIssue", "createIssue");

            // Linkify to new wave
            blipContentRefs.annotate("link/wave", this.domain + "!"
                + newWavelet.getWaveId().getId());
         
            this.submit(newWavelet, this.getRpcServerUrl());
          } catch (IOException e) {
            LOG.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here


      String name = annotation.getName();
      String value = annotation.getValue();
      if (name.equals("stocky") && value.equals("_new_")) {
        int startIndex = annotation.getRange().getStart();

        BlipContentRefs blipContentRefs = blip.range(annotation.getRange().getStart(), annotation
            .getRange().getEnd());
        blipContentRefs.annotate("stocky", "_done_");

        String annotatedContent = blipContentRefs.value().getText();
        LOG.info("annotatedContent = " + annotatedContent);
       
        //String symbol = annotatedContent.substring(1, annotatedContent.length() - 1).toUpperCase();
        String symbol = annotatedContent.toUpperCase();
        LOG.info("stocky finds new symbol: " + symbol);

        // Replace the content with new and delete the "stocky" annotation.
        String price = String.format("$%.2f", util.getStockPrice(symbol));
        String newContent = String.format("%s[%s] ", symbol, price);
        blipContentRefs = blipContentRefs.replace(newContent);

        BlipContentRefs symbolContentRef = blip.range(startIndex, startIndex + symbol.length());
        symbolContentRef.annotate("style/color", "rgb(50,205,50)");
        symbolContentRef.annotate("style/fontWeight", "bold");

        BlipContentRefs priceContentRef = blip.range(startIndex + symbol.length() + 1, startIndex
            + symbol.length() + 1 + price.length());
        priceContentRef.annotate("style/color", "rgb(50,205,50)");
        priceContentRef.annotate("style/fontSize", "0.8em");
        priceContentRef.annotate("style/color", "rgb(255,0,0)");
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.wave.api.BlipContentRefs

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.