Java tutorial
/* * Este programa es software libre; usted puede redistribuirlo y/o modificarlo bajo los terminos * de la licencia "GNU General Public License" publicada por la Fundacion "Free Software Foundation". * Este programa se distribuye con la esperanza de que pueda ser util, pero SIN NINGUNA GARANTIA; * vea la licencia "GNU General Public License" para obtener mas informacion. */ package ips1ap101.lib.core.jsf.component; import com.sun.webui.jsf.component.TableColumn; import ips1ap101.lib.base.bundle.BundleParametros; import ips1ap101.lib.core.jsf.JSF; import org.apache.commons.lang.StringUtils; /** * @author Jorge Campins */ public class ColumnaTabla extends TableColumn { public ColumnaTabla() { super(); } /** * {@inheritDoc} */ @Override public String getHeaderText() { String superstr = super.getHeaderText(); if (StringUtils.isBlank(superstr)) { return superstr; } else if (superstr.startsWith("BundleParametros.")) { int i = superstr.indexOf('.'); String key = superstr.substring(i + 1).trim(); if (key.length() > 0) { return BundleParametros.getShortLabel(key); } } else if (getValueExpression("headerText") != null) { return superstr; } String webuistr = JSF.getWebuiString(this, "text"); // if (webuistr == null) { // String prefix = "tableColumn"; // String thisid = StringUtils.trimToEmpty(this.getId()); // String altkey = thisid.startsWith(prefix) ? thisid.substring(prefix.length()) : null; // String styles = StringUtils.trimToEmpty(this.getStyleClass()); // webuistr = StringUtils.lowerCase(JSF.getWebuiString(superstr, altkey, styles)); // } return webuistr == null ? superstr : webuistr; } /** * {@inheritDoc} */ @Override public String getToolTip() { String superstr = super.getToolTip(); if (StringUtils.isBlank(superstr)) { return superstr; } else if (getValueExpression("toolTip") != null) { return superstr; } String webuistr = JSF.getWebuiString(this, "toolTip"); return webuistr == null ? superstr : webuistr; } }