Package com.google.gdata.data

Examples of com.google.gdata.data.TextContent


        originalEntry.getCustomElements().replaceWithLocal(newContents);
        originalEntry = originalEntry.update();
        newContents = null;
      } catch (VersionConflictException e) {
        originalEntry = originalEntry.getSelf();
        TextContent content = (TextContent) originalEntry.getContent();
        JOptionPane.showMessageDialog(null,
            "Someone has edited the row in the meantime to:\n"
            + originalEntry.getTitle().getPlainText()
            + " (" + content.getContent().getPlainText() + ")\n"
            + "Commit again to confirm.",
            "Version Conflict",
            JOptionPane.WARNING_MESSAGE);
      }
    }
View Full Code Here


     
      Content content = entry.getContent();
     
      if (content instanceof TextContent) {
       
        TextContent textContent = (TextContent) content;
       
        map.put(SpiConstants.PROPNAME_MIMETYPE,
            makeProperty("text/html"));
       
        map.put(SpiConstants.PROPNAME_CONTENT,
            makeProperty(
                "<html><head><title>" +
                (entry.getTitle() == null ? "" :
                  entry.getTitle().getPlainText()) +
                "</title><body>" +
                textContent.getContent().getPlainText() +
                "</body></html>"));
       
      } else if (content instanceof MediaContent) {
       
        MediaContent mediaContent = (MediaContent) content;
View Full Code Here

        Content content = issueEntry.getContent();
        if (content instanceof TextContent) {
            // getTextContent() does the same thing and throws an
            // IllegalStateException
            // when the content is not TextContent
            TextContent textContent = (TextContent) content;
            if (textContent.getContent() != null
                    && textContent.getContent() instanceof HtmlTextConstruct) {
                HtmlTextConstruct html = (HtmlTextConstruct) textContent.getContent();
                String htmlContent = html.getHtml();
                if (stripHtml == true) {
                    return htmlContent.replaceAll("\\<.*?\\>", "");
                } else {
                    return htmlContent;
View Full Code Here

        throw new FeedServerClientException(e);
      } catch (ParserConfigurationException e) {
        throw new RuntimeException(e);
      }
    } else if (content instanceof TextContent) {
      TextContent textContent = (TextContent) content;
      TextConstruct textConstruct = textContent.getContent();

      int type = textContent.getContent().getType();
      String typeName;
      String text;
      switch (type) {
        case TextConstruct.Type.HTML:
          typeName = "html";
          text = ((HtmlTextConstruct) textConstruct).getHtml();
          break;

        case TextConstruct.Type.TEXT:
          typeName = "text";
          text = ((PlainTextConstruct) textConstruct).getPlainText();
          break;

        case TextConstruct.Type.XHTML:
          typeName = "xhtml";
          text = ((XhtmlTextConstruct) textConstruct).getXhtml().getBlob();
          break;

        default:
          typeName = "unknown";
          text = textConstruct.toString();
      }

      Map<String, Object> entity = new HashMap<String, Object>();
      entity.put("content", text);
      entity.put("type", typeName);

      String lang = textContent.getContent().getLang();
      if (lang != null) {
        entity.put("lang", lang);
      }

      return entity;
View Full Code Here

TOP

Related Classes of com.google.gdata.data.TextContent

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.