Package com.google.livingstories.client.ui

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


 
  private Widget createSourceInformationPanel() {
    VerticalPanel panel = new VerticalPanel();
    panel.add(new Label("You can enter either one or both of these fields."));
   
    sourceContentItemSelector = new SingleContentItemSelectionPanel();
    sourceDescriptionBox = new TextBox();
    sourceDescriptionBox.setVisibleLength(LONG_TEXTBOX_VISIBLE_LENGTH);
   
    Grid grid = new Grid(2, 2);
    grid.setWidget(0, 0, new Label("Content item that contains source information:"));
View Full Code Here


  private Widget createPlayerAttributesPanel() {
    nameTextBox = new TextBox();
    aliasesTextBox = new TextBox();
    playerTypeSelector = EnumDropdown.newInstance(PlayerType.class);
    photoSelector = new SingleContentItemSelectionPanel();
   
    Grid generalPlayerAttributesPanel = new Grid(4, 2);
    generalPlayerAttributesPanel.setWidget(0, 0, new Label("Player name:"));
    generalPlayerAttributesPanel.setWidget(0, 1, nameTextBox);
    generalPlayerAttributesPanel.setWidget(1, 0, new Label("Aliases:"));
View Full Code Here

          extended.insertImage(url);
        }
      } else if (sender == insertGoToContentItem) {
        PopupPanel popup = new PopupPanel();
        FlowPanel contentPanel = new FlowPanel();
        final SingleContentItemSelectionPanel selectionPanel =
            new SingleContentItemSelectionPanel();
        contentPanel.add(selectionPanel);
        contentPanel.add(createButtonPanel(popup, new ContentItemSelectionHandler() {
          @Override
          public void onSelect() {
            BaseContentItem contentItem = selectionPanel.getSelection();
            String headline = null;
            if (contentItem.getContentItemType() == ContentItemType.EVENT) {
              headline = ((EventContentItem) contentItem).getEventUpdate();
            } else if (contentItem.getContentItemType() == ContentItemType.NARRATIVE) {
              headline = ((NarrativeContentItem) contentItem).getHeadline();
            } else {
              Window.alert("You must link to an event or top level narrative!");
              contentItem = null;
            }
            if (contentItem != null && contentItem.displayTopLevel()) {
              richTextUtil.createJavascriptLink(richText.getElement(),
                  "goToContentItem(" + contentItem.getId() + ")",
                  "Jump to: " + headline.replace("\"", "'"));
            }
          }
        }));
        popup.add(contentPanel);
        popup.showRelativeTo(insertContentItem);
      } else if (sender == insertContentItem) {
        PopupPanel popup = new PopupPanel();
        FlowPanel contentPanel = new FlowPanel();
        final SingleContentItemSelectionPanel selectionPanel =
            new SingleContentItemSelectionPanel();
        contentPanel.add(selectionPanel);
        contentPanel.add(createButtonPanel(popup, new ContentItemSelectionHandler() {
          @Override
          public void onSelect() {
            BaseContentItem contentItem = selectionPanel.getSelection();
            if (contentItem != null) {
              richTextUtil.createJavascriptLink(richText.getElement(),
                  "showContentItemPopup(" + contentItem.getId() + ", this)");
            }
          }
        }));
        popup.add(contentPanel);
        popup.showRelativeTo(insertContentItem);
      } else if (sender == insertSource) {
        PopupPanel popup = new PopupPanel();
        FlowPanel contentPanel = new FlowPanel();
        final TextBox descriptionBox = new TextBox();
        HorizontalPanel descriptionPanel = new HorizontalPanel();
        descriptionPanel.add(new Label("Source description:"));
        descriptionPanel.add(descriptionBox);
        contentPanel.add(descriptionPanel);
        final SingleContentItemSelectionPanel selectionPanel =
            new SingleContentItemSelectionPanel();
        contentPanel.add(selectionPanel);
        contentPanel.add(createButtonPanel(popup, new ContentItemSelectionHandler() {
          @Override
          public void onSelect() {
            String description = descriptionBox.getText();
            BaseContentItem contentItem = selectionPanel.getSelection();
            if (!description.isEmpty() || contentItem != null) {
              String selectedText = richTextUtil.getSelection(richText.getElement());
              richTextUtil.insertHTML(richText.getElement(), selectedText + " " +
                  new SourceLink(description, contentItem == null ? -1
                      : contentItem.getId()).getOuterHTML());
            }
          }
        }));
        popup.add(contentPanel);
        popup.showRelativeTo(insertSource);
      } else if (sender == insertLightbox) {
        PopupPanel popup = new PopupPanel();
        FlowPanel contentPanel = new FlowPanel();
        final SingleContentItemSelectionPanel selectionPanel =
            new SingleContentItemSelectionPanel();
        contentPanel.add(selectionPanel);
        contentPanel.add(createButtonPanel(popup, new ContentItemSelectionHandler() {
          @Override
          public void onSelect() {
            BaseContentItem contentItem = selectionPanel.getSelection();
            if (contentItem != null) {
              richTextUtil.createJavascriptLink(richText.getElement(),
                  "showLightboxForContentItem('" + contentItem.getTypeString()
                  + "', " + contentItem.getId() + ")");
            }
View Full Code Here

TOP

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

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.