Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlOutputLabel


    {
        // 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);
            // update
            String forInput = helper.getTagAttributeString("for");
            helper.updateLabelComponent(context, labelComponent, forInput);
        }
        if (labelComponent == null)
        {
            String forInput   = helper.getTagAttributeString("for");
            String styleClass = helper.getTagStyleClass(DataType.UNKNOWN, null);
            String style      = helper.getTagAttributeString("style");
            // createLabelComponent
            labelComponent = helper.createLabelComponent(context, forInput, styleClass, style, getColon());
            this.getChildren().add(labelComponent);
        }

        // render components
        labelComponent.encodeAll(context);
    }
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);
            // update
            helper.updateLabelComponent(context, 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
            InputControl.InputInfo ii = getInputInfo(context);
            String inputId = getInputControl().getLabelForId(ii);
            if (StringUtils.isNotEmpty(inputId))
            {   // input_id was given
                if (forInput.equals("*"))
                    label.setFor(inputId);
                else
                    label.setFor(forInput+":"+inputId);
            }
            else
            {   // No input-id available
                log.info("No input-id provided for {}.", getColumn().getName());
            }   
        }   

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

        // title
        String title = getLabelTooltip(column);
        if (title!=null)
            label.setTitle(title);
       
        // required
        if (required)
            addRequiredMark(label);

View Full Code Here

    }

    @NotNull
    public static HtmlOutputLabel addLabel(@NotNull
    UIComponent parent, FacesComponentIdFactory idFactory, UIInput associatedInput, String value, String styleClass) {
        HtmlOutputLabel label = createComponent(HtmlOutputLabel.class, idFactory);
        label.setFor(associatedInput.getId());
        label.setValue(value);
        label.setStyleClass(styleClass);
        parent.getChildren().add(label);
        return label;
    }
View Full Code Here

                children.add(image);

                /*
                 * also, add a tiny number to indicate what order the columns are sorted in
                 */
                UIOutput label = new HtmlOutputLabel();
                label.setValue(String.valueOf(i));
                children.add(label);

                break;
            }
        }
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);
            // update
            helper.updateLabelComponent(context, labelComponent, null);
View Full Code Here


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

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

  super.setProperties(component);

  if (_for != null)
  {
    comp.setValueExpression("for", _for);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_escape != null)
  {
    comp.setValueExpression("escape", _escape);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  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 (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
}
View Full Code Here

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

  super.setProperties(component);

  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_tabindex != null)
  {
    comp.setValueExpression("tabindex", _tabindex);
  }
  if (_accesskey != null)
  {
    comp.setValueExpression("accesskey", _accesskey);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_for != null)
  {
    comp.setValueExpression("for", _for);
  }
  if (_onfocus != null)
  {
    comp.setValueExpression("onfocus", _onfocus);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onblur != null)
  {
    comp.setValueExpression("onblur", _onblur);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_escape != null)
  {
    comp.setValueExpression("escape", _escape);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  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 (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
}
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
            InputControl.InputInfo ii = getInputInfo(context);
            String inputId = getInputControl().getLabelForId(ii);
            if (StringUtils.isNotEmpty(inputId))
            {   // input_id was given
                if (forInput.equals("*"))
                    label.setFor(inputId);
                else
                    label.setFor(forInput+":"+inputId);
            }
            else
            {   // No input-id available
                log.info("No input-id provided for {}.", getColumn().getName());
            }   
        }   

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

        // title
        String title = getLabelTooltip(column);
        if (title!=null)
            label.setTitle(title);
       
        // required
        if (required)
            addRequiredMark(label);

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.