コード例 #1
0
  private void initializeStatusGrid() {
    // Creacion del Grid Base
    StatusItemProperties props = GWT.create(StatusItemProperties.class);
    statusStore = new ListStore<StatusItem>(props.key());
    statusStore.setAutoCommit(true);

    ColumnConfig<StatusItem, String> nameCol =
        new ColumnConfig<StatusItem, String>(
            props.name(), 75, UIMessages.INSTANCE.fedColumnNameText());

    ColumnConfig<StatusItem, String> valueCol =
        new ColumnConfig<StatusItem, String>(
            props.value(), 150, UIMessages.INSTANCE.fedNewAttributeDefaultNameText());

    List<ColumnConfig<StatusItem, ?>> columns = new ArrayList<ColumnConfig<StatusItem, ?>>();
    columns.add(nameCol);
    columns.add(valueCol);

    statusGrid = new Grid<StatusItem>(statusStore, new ColumnModel<StatusItem>(columns));
    statusGrid.setSelectionModel(new CellSelectionModel<StatusItem>());
    statusGrid.getColumnModel().getColumn(1).setHideable(false);
    statusGrid.setHideHeaders(true);
    statusGrid.setAllowTextSelection(true);
    statusGrid.getView().setStripeRows(true);
    statusGrid.getView().setColumnLines(true);
    statusGrid.setBorders(false);

    statusStore.add(new StatusItem(LON_LABEL, null));
    statusStore.add(new StatusItem(LAT_LABEL, null));
    statusStore.add(new StatusItem(SCALE_LABEL, null));
    statusStore.add(new StatusItem(CLICK_COORD_X, null));
    statusStore.add(new StatusItem(CLICK_COORD_Y, null));
  }
コード例 #2
0
ファイル: ToolVolumeListEditor.java プロジェクト: cyverse/DE
  @Inject
  public ToolVolumeListEditor(
      ToolVolumeProperties toolVolumeProperties, ToolAdminView.ToolAdminViewAppearance appearance) {
    this.appearance = appearance;
    listStore =
        new ListStore<>(
            new ModelKeyProvider<ToolVolume>() {
              @Override
              public String getKey(ToolVolume item) {
                return getVolumeTag(item);
              }
            });
    listStoreEditor = new ListStoreEditor<>(listStore);
    listStore.setAutoCommit(true);

    ColumnConfig<ToolVolume, String> hostPath =
        new ColumnConfig<>(
            toolVolumeProperties.hostPath(),
            appearance.containerVolumesHostPathWidth(),
            appearance.containerVolumesHostPathLabel());
    ColumnConfig<ToolVolume, String> containerPath =
        new ColumnConfig<>(
            toolVolumeProperties.containerPath(),
            appearance.containerVolumesContainerPathWidth(),
            appearance.containerVolumesContainerPathLabel());

    List<ColumnConfig<ToolVolume, ?>> columns = new ArrayList<>();
    columns.add(hostPath);
    columns.add(containerPath);
    ColumnModel<ToolVolume> cm = new ColumnModel<>(columns);

    grid = new Grid<>(listStore, cm);
    grid.setHeight(100);

    editing = new GridRowEditing<>(grid);
    enableGridEditing(hostPath, containerPath);
    editing.addCancelEditHandler(getCancelHandler());
    ((AbstractGridEditing<ToolVolume>) editing).setClicksToEdit(ClicksToEdit.TWO);

    initWidget(grid);
  }