Package org.apache.myfaces.trinidad.component

Examples of org.apache.myfaces.trinidad.component.UIXProgress


{
  @SuppressWarnings("unchecked")
  @Override
  public void decode(FacesContext context, UIComponent component)
  {
    UIXProgress progressComponent = (UIXProgress)component;
    Map<String, Object> attrs = component.getAttributes();

    Object modelValue= attrs.get(UIConstants.VALUE_PARAM);
    if (modelValue instanceof BoundedRangeModel)
    {
View Full Code Here


      UINode           node
    )
  {
    int percentComplete = -1;

    UIXProgress progressComponent =
      (UIXProgress) NodeUtils.getUIComponent(context, node);
    Object modelObject = progressComponent.getValue();
    if (modelObject != null && modelObject instanceof BoundedRangeModel)
    {
      BoundedRangeModel model= (BoundedRangeModel) modelObject;
      //pu: Though these are 'long' types, deal with it as double, so as to
      //  correctly compute percent for values towards the maximum of 'long'.
      double value = model.getValue();
      double maximum = model.getMaximum();
      if (value < 0 || maximum < 0)
      {
        percentComplete = PERCENT_UNKNOWN;
      }
      else
      {
        //pu: Loss due to truncation is not a concern here.
        percentComplete = (int)((value/maximum) * 100);
      }
    }
    else
    {
      _LOG.warning("Invalid value. Defaulting component with id '" +
                   progressComponent.getId() +
                   "' to indeterminate mode");
      //Just get this to indeterminate state indefinitely on this condition.
      percentComplete = PERCENT_UNKNOWN;
    }

View Full Code Here

      UINode           node
    )
  {
    int percentComplete = -1;

    UIXProgress progressComponent =
      (UIXProgress) NodeUtils.getUIComponent(context, node);
    Object modelObject = progressComponent.getValue();
    if (modelObject != null && modelObject instanceof BoundedRangeModel)
    {
      BoundedRangeModel model= (BoundedRangeModel) modelObject;
      //pu: Though these are 'long' types, deal with it as double, so as to
      //  correctly compute percent for values towards the maximum of 'long'.
      double value = model.getValue();
      double maximum = model.getMaximum();
      if (value < 0 || maximum < 0)
      {
        percentComplete = PERCENT_UNKNOWN;
      }
      else
      {
        //pu: Loss due to truncation is not a concern here.
        percentComplete = (int)((value/maximum) * 100);
      }
    }
    else
    {
      _LOG.warning("DEFAULT_COMPONENT_TO_INDETERMINDATE_MODE", progressComponent.getId());
      //Just get this to indeterminate state indefinitely on this condition.
      percentComplete = PERCENT_UNKNOWN;
    }

    if (percentComplete < 0)
View Full Code Here

{
  @SuppressWarnings("unchecked")
  @Override
  public void decode(FacesContext context, UIComponent component)
  {
    UIXProgress progressComponent = (UIXProgress)component;
    Map<String, Object> attrs = component.getAttributes();

    Object modelValue= attrs.get(UIConstants.VALUE_PARAM);
    if (modelValue instanceof BoundedRangeModel)
    {
View Full Code Here

      UINode           node
    )
  {
    int percentComplete = -1;

    UIXProgress progressComponent =
      (UIXProgress) NodeUtils.getUIComponent(context, node);
    Object modelObject = progressComponent.getValue();
    if (modelObject != null && modelObject instanceof BoundedRangeModel)
    {
      BoundedRangeModel model= (BoundedRangeModel) modelObject;
      //pu: Though these are 'long' types, deal with it as double, so as to
      //  correctly compute percent for values towards the maximum of 'long'.
      double value = model.getValue();
      double maximum = model.getMaximum();
      if (value < 0 || maximum < 0)
      {
        percentComplete = PERCENT_UNKNOWN;
      }
      else
      {
        //pu: Loss due to truncation is not a concern here.
        percentComplete = (int)((value/maximum) * 100);
      }
    }
    else
    {
      _LOG.warning("DEFAULT_COMPONENT_TO_INDETERMINDATE_MODE", progressComponent.getId());
      //Just get this to indeterminate state indefinitely on this condition.
      percentComplete = PERCENT_UNKNOWN;
    }

    if (percentComplete < 0)
View Full Code Here

{
  @SuppressWarnings("unchecked")
  @Override
  public void decode(FacesContext context, UIComponent component)
  {
    UIXProgress progressComponent = (UIXProgress)component;
    Map<String, Object> attrs = component.getAttributes();

    Object modelValue= attrs.get(UIConstants.VALUE_PARAM);
    if (modelValue instanceof BoundedRangeModel)
    {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.component.UIXProgress

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.