Package com.cedarsolutions.client.gwt.custom.table

Examples of com.cedarsolutions.client.gwt.custom.table.CheckboxCell


    /** Selection column, which holds the selection checkbox. */
    public class SelectionColumn extends Column<T, Boolean> {
        protected SwitchableSelectionModel<T> selectionModel;

        public SelectionColumn(SwitchableSelectionModel<T> selectionModel) {
            super(new CheckboxCell(true, false));
            this.setSortable(false);
            this.selectionModel = selectionModel;
        }
View Full Code Here


        protected boolean selected = false;
        protected DataTable<T> table;
        protected SwitchableSelectionModel<T> selectionModel;

        public SelectionHeader(DataTable<T> table, SwitchableSelectionModel<T> selectionModel) {
            super(new CheckboxCell(true, false));
            this.table = table;
            this.selectionModel = selectionModel;
            this.refreshCheckboxState();
        }
View Full Code Here

        public SelectionType getSelectionType() {
            return this.selectionModel.getSelectionType();
        }

        private void refreshCheckboxState() {
            CheckboxCell cell = (CheckboxCell) this.getCell();
            cell.setEnabled(this.selectionModel.getSelectionType() == SelectionType.MULTI);
        }
View Full Code Here

// Added new tests to verify the new disabled functionality.
public class CheckboxCellClientTest extends EditableCellTestBase<Boolean, Boolean> {

  public void testConstructor() {
    {
      CheckboxCell cell = new CheckboxCell(true, false);
      assertTrue(cell.dependsOnSelection());
      assertFalse(cell.handlesSelection());
    }

    {
      CheckboxCell cell = new CheckboxCell(false, true);
      assertFalse(cell.dependsOnSelection());
      assertTrue(cell.handlesSelection());
    }
  }
View Full Code Here

        Boolean.FALSE, false);
  }

  // Added for CedarCommon
  public void testRenderViewDataDisabledChecked() {
    CheckboxCell cell = createCell();
    cell.setEnabled(false);
    Boolean value = Boolean.TRUE;
    cell.setViewData(DEFAULT_KEY, createCellViewData());
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, DEFAULT_KEY);
    cell.render(context, value, sb);
    String expectedInnerHtmlViewData = getExpectedInnerHtmlViewDisabled();
    String asString = sb.toSafeHtml().asString();
    assertEquals(expectedInnerHtmlViewData, asString);
  }
View Full Code Here

    assertEquals(expectedInnerHtmlViewData, asString);
  }

  // Added for CedarCommon
  public void testRenderViewDataDisabledUnchecked() {
    CheckboxCell cell = createCell();
    cell.setEnabled(false);
    Boolean value = Boolean.FALSE;
    cell.setViewData(DEFAULT_KEY, createCellViewData());
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    Context context = new Context(0, 0, DEFAULT_KEY);
    cell.render(context, value, sb);
    String expectedInnerHtmlViewData = getExpectedInnerHtmlViewDisabled();
    String asString = sb.toSafeHtml().asString();
    assertEquals(expectedInnerHtmlViewData, asString);
  }
View Full Code Here

    assertEquals(expectedInnerHtmlViewData, asString);
  }

  @Override
  protected CheckboxCell createCell() {
    return new CheckboxCell(false, false);
  }
View Full Code Here

TOP

Related Classes of com.cedarsolutions.client.gwt.custom.table.CheckboxCell

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.