Package org.apache.myfaces.trinidad.component

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


          if (size < 0)
            size = 0;

          if ( value >= 0 )
          {
            UIXProcess process = (UIXProcess)component;
            Object oldPath = process.getRowKey();
            Object focusPath = process.getFocusRowKey();
            process.setRowKey(focusPath);
            UIComponent stamp = process.getNodeStamp();
            int index = process.getRowIndex();

            if (size == 0)
            {
              index = ProcessUtils.getBackIndex(process, stamp, index);
            }
            else
            {
              index = ProcessUtils.getNextIndex(process, stamp, index);
            }

            process.setRowIndex(index);
            new ActionEvent(stamp).queue();
            process.setRowKey(oldPath);
          }
        }
      }
    }
  }
View Full Code Here


    {
      _LOG.warning("Trains must be used inside of a form");
      return;
    }

    UIXProcess process = (UIXProcess) component;         
    UIComponent stamp = process.getNodeStamp();
   
    if(stamp != null)
    {
      Object oldPath = process.getRowKey();     
      boolean isNewPath = _setNewPath(process);
      if (isNewPath)
      {
        int selectedIndex = process.getRowIndex();
        int length = process.getRowCount();     
        String pattern;
        String[] parameters;
       
        selectedIndex++;
       
        if (length == XhtmlConstants.MAX_VALUE_UNKNOWN)
        {
          pattern = arc.getTranslatedString(
            _SINGLE_RANGE_FORMAT_NO_TOTAL_STRING);
   
          parameters = new String[]
          {
            arc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex)
          };
         
        }
        else
        {
          pattern = arc.getTranslatedString(_SINGLE_RANGE_FORMAT_TOTAL_STRING);
   
          parameters = new String[]
          {
            arc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex),
            IntegerUtils.getString(length)
          };
        }

        ResponseWriter writer = context.getResponseWriter();
        String outputText = XhtmlUtils.getFormattedString(pattern, parameters);
        writer.writeText(outputText, null);
       
        process.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

          if (size < 0)
            size = 0;

          if (value >= 0)
          {
            UIXProcess process = (UIXProcess) component;
            Object oldPath = process.getRowKey();
            Object focusPath = process.getFocusRowKey();
            process.setRowKey(focusPath);
            UIComponent stamp = process.getNodeStamp();
            int index = process.getRowIndex();

            if (size == 0)
            {
              index = ProcessUtils.getBackIndex(process, stamp, index);
            }
            else
            {
              index = ProcessUtils.getNextIndex(process, stamp, index);
            }

            process.setRowIndex(index);
            new ActionEvent(stamp).queue();
            process.setRowKey(oldPath);
          }
        }
      }
    }
  }
View Full Code Here

    {
      _LOG.warning("Trains must be used inside of a form");
      return;
    }

    UIXProcess process = (UIXProcess) component;
    UIComponent stamp = process.getNodeStamp();

    if (stamp != null)
    {
      Train train = new Train(context, arc, process, stamp);
      try
      {
        process.setRowKey(train.getFocusRowKey());
       
        // Renders some fields and scripts
        _renderHiddenFields(context, arc, train);
       
        ResponseWriter writer = context.getResponseWriter();
       
        // Need to render the frame even if there's no visible station
        // to support PPR.
        writer.startElement(XhtmlConstants.TABLE_ELEMENT, component);
        process.setRowKey(train.getInitialRowKey());
        renderId(context, component);
        renderAllAttributes(context, arc, bean);
        // Does not seem to be needed and this is not XHTML 1.0 Strict compliant
        // writer.writeAttribute("align", "center", null);
       
        if(!train.getStations().isEmpty())
        {
          process.setRowKey(train.getFocusRowKey());
       
          // There're visible stations currently, let render them.
          writer.startElement(XhtmlConstants.TABLE_BODY_ELEMENT, null);
          _renderTrain(context, arc, process, bean, stamp, train);
          writer.endElement(XhtmlConstants.TABLE_BODY_ELEMENT);
        }
       
        writer.endElement(XhtmlConstants.TABLE_ELEMENT);
      }
      finally
      {
        // Always restore the model, whatever happened
        process.setRowKey(train.getInitialRowKey());
      }
    }
    else
    {
      _LOG.warning("Train expect a nodeStamp facet, " +
View Full Code Here

          if (size < 0)
            size = 0;

          if (value >= 0)
          {
            UIXProcess process = (UIXProcess) component;
            Object oldPath = process.getRowKey();
            Object focusPath = process.getFocusRowKey();
            process.setRowKey(focusPath);
            UIComponent stamp = process.getNodeStamp();
            int index = process.getRowIndex();

            if (size == 0)
            {
              index = ProcessUtils.getBackIndex(process, stamp, index);
            }
            else
            {
              index = ProcessUtils.getNextIndex(process, stamp, index);
            }

            process.setRowIndex(index);
            new ActionEvent(stamp).queue();
            process.setRowKey(oldPath);
          }
        }
      }
    }
  }
View Full Code Here

    {
      _LOG.warning("TRAIN_MUST_INSIDE_FORM");
      return;
    }

    UIXProcess process = (UIXProcess) component;
    UIComponent stamp = process.getNodeStamp();

    if (stamp != null)
    {
      Train train = new Train(context, rc, process, stamp);
      try
      {
        process.setRowKey(train.getFocusRowKey());

        // Renders some fields and scripts
        _renderHiddenFields(context, rc, train);

        ResponseWriter writer = context.getResponseWriter();

        // Need to render the frame even if there's no visible station
        // to support PPR.
        writer.startElement(XhtmlConstants.TABLE_ELEMENT, component);
        process.setRowKey(train.getInitialRowKey());
        renderId(context, component);
        renderAllAttributes(context, rc, component, bean);
        // Does not seem to be needed and this is not XHTML 1.0 Strict compliant
        // writer.writeAttribute("align", "center", null);

        if(!train.getStations().isEmpty())
        {
          process.setRowKey(train.getFocusRowKey());

          // There're visible stations currently, let render them.
          writer.startElement(XhtmlConstants.TABLE_BODY_ELEMENT, null);
          _renderTrain(context, rc, process, bean, stamp, train);
          writer.endElement(XhtmlConstants.TABLE_BODY_ELEMENT);
        }

        writer.endElement(XhtmlConstants.TABLE_ELEMENT);
      }
      finally
      {
        // Always restore the model, whatever happened
        process.setRowKey(train.getInitialRowKey());
      }
    }
    else
    {
      _LOG.warning("NODESTAMP_FACET_NOT_FOUND_FOR_TRAIN", component);
View Full Code Here

    {
      _LOG.warning("TRAIN_MUST_INSIDE_FORM");
      return;
    }

    UIXProcess process = (UIXProcess) component;
    UIComponent stamp = process.getNodeStamp();

    if(stamp != null)
    {
      Object oldPath = process.getRowKey();
      boolean isNewPath = _setNewPath(process);
      if (isNewPath)
      {
        int selectedIndex = process.getRowIndex();
        int length = process.getRowCount();
        String pattern;
        String[] parameters;

        selectedIndex++;

        if (length == XhtmlConstants.MAX_VALUE_UNKNOWN)
        {
          pattern = rc.getTranslatedString(
            _SINGLE_RANGE_FORMAT_NO_TOTAL_STRING);

          parameters = new String[]
          {
            rc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex)
          };

        }
        else
        {
          pattern = rc.getTranslatedString(_SINGLE_RANGE_FORMAT_TOTAL_STRING);

          parameters = new String[]
          {
            rc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex),
            IntegerUtils.getString(length)
          };
        }

        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("span", null);
        renderInlineStyle(context, rc, component, bean);
        String outputText = XhtmlUtils.getFormattedString(pattern, parameters);
        writer.writeText(outputText, null);
        writer.endElement("span");
        process.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

    {
      _LOG.warning("TRAIN_MUST_INSIDE_FORM");
      return;
    }

    UIXProcess process = (UIXProcess) component;         
    UIComponent stamp = process.getNodeStamp();
   
    if(stamp != null)
    {
      Object oldPath = process.getRowKey();     
      boolean isNewPath = _setNewPath(process);
      if (isNewPath)
      {
        int selectedIndex = process.getRowIndex();
        int length = process.getRowCount();     
        String pattern;
        String[] parameters;
       
        selectedIndex++;
       
        if (length == XhtmlConstants.MAX_VALUE_UNKNOWN)
        {
          pattern = arc.getTranslatedString(
            _SINGLE_RANGE_FORMAT_NO_TOTAL_STRING);
   
          parameters = new String[]
          {
            arc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex)
          };
         
        }
        else
        {
          pattern = arc.getTranslatedString(_SINGLE_RANGE_FORMAT_TOTAL_STRING);
   
          parameters = new String[]
          {
            arc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex),
            IntegerUtils.getString(length)
          };
        }

        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("span", null);
        renderInlineStyle(context, arc, bean);
        String outputText = XhtmlUtils.getFormattedString(pattern, parameters);
        writer.writeText(outputText, null);
        writer.endElement("span");
        process.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

    {
      _LOG.warning("TRAIN_MUST_INSIDE_FORM");
      return;
    }

    UIXProcess process = (UIXProcess) component;
    UIComponent stamp = process.getNodeStamp();

    if(stamp != null)
    {
      Object oldPath = process.getRowKey();
      boolean isNewPath = _setNewPath(process);
      if (isNewPath)
      {
        int selectedIndex = process.getRowIndex();
        int length = process.getRowCount();
        String pattern;
        String[] parameters;

        selectedIndex++;

        if (length == XhtmlConstants.MAX_VALUE_UNKNOWN)
        {
          pattern = rc.getTranslatedString(
            _SINGLE_RANGE_FORMAT_NO_TOTAL_STRING);

          parameters = new String[]
          {
            rc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex)
          };

        }
        else
        {
          pattern = rc.getTranslatedString(_SINGLE_RANGE_FORMAT_TOTAL_STRING);

          parameters = new String[]
          {
            rc.getTranslatedString(_STEP_TEXT_KEY),
            IntegerUtils.getString(selectedIndex),
            IntegerUtils.getString(length)
          };
        }

        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("span", null);
        renderInlineStyle(context, rc, component, bean);
        String outputText = XhtmlUtils.getFormattedString(pattern, parameters);
        writer.writeText(outputText, null);
        writer.endElement("span");
        process.setRowKey(oldPath);
      }
    }
  }
View Full Code Here

          if (size < 0)
            size = 0;

          if (value >= 0)
          {
            UIXProcess process = (UIXProcess) component;
            Object oldPath = process.getRowKey();
            Object focusPath = process.getFocusRowKey();
            process.setRowKey(focusPath);
            UIComponent stamp = process.getNodeStamp();
            int index = process.getRowIndex();

            if (size == 0)
            {
              index = ProcessUtils.getBackIndex(process, stamp, index);
            }
            else
            {
              index = ProcessUtils.getNextIndex(process, stamp, index);
            }

            process.setRowIndex(index);
            new ActionEvent(stamp).queue();
            process.setRowKey(oldPath);
          }
        }
      }
    }
  }
View Full Code Here

TOP

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

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.