/** * Sets the additional info visible if present. * * <p> * * @param visible <code>true</code> to show, <code>false</code> to hide */ public void setAdditionalInfoVisible(boolean visible) { if (m_openClose == null) { return; } if (visible) { addStyleName(CmsListItemWidget.OPENCLASS); m_openClose.setDown(true); OpenEvent.fire(this, this); } else { removeStyleName(CmsListItemWidget.OPENCLASS); m_openClose.setDown(false); CloseEvent.fire(this, this); } }
/** * Re-initializes the additional infos. * * <p> * * @param infoBean the info bean */ public void reInitAdditionalInfo(CmsListInfoBean infoBean) { m_additionalInfo.clear(); if (m_openClose != null) { m_openClose.removeFromParent(); m_openClose = null; } initAdditionalInfo(infoBean); }
/** * Ensures the open close button for the additional info list is present. * * <p> */ protected void ensureOpenCloseAdditionalInfo() { if (m_openClose == null) { m_openClose = new CmsPushButton( I_CmsImageBundle.INSTANCE.style().triangleRight(), I_CmsImageBundle.INSTANCE.style().triangleDown()); m_openClose.setButtonStyle(ButtonStyle.TRANSPARENT, null); m_titleRow.insert(m_openClose, 0); m_openClose.addClickHandler( new ClickHandler() { /** * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ public void onClick(ClickEvent event) { setAdditionalInfoVisible( !getElement().getClassName().contains(CmsListItemWidget.OPENCLASS)); } }); } }