Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlOutputLabel


{
  if (!(component instanceof HtmlOutputLabel))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlOutputLabel");
  }
  HtmlOutputLabel comp = (HtmlOutputLabel)component;

  super.setProperties(component);

  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_escape != null)
  {
    comp.setValueExpression("escape", _escape);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  if (_for != null)
  {
    comp.setValueExpression("for", _for);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_converter != null)
  {
    if (!_converter.isLiteralText())
    {
      comp.setValueExpression("converter", _converter);
    }
    else
    {
      String s = _converter.getExpressionString();
      if (s != null)
      {
        Converter converter = getFacesContext().getApplication().
          createConverter(s);
        comp.setConverter(converter);
      }
    }
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
}
View Full Code Here



    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlOutputLabel();
    }
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlOutputLabel();
    }
View Full Code Here

        Assert.assertNotNull(input19);

        HtmlInputText input20 = (HtmlInputText) form.findComponent("input20");
        Assert.assertNotNull(input20);
       
        HtmlOutputLabel label1 = (HtmlOutputLabel) form.findComponent("label1");
        Assert.assertNotNull(label1);
       
        HtmlSelectOneListbox select1 = (HtmlSelectOneListbox) form.findComponent("select1");
        Assert.assertNotNull(select1);
       
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlOutputLabel();
    }
View Full Code Here

        return new TestSuite(HtmlLabelRendererTest.class);
    }
   
    public void setUp() throws Exception {
        super.setUp();
        label = new HtmlOutputLabel();
        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);
       
        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
        facesContext.getRenderKit().addRenderer(
View Full Code Here

        Assert.assertNotNull(input19);

        HtmlInputText input20 = (HtmlInputText) form.findComponent("input20");
        Assert.assertNotNull(input20);
       
        HtmlOutputLabel label1 = (HtmlOutputLabel) form.findComponent("label1");
        Assert.assertNotNull(label1);
       
        HtmlSelectOneListbox select1 = (HtmlSelectOneListbox) form.findComponent("select1");
        Assert.assertNotNull(select1);
       
View Full Code Here

   
    private void encodeLabel(FacesContext context, UIComponentBase parent)
        throws IOException
    {
        // render components
        HtmlOutputLabel labelComponent = null;
        if (parent.getChildCount() > 0)
        {
            labelComponent = (HtmlOutputLabel) parent.getChildren().get(0);
        }
        if (labelComponent == null)
View Full Code Here

        // Check column
        if (column==null)
            throw new InvalidArgumentException("column", column);

        // create label now
        HtmlOutputLabel label;
        try {
            label = InputControlManager.getLabelComponentClass().newInstance();
        } catch (InstantiationException e1) {
            throw new InternalException(e1);
        } catch (IllegalAccessException e2) {
            throw new InternalException(e2);
        }
       
        // value
        String labelText = getLabelValue(column, colon);
        if (StringUtils.isEmpty(labelText))
            label.setRendered(false);
        else
            label.setValue(labelText);

        // styleClass
        if (StringUtils.isNotEmpty(styleClass))
            label.setStyleClass(styleClass);
       
        // for
        if (StringUtils.isNotEmpty(forInput) && !readOnly)
        {   // Set Label input Id
            String inputId = getInputInfo(context).getInputId();
            if (forInput.equals("*"))
                label.setFor(inputId);
            else
                label.setFor(forInput+":"+inputId);
        }   

        // style
        if (StringUtils.isNotEmpty(style))
            label.setStyle(style);

        // title
        String title = getLabelTooltip(column);
        if (title!=null)
            label.setTitle(title);
       
        // required
        if (required)
        {
            HtmlPanelGroup span = new HtmlPanelGroup();
            span.setStyleClass("required");
            HtmlOutputText text = new HtmlOutputText();
            text.setValue("*");
            span.getChildren().add(text);
            label.getChildren().add(span);
        }

        return label;
    }
View Full Code Here

    {
        // add label and input components when the view is loaded for the first time
        super.encodeBegin(context);
       
        // render components
        HtmlOutputLabel labelComponent = null;
        if (getChildCount() > 0)
        {
            labelComponent = (HtmlOutputLabel) getChildren().get(0);
        }
        if (labelComponent == null)
        {
            String forInput   = helper.getTagAttribute("for");
            String styleClass = helper.getTagStyleClass(DataType.UNKNOWN);
            String style      = helper.getTagAttribute("style");
            // createLabelComponent
            labelComponent = helper.createLabelComponent(context, forInput, styleClass, style, getColon());
            this.getChildren().add(labelComponent);
        }

        // render components
        labelComponent.encodeAll(context);
    }
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlOutputLabel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.