Package com.google.livingstories.client.ui

Examples of com.google.livingstories.client.ui.Link


    ReadMoreLink readMoreLink = null;
    boolean shouldExpand = false;
    boolean reachedExpandedChunk = false;

    // Create a link that causes everything to be hidden
    Link readLessLink = new Link(SHOW_LESS) {
      @Override
      protected void onClick(ClickEvent e) {
        // Hide all the widgets except the first few, as specified by the
        // initiallyVisibleChunkCount variable.
        for (int i = 1; i < container.getWidgetCount(); i++) {
          container.getWidget(i).setVisible(i < initiallyVisibleChunkCount);
        }
      }
    };
    readLessLink.setVisible(false);
    container.add(readLessLink);

    for (int i = chunks.length - 1; i >= 0; i--) {
      String chunk = chunks[i].trim();
      if (readMoreLink != null) {
        // Insert the previously created "read more" link at the beginning.
        container.insert(readMoreLink, 0);
      }

      // If this is the first chunk or if this chunk contains a highlight for new content,
      // expand it.
      if (i == 0 || (openHighlightedChunks && chunk.contains(HIGHLIGHT_CLASS))) {
        shouldExpand = true;
        if (!reachedExpandedChunk && readMoreLink != null) {
          // If all the previous chunks were hidden, then we should show the
          // read more link after this expanded chunk, if there is one.
          readMoreLink.setVisible(true);
        }
        if (i > 0) {
          // If this expanded chunk isn't the first chunk, then we should show
          // the read less link.
          readLessLink.setVisible(true);         
        }
        reachedExpandedChunk = true;
      }

      // Process this chunk.  First, check if this chunk ends with text in paragraph tags
View Full Code Here


      }
    }
   
    private Widget createEventWidget(final EventContentItem event) {
      FlowPanel eventPanel = new FlowPanel();
      Link update = new Link(event.getEventUpdate()) {
        @Override
        protected void onClick(ClickEvent e) {
          AnalyticsUtil.trackVerticalTimelineClick(
              LivingStoryData.getLivingStoryUrl(), event.getId());
          LivingStoryControls.goToContentItem(event.getId());
View Full Code Here

TOP

Related Classes of com.google.livingstories.client.ui.Link

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.