ips1ap101.lib.core.jsf.component.Pestanya.java Source code

Java tutorial

Introduction

Here is the source code for ips1ap101.lib.core.jsf.component.Pestanya.java

Source

/*
 * 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.Tab;
import ips1ap101.lib.base.bundle.BundleDominios;
import org.apache.commons.lang.StringUtils;

/**
 * @author Jorge Campins
 */
public class Pestanya extends Tab {

    public Pestanya() {
        super();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getText() {
        Object superobj = super.getText();
        String superstr = superobj == null ? null : superobj.toString();
        if (StringUtils.isNotBlank(superstr) && getValueExpression("text") == null) {
            if (superstr != null && superstr.startsWith("BundleDominios.")) {
                int i = superstr.indexOf('.');
                String key = superstr.substring(i + 1).trim();
                if (key.length() > 0) {
                    return BundleDominios.getShortLabel(key);
                }
            }
        }
        return superstr;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getToolTip() {
        String superstr = super.getToolTip();
        if (StringUtils.isNotBlank(superstr) && getValueExpression("toolTip") == null) {
            if (superstr.startsWith("BundleDominios.")) {
                int i = superstr.indexOf('.');
                String key = superstr.substring(i + 1).trim();
                if (key.length() > 0) {
                    return BundleDominios.getToolTip(key);
                }
            }
        }
        return superstr;
    }

}