com.google.gwt.user.cellview.client.CellTable Java Examples

The following examples show how to use com.google.gwt.user.cellview.client.CellTable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DriverStep.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void provisionTable(final CellTable<JDBCDriver> table) {
    table.setRowCount(drivers.size(), true);
    table.setRowData(drivers);

    // clear selection
    JDBCDriver selectedDriver = selectionModel.getSelectedObject();
    if (selectedDriver != null) {
        selectionModel.setSelected(selectedDriver, false);
    }

    // new default selection
    if (drivers.size() > 0) {
        selectionModel.setSelected(drivers.get(0), true);
    }
}
 
Example #2
Source File: ColumnFilter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ColumnFilter(SingleSelectionModel<T> selection, CellTable<T> delegate, Predicate predicate) {
    this.selection = selection;
    this.delegate = delegate;
    this.predicate = predicate;

    delegate.addRowCountChangeHandler(new RowCountChangeEvent.Handler() {
        @Override
        public void onRowCountChange(RowCountChangeEvent event) {
            if (!isFilterActive()) {
                origValues = delegate.getVisibleItems();
            }
        }
    });
}
 
Example #3
Source File: GwtMockitoTestRunner.java    From gwtmockito with Apache License 2.0 4 votes vote down vote up
/**
 * Returns a collection of classes whose non-abstract methods should always be replaced with
 * no-ops. By default, this list includes {@link Composite}, {@link DOM} {@link UIObject},
 * {@link Widget}, {@link Image}, and most subclasses of {@link Panel}. It will also include any
 * classes specified via the {@link WithClassesToStub} annotation on the test class. This makes
 * it much safer to test code that uses or extends these types.
 * <p>
 * This list can be customized via {@link WithClassesToStub} or by defining a new test runner
 * extending {@link GwtMockitoTestRunner} and overriding this method. This allows users to
 * explicitly stub out particular classes that are causing problems in tests. If you override this
 * method, you will probably want to retain the classes that are stubbed here by doing something
 * like this:
 *
 * <pre>
 * &#064;Override
 * protected Collection&lt;Class&lt;?&gt;&gt; getClassesToStub() {
 *   Collection&lt;Class&lt;?&gt;&gt; classes = super.getClassesToStub();
 *   classes.add(MyBaseWidget.class);
 *   return classes;
 * }
 * </pre>
 *
 * @return a collection of classes whose methods should be stubbed with no-ops while running tests
 */
protected Collection<Class<?>> getClassesToStub() {
  Collection<Class<?>> classes = new LinkedList<Class<?>>();
  classes.add(Composite.class);
  classes.add(DOM.class);
  classes.add(UIObject.class);
  classes.add(Widget.class);

  classes.add(DataGrid.class);
  classes.add(HTMLTable.class);
  classes.add(Image.class);

  classes.add(AbsolutePanel.class);
  classes.add(CellList.class);
  classes.add(CellPanel.class);
  classes.add(CellTable.class);
  classes.add(ComplexPanel.class);
  classes.add(DeckLayoutPanel.class);
  classes.add(DeckPanel.class);
  classes.add(DecoratorPanel.class);
  classes.add(DockLayoutPanel.class);
  classes.add(DockPanel.class);
  classes.add(FlowPanel.class);
  classes.add(FocusPanel.class);
  classes.add(HorizontalPanel.class);
  classes.add(HTMLPanel.class);
  classes.add(LayoutPanel.class);
  classes.add(Panel.class);
  classes.add(PopupPanel.class);
  classes.add(RenderablePanel.class);
  classes.add(ResizeLayoutPanel.class);
  classes.add(SimpleLayoutPanel.class);
  classes.add(SimplePanel.class);
  classes.add(SplitLayoutPanel.class);
  classes.add(StackPanel.class);
  classes.add(VerticalPanel.class);
  classes.add(ValueListBox.class);

  WithClassesToStub annotation = unitTestClass.getAnnotation(WithClassesToStub.class);
  if (annotation != null) {
    classes.addAll(Arrays.asList(annotation.value()));
  }

  return classes;
}
 
Example #4
Source File: GwtMockitoTest.java    From gwtmockito with Apache License 2.0 4 votes vote down vote up
@Test
@SuppressWarnings("unused")
public void shouldBeAbleToCreateCellTables() {
  new CellTable<String>();
}
 
Example #5
Source File: SocketTable.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public CellTable<SocketBinding> getCellTable() {
    return table;
}
 
Example #6
Source File: TablePicker.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public TablePicker(final CellTable<T> table, final ValueRenderer<T> renderer) {

        this.cellTable = table;
        this.renderer = renderer;
    }
 
Example #7
Source File: NamedTable.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
NamedTable(String title, CellTable<T> table) {
    this.title = title;
    this.widget = table;
}
 
Example #8
Source File: MultipleToOneLayout.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public MultipleToOneLayout setMaster(String title, CellTable table)
{
    this.master = new NamedTable(title, table);
    return this;
}