Package org.richfaces.model.selection

Examples of org.richfaces.model.selection.SelectionRange


    StringBuffer buffer = new StringBuffer();
    Iterator iterator = ((ClientSelection) value).getRanges().iterator();
   
    while(iterator.hasNext()) {
     
      SelectionRange selectionRange =
        (SelectionRange) iterator.next();
     
      buffer
        .append(selectionRange.getStartIndex())
        .append(",")
        .append(selectionRange.getEndIndex())
        .append(";");
    }
   
    return buffer.toString();
  }
View Full Code Here


         
          if (log.isDebugEnabled()) {
            log.debug("Parsed range " + fi + " " + il);
          }
         
          clientSelection.addRange(new SelectionRange(fi, il));
         
        } catch (NumberFormatException e) {
          throw new ConverterException(e);
        }
      }
View Full Code Here

  }
 
  public void testShouldAddToSelection() {
   
    ClientSelection oldSelection = new ClientSelection();
    oldSelection.addRange(new SelectionRange(10, 15));
    oldSelection.addRange(new SelectionRange(16, 20));
   
    ClientSelection newSelection = new ClientSelection();
    newSelection.addRange(new SelectionRange(20, 40));
   
    newSelection.setSelectionFlag(ClientSelection.FLAG_ALL);
   
    for(int i = 0; i < 100; i++) {
      assertTrue(
View Full Code Here

  }
 
 
  public void testShouldRemoveFromSelection() {
    ClientSelection oldSelection = new ClientSelection();
    oldSelection.addRange(new SelectionRange(10, 15));
    oldSelection.addRange(new SelectionRange(16, 20));
   
    ClientSelection newSelection = new ClientSelection();
    newSelection.addRange(new SelectionRange(20, 40));
   
    for (int i = 0; i < 10; i++) {
      assertFalse(
          "Contributor wasn't supposed to remove " + i,
          contributor.shouldRemoveFromSelection(i, oldSelection, newSelection)
View Full Code Here

   * Test method for {@link org.richfaces.convert.selection.ClientSelectionConverter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)}.
   */
  public void testGetAsString() {
   
    ClientSelection clientSelection = new ClientSelection();
    clientSelection.addRange(new SelectionRange(2,3));
    clientSelection.addRange(new SelectionRange(5,22));
   
    String value = converter.getAsString(facesContext, null, clientSelection);
   
    assertNotNull(value);
    assertTrue(value.length() > 0);
View Full Code Here

    StringBuffer buffer = new StringBuffer();
    Iterator iterator = ((ClientSelection) value).getRanges().iterator();
   
    while(iterator.hasNext()) {
     
      SelectionRange selectionRange =
        (SelectionRange) iterator.next();
     
      buffer
        .append(selectionRange.getStartIndex())
        .append(",")
        .append(selectionRange.getEndIndex())
        .append(";");
    }
   
    return buffer.toString();
  }
View Full Code Here

         
          if (log.isDebugEnabled()) {
            log.debug("Parsed range " + fi + " " + il);
          }
         
          clientSelection.addRange(new SelectionRange(fi, il));
         
        } catch (NumberFormatException e) {
          throw new ConverterException(e);
        }
      }
View Full Code Here

    StringBuffer buffer = new StringBuffer();
    Iterator iterator = ((ClientSelection) value).getRanges().iterator();
   
    while(iterator.hasNext()) {
     
      SelectionRange selectionRange =
        (SelectionRange) iterator.next();
     
      buffer
        .append(selectionRange.getStartIndex())
        .append(",")
        .append(selectionRange.getEndIndex())
        .append(";");
    }
   
    return buffer.toString();
  }
View Full Code Here

         
          if (log.isDebugEnabled()) {
            log.debug("Parsed range " + fi + " " + il);
          }
         
          clientSelection.addRange(new SelectionRange(fi, il));
         
        } catch (NumberFormatException e) {
          throw new ConverterException(e);
        }
      }
View Full Code Here

TOP

Related Classes of org.richfaces.model.selection.SelectionRange

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.