Package org.waveprotocol.wave.client.wavepanel.impl.toolbar.attachment

Examples of org.waveprotocol.wave.client.wavepanel.impl.toolbar.attachment.AttachmentPopupWidget$Style


    File outputFile = new File(ServletContextParameterMap.getParameterValue(ContextParameter.USER_DIRECTORY_PATH) + "KML/" + worksheet.getTitle() + ".kml");
    final Kml kml = KmlFactory.createKml();
    final Folder folder = kml.createAndSetFolder()
        .withName(worksheet.getTitle()).withOpen(true);

    Style style = folder.createAndAddStyle().withId("karma");
   
    if(randomCounter++%2 == 0)
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png"));
    else
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/red-pushpin.png"));

    for (edu.isi.karma.geospatial.Point point : points) {
      folder.createAndAddPlacemark()
          .withDescription(point.getHTMLDescription())
          .withVisibility(true)
View Full Code Here


        @Override
        public Feature decorate(Feature feature, KmlEncodingContext context) {
            Placemark pm = (Placemark) feature;
            // while it's possible to have more than one style object, GE will only paint
            // the first one
            Style style = pm.createAndAddStyle();
            List<Symbolizer> symbolizers = context.getCurrentSymbolizers();
            SimpleFeature sf = context.getCurrentFeature();
            if (symbolizers.size() > 0 && sf.getDefaultGeometry() != null) {
                // sort by point, text, line and polygon
                Map<Class, List<Symbolizer>> classified = classifySymbolizers(symbolizers);
View Full Code Here

            FocusedRange focusedRange = editor.getSelectionHelper().getSelectionRange();
            if (focusedRange != null) {
              tmpCursor = focusedRange.getFocus();
            }
            final int cursorLoc = tmpCursor;
            AttachmentPopupView attachmentView = new AttachmentPopupWidget();
            attachmentView.init(new Listener() {

              @Override
              public void onShow() {
              }

              @Override
              public void onHide() {
              }

              @Override
              public void onDone(String encodedWaveRef, String attachmentId, String fullFileName) {
                // Insert a file name linking to the attachment URL.
                int lastSlashPos = fullFileName.lastIndexOf("/");
                int lastBackSlashPos = fullFileName.lastIndexOf("\\");
                String fileName = fullFileName;
                if (lastSlashPos != -1) {
                  fileName = fullFileName.substring(lastSlashPos + 1, fullFileName.length());
                } else if (lastBackSlashPos != -1) {
                  fileName = fullFileName.substring(lastBackSlashPos + 1, fullFileName.length());
                }
                /*
                 * From UploadToolbarAction in Walkaround
                 * @author hearnden@google.com (David Hearnden)
                 */
                CMutableDocument doc = editor.getDocument();
                FocusedContentRange selection = editor.getSelectionHelper().getSelectionPoints();
                Point<ContentNode> point;
                if (selection != null) {
                  point = selection.getFocus();
                } else {
                  // Focus was probably lost.  Bring it back.
                  editor.focus(false);
                  selection = editor.getSelectionHelper().getSelectionPoints();
                  if (selection != null) {
                    point = selection.getFocus();
                  } else {
                    // Still no selection.  Oh well, put it at the end.
                    point = doc.locate(doc.size() - 1);
                  }
                }
                XmlStringBuilder content = ImageThumbnail.constructXml(attachmentId, fileName);
                ImageThumbnailWrapper thumbnail = ImageThumbnailWrapper.of(doc.insertXml(point, content));
                thumbnail.setAttachmentId(attachmentId);
              }
            });

            attachmentView.setAttachmentId(attachmentIdGenerator.newAttachmentId());
            attachmentView.setWaveRef(waveRefToken);
            attachmentView.show();
          }
        });
}
View Full Code Here

            FocusedRange focusedRange = editor.getSelectionHelper().getSelectionRange();
            if (focusedRange != null) {
              tmpCursor = focusedRange.getFocus();
            }
            final int cursorLoc = tmpCursor;
            AttachmentPopupView attachmentView = new AttachmentPopupWidget();
            attachmentView.init(new Listener() {

              @Override
              public void onShow() {
              }

              @Override
              public void onHide() {
              }

              @Override
              public void onDone(String encodedWaveRef, String attachmentId, String fullFileName) {
                // Insert a file name linking to the attachment URL.
                int lastSlashPos = fullFileName.lastIndexOf("/");
                int lastBackSlashPos = fullFileName.lastIndexOf("\\");
                String fileName = fullFileName;
                if (lastSlashPos != -1) {
                  fileName = fullFileName.substring(lastSlashPos + 1, fullFileName.length());
                } else if (lastBackSlashPos != -1) {
                  fileName = fullFileName.substring(lastBackSlashPos + 1, fullFileName.length());
                }
                XmlStringBuilder xml = XmlStringBuilder.createFromXmlString(fileName);
                int to = -1;
                int docSize = editor.getDocument().size();
                if (cursorLoc != -1) {
                  // Insert the attachment at the cursor location.
                  CMutableDocument doc = editor.getDocument();
                  Point<ContentNode> point = doc.locate(cursorLoc);
                  doc.insertXml(point, xml);
                } else {
                  LineContainers.appendLine(editor.getDocument(), xml);
                }
                // Calculate the link length for the attachment.
                to = cursorLoc + editor.getDocument().size() - docSize;
                String linkValue =
                    GWT.getHostPageBaseURL() + "attachment/" + attachmentId + "?fileName="
                        + fileName + "&waveRef=" + encodedWaveRef;
                EditorAnnotationUtil.setAnnotationOverRange(editor.getDocument(),
                    editor.getCaretAnnotations(), Link.KEY, linkValue, cursorLoc, to);
                // Store the attachment information as annotations to allow
                // robots detect and process them.
                EditorAnnotationUtil.setAnnotationOverRange(editor.getDocument(),
                    editor.getCaretAnnotations(), "attachment/id", attachmentId, cursorLoc, to);
                EditorAnnotationUtil.setAnnotationOverRange(editor.getDocument(),
                    editor.getCaretAnnotations(), "attachment/fileName", fileName, cursorLoc, to);
              }
            });

            attachmentView.setAttachmentId(attachmentIdGenerator.newAttachmentId());
            attachmentView.setWaveRef(waveRefToken);
            attachmentView.show();
          }
        });
}
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.wavepanel.impl.toolbar.attachment.AttachmentPopupWidget$Style

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.