Ejemplo n.º 1
0
  /**
   * Builds reading lists tab.
   *
   * @return component.
   */
  protected JComponent buildReadingListsTab() {
    // Wording
    JComponent wording = msg(Strings.message("guide.dialog.readinglists.wording"));

    // Buttons
    Dimension btnSize = new Dimension(20, 20);
    btnAddReadingList.setPreferredSize(btnSize);
    btnRemoveList.setPreferredSize(btnSize);
    FlowLayout layout = new FlowLayout(FlowLayout.LEFT);
    JPanel bbar = new JPanel(layout);
    bbar.add(btnAddReadingList);
    bbar.add(btnRemoveList);
    layout.setHgap(0);
    layout.setVgap(0);

    // Panel
    BBFormBuilder builder = new BBFormBuilder("0:grow");
    builder.setDefaultDialogBorder();

    builder.append(wording);
    builder.appendUnrelatedComponentsGapRow(2);
    builder.appendRow("min:grow");
    builder.append(new JScrollPane(tblReadingLists), 1, CellConstraints.FILL, CellConstraints.FILL);
    builder.append(bbar);

    return builder.getPanel();
  }
Ejemplo n.º 2
0
  /**
   * Creates notifications panel.
   *
   * @return panel.
   */
  protected JComponent buildNotificationsTab() {
    // Wording
    JComponent wording = msg(Strings.message("guide.dialog.notifications.wording"));

    // Panel
    BBFormBuilder builder = new BBFormBuilder("0:grow");
    builder.setDefaultDialogBorder();

    builder.append(wording);
    builder.appendUnrelatedComponentsGapRow(2);
    builder.append(chAllowNotifications);

    return builder.getPanel();
  }
Ejemplo n.º 3
0
  /**
   * Builds panel for publishing tab when publishing is unavailable.
   *
   * @param aWording wording to put on the page.
   * @return component.
   */
  private JPanel buildPublishingTabUnavailable(JComponent aWording) {
    // Panel
    BBFormBuilder builder = new BBFormBuilder("0:grow");
    builder.setDefaultDialogBorder();

    builder.append(aWording);
    builder.appendUnrelatedComponentsGapRow(2);

    builder.append(
        ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("guide.dialog.publishing.you.need.bbservice.account")));

    return builder.getPanel();
  }
Ejemplo n.º 4
0
    /**
     * Builds main part.
     *
     * @return main part.
     */
    protected JComponent buildMain() {
      BBFormBuilder builder = new BBFormBuilder("pref, 4dlu, max(pref;200px):grow, 4dlu, p");
      builder.setDefaultDialogBorder();

      JComponent wording =
          ComponentsFactory.createWrappedMultilineLabel(
              Strings.message("guide.dialog.readinglists.add.wording"));

      builder.append(wording, 3);
      builder.appendUnrelatedComponentsGapRow(2);

      builder.append(Strings.message("guide.dialog.readinglists.add.address"), tfAddress);
      builder.append(btnSuggest);
      builder.append(Strings.message("guide.dialog.readinglists.add.status"), lbStatus);

      return builder.getPanel();
    }
Ejemplo n.º 5
0
  /**
   * Builds the panel for publishing tab when too many guides are already published.
   *
   * @param wording wording to put on the page.
   * @return component.
   */
  private JPanel buildPublishingTabLimitReached(JComponent wording) {
    BBFormBuilder builder = new BBFormBuilder("0:grow");
    builder.setDefaultDialogBorder();

    builder.append(wording);
    builder.appendUnrelatedComponentsGapRow(2);

    builder.append(
        ComponentsFactory.createWrappedMultilineLabel(
            MessageFormat.format(
                Strings.message("guide.dialog.publishing.limit.reached"), publishingLimit)));
    builder.appendUnrelatedComponentsGapRow(2);

    LinkLabel link =
        new LinkLabel(Strings.message("guide.dialog.publishing.limit.reached.link"), SERVICE_LINK);
    builder.append(link);

    return builder.getPanel();
  }
Ejemplo n.º 6
0
  /**
   * Builds panel for publishing tab when publishing is available.
   *
   * @param aWording wording to put on the page.
   * @return component.
   */
  private JPanel buildPublishingTabAvailable(JComponent aWording) {
    JPanel sscPanel = new JPanel(new BorderLayout());
    sscPanel.add(sscPublishingRating, BorderLayout.WEST);

    // Panel
    BBFormBuilder builder = new BBFormBuilder("7dlu, p, 2dlu, 100dlu, 0:grow, 2dlu, p");
    builder.setDefaultDialogBorder();

    builder.append(aWording, 7);
    builder.appendUnrelatedComponentsGapRow(2);

    builder.append(chPublishingEnabled, 7);
    builder.setLeadingColumnOffset(1);
    builder.append(lbPublishingTitle, tfPublishingTitle);
    builder.nextLine();
    builder.append(lbPublishingTags, tfPublishingTags);
    builder.nextLine();
    builder.append(lbPublishingPublic, chPublishingPublic);
    builder.nextLine();
    builder.append(lbPublishingRating, sscPanel);
    builder.appendUnrelatedComponentsGapRow(2);

    builder.append(lbPublishingURL);
    builder.append(lnkPublishingURL, 2);
    builder.append(btnCopyToClipboard);
    builder.append(lbLastPublishingDate, tfLastPublishingDate);

    builder.setLeadingColumnOffset(0);
    builder.appendUnrelatedComponentsGapRow(2);
    builder.appendRow("min:grow");

    JComponent instructionsBox =
        ComponentsFactory.createInstructionsBox(
            Strings.message("guide.dialog.publishing.instructions"));
    builder.append(instructionsBox, 7, CellConstraints.FILL, CellConstraints.FILL);

    return builder.getPanel();
  }