예제 #1
0
  /**
   * Constructor.
   *
   * <p>
   *
   * @param infoBean bean holding the item information
   */
  protected void init(CmsListInfoBean infoBean) {

    m_iconPanel.setVisible(false);
    m_title.setText(infoBean.getTitle());
    m_subtitle.setText(infoBean.getSubTitle());

    // set the resource type icon if present
    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(infoBean.getResourceType())) {
      setIcon(CmsIconUtil.getResourceIconClasses(infoBean.getResourceType(), false));
    }
    if (infoBean.getStateIcon() != null) {
      setStateIcon(infoBean.getStateIcon());
    }
    if (infoBean.getLockIcon() != null) {
      setLockIcon(infoBean.getLockIcon(), infoBean.getLockIconTitle());
    }
    initAdditionalInfo(infoBean);
  }
예제 #2
0
  /**
   * Internal method which is called when the user has finished editing the title.
   *
   * @param box the text box which has been edited
   */
  protected void onEditTitleTextBox(TextBox box) {

    if (m_titleEditHandler != null) {
      m_titleEditHandler.handleEdit(m_title, box);
      return;
    }

    String text = box.getText();
    box.removeFromParent();
    m_title.setText(text);
    m_title.setVisible(true);
  }
예제 #3
0
  /**
   * Sets the subtitle suffix text, and hides or displays the subtitle suffix depending on whether
   * the text is null or not null.
   *
   * <p>
   *
   * @param text the text to put into the subtitle suffix
   */
  public void setSubtitleSuffixText(String text) {

    if (text == null) {
      if (m_subtitleSuffix.getParent() != null) {
        m_subtitleSuffix.removeFromParent();
      }
    } else {
      if (m_subtitleSuffix.getParent() == null) {
        m_titleRow.add(m_subtitleSuffix);
      }
      m_subtitleSuffix.setText(text);
    }
    updateTruncation();
  }
예제 #4
0
  /**
   * Sets the title label text.
   *
   * <p>
   *
   * @param label the new title to set
   */
  public void setTitleLabel(String label) {

    m_title.setText(label);
  }
예제 #5
0
  /**
   * Sets the subtitle label text.
   *
   * <p>
   *
   * @param label the new subtitle to set
   */
  public void setSubtitleLabel(String label) {

    m_subtitle.setText(label);
  }