/** * 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; }
/** * 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()); } }
/** * Returns the tags of the reading list the user is going to publish. * * @return the tags. */ public String getPublishingTags() { return tfPublishingTags.getText().trim(); }
/** * Returns the title of the reading list the user is going to publish. * * @return the title. */ public String getPublishingTitle() { return tfPublishingTitle.getText().trim(); }
/** * Returns title entered by user. * * @return title. */ public String getGuideTitle() { return tfTitle.getText(); }