/**
   * Creates Publishing tab.
   *
   * @return component.
   */
  protected JComponent buildPublishingTab() {
    JComponent wording =
        ComponentsFactory.createWrappedMultilineLabel(
            Strings.message("guide.dialog.publishing.publish"));

    return publishingAvailable
        ? (isReachedPublishingLimit()
            ? buildPublishingTabLimitReached(wording)
            : buildPublishingTabAvailable(wording))
        : buildPublishingTabUnavailable(wording);
  }
  /**
   * 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();
  }
    /**
     * 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();
    }
  /**
   * 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();
  }
 private JComponent msg(String msg) {
   return ComponentsFactory.createWrappedMultilineLabel(msg);
 }