Package com.google.gwt.user.cellview.client.ColumnSortList

Examples of com.google.gwt.user.cellview.client.ColumnSortList.ColumnSortInfo


  public void testRemove() {
    ColumnSortList list = new ColumnSortList();

    // Remove the only item.
    ColumnSortInfo info = createColumnSortInfo();
    list.push(info);
    assertEquals(1, list.size());
    assertTrue(list.remove(info));
    assertEquals(0, list.size());

    // Remove a middle item.
    ColumnSortInfo info0 = createColumnSortInfo();
    ColumnSortInfo info1 = createColumnSortInfo();
    ColumnSortInfo info2 = createColumnSortInfo();
    list.push(info0);
    list.push(info1);
    list.push(info2);
    assertEquals(3, list.size());
    assertTrue(list.remove(info1));
View Full Code Here


   * Create a {@link ColumnSortInfo} with a unique column and cell.
   *
   * @return a new {@link ColumnSortInfo}
   */
  private ColumnSortInfo createColumnSortInfo() {
    return new ColumnSortInfo(new IdentityColumn<String>(new TextCell()), true);
  }
View Full Code Here

  public void testAccessors() {
    ColumnSortList sortList = new ColumnSortList();
    IdentityColumn<String> col0 = new IdentityColumn<String>(new TextCell());
    IdentityColumn<String> col1 = new IdentityColumn<String>(new TextCell());
    sortList.push(new ColumnSortInfo(col0, true));
    sortList.push(new ColumnSortInfo(col1, false));

    ColumnSortEvent event = new ColumnSortEvent(sortList);
    assertEquals(sortList, event.getColumnSortList());
    assertEquals(col1, event.getColumn());
    assertFalse(event.isSortAscending());
View Full Code Here

*/
public class ColumnSortInfoTest extends TestCase {

  public void testAccessors() {
    Column<String, String> column = new IdentityColumn<String>(new TextCell());
    ColumnSortInfo info = new ColumnSortInfo(column, true);
    assertEquals(column, info.getColumn());
    assertTrue(info.isAscending());
  }
View Full Code Here

  }

  public void testEquals() {
    // Test equals.
    Column<String, String> column0 = new IdentityColumn<String>(new TextCell());
    ColumnSortInfo info0a = new ColumnSortInfo(column0, true);
    ColumnSortInfo info0b = new ColumnSortInfo(column0, true);
    assertTrue(info0a.equals(info0b));
    assertTrue(info0b.equals(info0a));
    assertEquals(info0a.hashCode(), info0b.hashCode());

    // Test null.
    assertFalse(info0a.equals(null));

    // Test different object.
    assertFalse(info0a.equals("not a ColumnSortInfo"));

    // Test different sort order.
    ColumnSortInfo info0desc = new ColumnSortInfo(column0, false);
    assertFalse(info0a.equals(info0desc));
    assertFalse(info0desc.equals(info0a));
    assertTrue(info0a.hashCode() != info0desc.hashCode());

    // Test different column.
    Column<String, String> column1 = new IdentityColumn<String>(new TextCell());
    ColumnSortInfo info1 = new ColumnSortInfo(column1, true);
    assertFalse(info0a.equals(info1));
    assertFalse(info1.equals(info0a));
    assertTrue(info0a.hashCode() != info1.hashCode());
  }
View Full Code Here

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.appendHtmlConstant("<tr role='row'>");
    int columnCount = columns.size();
    if (columnCount > 0) {
      // Get information about the sorted column.
      ColumnSortInfo sortedInfo = (sortList.size() == 0) ? null
          : sortList.get(0);
      Column<?, ?> sortedColumn = (sortedInfo == null) ? null
          : sortedInfo.getColumn();
      boolean isSortAscending = (sortedInfo == null) ? false
          : sortedInfo.isAscending();

      // Setup the first column.
      Header<?> prevHeader = theHeaders.get(0);
      Column<T, ?> column = columns.get(0);
      int prevColspan = 1;
View Full Code Here

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.appendHtmlConstant("<tr role='row'>");
    int columnCount = columns.size();
    if (columnCount > 0) {
      // Get information about the sorted column.
      ColumnSortInfo sortedInfo = (sortList.size() == 0) ? null
          : sortList.get(0);
      Column<?, ?> sortedColumn = (sortedInfo == null) ? null
          : sortedInfo.getColumn();
      boolean isSortAscending = (sortedInfo == null) ? false
          : sortedInfo.isAscending();

      // Setup the first column.
      Header<?> prevHeader = theHeaders.get(0);
      Column<T, ?> column = columns.get(0);
      int prevColspan = 1;
View Full Code Here

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.appendHtmlConstant("<tr>");
    int columnCount = columns.size();
    if (columnCount > 0) {
      // Get information about the sorted column.
      ColumnSortInfo sortedInfo = (sortList.size() == 0) ? null
          : sortList.get(0);
      Column<?, ?> sortedColumn = (sortedInfo == null) ? null
          : sortedInfo.getColumn();
      boolean isSortAscending = (sortedInfo == null) ? false
          : sortedInfo.isAscending();

      // Setup the first column.
      Header<?> prevHeader = theHeaders.get(0);
      Column<T, ?> column = columns.get(0);
      int prevColspan = 1;
View Full Code Here

    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.appendHtmlConstant("<tr>");
    int columnCount = columns.size();
    if (columnCount > 0) {
      // Get information about the sorted column.
      ColumnSortInfo sortedInfo = (sortList.size() == 0) ? null : sortList.get(0);
      Column<?, ?> sortedColumn = (sortedInfo == null) ? null : sortedInfo.getColumn();
      boolean isSortAscending = (sortedInfo == null) ? false : sortedInfo.isAscending();

      // Setup the first column.
      Header<?> prevHeader = theHeaders.get(0);
      Column<T, ?> column = columns.get(0);
      int prevColspan = 1;
View Full Code Here

TOP

Related Classes of com.google.gwt.user.cellview.client.ColumnSortList.ColumnSortInfo

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.