
net.jhorstmann.i18n.jsf.TranslationComponent Maven / Gradle / Ivy
The newest version!
package net.jhorstmann.i18n.jsf;
import javax.faces.component.FacesComponent;
import net.jhorstmann.i18n.I18N;
import javax.faces.FacesException;
import javax.faces.component.StateHelper;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import static net.jhorstmann.i18n.jsf.FacesResourceBundle.getResourceBundle;
@FacesComponent(value = TranslationComponent.COMPONENT_TYPE)
public class TranslationComponent extends UIComponentBase {
public static final String COMPONENT_TYPE = "net.jhorstmann.i18n.jsf.TranslationComponent";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
enum PropertyKeys {
message, context, plural, num, comment
}
public TranslationComponent() {
setRendererType(null);
}
@Override
public String getFamily() {
return COMPONENT_FAMILY;
}
@Override
public boolean getRendersChildren() {
return true;
}
@Override
public void encodeChildren(FacesContext context) throws IOException {
}
@Override
public void encodeBegin(FacesContext facesContext) throws IOException {
super.encodeBegin(facesContext);
}
private Object[] getParameters() {
List children = getChildren();
if (children == null || children.isEmpty()) {
return new Object[0];
} else {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy