Ejemplo n.º 1
0
  public DefaultCellTable asWidget() {

    table = new DefaultCellTable<SocketBinding>(6);
    dataProvider = new ListDataProvider<SocketBinding>();
    dataProvider.addDataDisplay(table);

    TextColumn<SocketBinding> nameColumn =
        new TextColumn<SocketBinding>() {
          @Override
          public String getValue(SocketBinding record) {
            return record.getName();
          }
        };

    TextColumn<SocketBinding> portColumn =
        new TextColumn<SocketBinding>() {
          @Override
          public String getValue(SocketBinding record) {
            return String.valueOf(record.getPort() + portOffset);
          }
        };

    table.addColumn(nameColumn, "Name");
    table.addColumn(portColumn, "Port");

    return table;
  }
Ejemplo n.º 2
0
 public void updateFrom(String groupName, List<SocketBinding> bindings) {
   dataProvider.setList(bindings);
   if (!bindings.isEmpty() && table.getSelectionModel() != null)
     table.getSelectionModel().setSelected(bindings.get(0), true);
 }