Exemplo n.º 1
0
  /**
   * Checks if title is valid.
   *
   * @return error message or NULL.
   */
  protected String validateTitle() {
    String message = null;

    final String title = tfTitle.getText();
    if (title == null || title.trim().length() == 0) {
      message = Strings.message("guide.dialog.validation.empty.title");
    } else if (CommonUtils.areDifferent(originalTitle, title) && presentTitles.contains(title)) {
      message = Strings.message("guide.dialog.validation.already.present");
    }
    return message;
  }
Exemplo n.º 2
0
  /**
   * Enabled / disable publishing controls depending on the state of the "Enable Publishing" mark.
   */
  private void onPublishingEnabled() {
    boolean enabled = chPublishingEnabled.isSelected();

    lbPublishingPublic.setEnabled(enabled);
    chPublishingPublic.setEnabled(enabled);
    lbLastPublishingDate.setEnabled(enabled);
    tfLastPublishingDate.setEnabled(enabled);
    lbPublishingTags.setEnabled(enabled);
    lbPublishingTitle.setEnabled(enabled);
    lbPublishingURL.setEnabled(enabled);
    lnkPublishingURL.setEnabled(enabled);
    btnCopyToClipboard.setEnabled(enabled);
    tfPublishingTags.setEnabled(enabled);
    tfPublishingTitle.setEnabled(enabled);
    lbPublishingRating.setEnabled(enabled);
    sscPublishingRating.setEnabled(enabled);

    if (enabled && StringUtils.isEmpty(getPublishingTitle())) {
      tfPublishingTitle.setText(getGuideTitle());
    }
  }
Exemplo n.º 3
0
 /**
  * Returns the tags of the reading list the user is going to publish.
  *
  * @return the tags.
  */
 public String getPublishingTags() {
   return tfPublishingTags.getText().trim();
 }
Exemplo n.º 4
0
 /**
  * Returns the title of the reading list the user is going to publish.
  *
  * @return the title.
  */
 public String getPublishingTitle() {
   return tfPublishingTitle.getText().trim();
 }
Exemplo n.º 5
0
 /**
  * Returns title entered by user.
  *
  * @return title.
  */
 public String getGuideTitle() {
   return tfTitle.getText();
 }