コード例 #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();
  }
コード例 #2
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();
  }