com.google.gwt.user.cellview.client.DataGrid.addColumn()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中com.google.gwt.user.cellview.client.DataGrid.addColumn()方法的一些代码示例,展示了DataGrid.addColumn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataGrid.addColumn()方法的具体详情如下:
包路径:com.google.gwt.user.cellview.client.DataGrid
类名称:DataGrid
方法名:addColumn

DataGrid.addColumn介绍

暂无

代码示例

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
 float result = 0;
 if (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1) {
  Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema()));
  downloadSchemaColumn = constructDownloadSchemaColumn();
  table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader);
  table.setColumnWidth(downloadSchemaColumn, 60, Unit.PX);
  result += 60;
 }
 return result;
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
 float result = 0;
 if (!embedded
   && (downloadSchemaColumn == null || table.getColumnIndex(downloadSchemaColumn) == -1)) {
  Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordSchema()));
  downloadSchemaColumn = constructDownloadSchemaColumn("");
  table.addColumn(downloadSchemaColumn, downloadRecordSchemaHeader);
  table.setColumnWidth(downloadSchemaColumn, ACTION_COLUMN_WIDTH, Unit.PX);
  result += ACTION_COLUMN_WIDTH;
 }
 return result;
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
 float result = 0;
 if (!embedded
   && (downloadPropsColumn == null || table.getColumnIndex(downloadPropsColumn) == -1)) {
  Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.configuration()));
  downloadPropsColumn = constructDownloadSchemaColumn("");
  table.addColumn(downloadPropsColumn, downloadRecordSchemaHeader);
  table.setColumnWidth(downloadPropsColumn, ACTION_COLUMN_WIDTH, Unit.PX);
  result += ACTION_COLUMN_WIDTH;
 }
 result += super.constructActions(table, prefWidth);
 return result;
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<EndpointProfileDto> table, float prefWidth) {
 if (enableActions) {
  float result = 0;
  if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
   Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
     SafeHtmlUtils.fromSafeConstant(
       embedded ? Utils.constants.remove() : Utils.constants.delete()));
   deleteColumn = constructDeleteColumn("");
   table.addColumn(deleteColumn, deleteHeader);
   table.setColumnWidth(deleteColumn, 40, Style.Unit.PX);
   result += 40;
  }
  return result;
 } else {
  return 0;
 }
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<ConfigurationSchemaDto> table, float prefWidth) {
 float result = super.constructActions(table, prefWidth);
 if (!embedded && (downloadBaseSchemaColumn == null
   || table.getColumnIndex(downloadBaseSchemaColumn) == -1)) {
  Header<SafeHtml> downloadBaseSchemaHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadBaseSchema()));
  downloadBaseSchemaColumn = constructDownloadBaseSchemaColumnColumn("");
  table.addColumn(downloadBaseSchemaColumn, downloadBaseSchemaHeader);
  table.setColumnWidth(downloadBaseSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
  result += ACTION_COLUMN_WIDTH;
 }
 if (!embedded && (downloadOverrideSchemaColumn == null
   || table.getColumnIndex(downloadOverrideSchemaColumn) == -1)) {
  Header<SafeHtml> downloadOverrideSchemaHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadOverrideSchema()));
  downloadOverrideSchemaColumn = constructDownloadOverrideSchemaColumnColumn("");
  table.addColumn(downloadOverrideSchemaColumn, downloadOverrideSchemaHeader);
  table.setColumnWidth(downloadOverrideSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
  result += ACTION_COLUMN_WIDTH;
 }
 return result;
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<LogSchemaDto> table, float prefWidth) {
 float result = super.constructActions(table, prefWidth);
 if (!embedded
   && (downloadLibraryColumn == null || table.getColumnIndex(downloadLibraryColumn) == -1)) {
  Header<SafeHtml> downloadLibraryHeader = new SafeHtmlHeader(
    SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadRecordLibrary()));
  downloadLibraryColumn = constructDownloadLibraryColumn("");
  table.addColumn(downloadLibraryColumn, downloadLibraryHeader);
  table.setColumnWidth(downloadLibraryColumn, ACTION_COLUMN_WIDTH, Unit.PX);
  result += ACTION_COLUMN_WIDTH;
 }
 if (enableActions) {
  if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
   Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
     SafeHtmlUtils.fromSafeConstant(
       embedded ? Utils.constants.remove() : Utils.constants.delete()));
   deleteColumn = constructDeleteColumn("");
   table.addColumn(deleteColumn, deleteHeader);
   table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX);
   result += ACTION_COLUMN_WIDTH;
  }
 }
 return result;
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<TopicDto> table, float prefWidth) {
 if (enableActions) {
  float result = 0;
  if (!embedded
    && (sendNotificationColumn == null
    || table.getColumnIndex(sendNotificationColumn) == -1)) {
   Header<SafeHtml> sendNotificationHeader = new SafeHtmlHeader(
     SafeHtmlUtils.fromSafeConstant(Utils.constants.sendNotification()));
   sendNotificationColumn = constructSendNotificationColumn("");
   table.addColumn(sendNotificationColumn, sendNotificationHeader);
   table.setColumnWidth(sendNotificationColumn, 40, Unit.PX);
   result += 40;
  }
  if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
   Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
     SafeHtmlUtils.fromSafeConstant(embedded
       ? Utils.constants.remove()
       : Utils.constants.delete()));
   deleteColumn = constructDeleteColumn("");
   table.addColumn(deleteColumn, deleteHeader);
   table.setColumnWidth(deleteColumn, 40, Unit.PX);
   result += 40;
  }
  return result;
 } else {
  return 0;
 }
}

代码示例来源:origin: kaaproject/kaa

@Override
protected float constructActions(DataGrid<SdkProfileDto> table, float prefWidth) {
 float result = 0;
 if (enableActions) {
  if (generateSdkColumn == null || table.getColumnIndex(generateSdkColumn) == -1) {
   Header<SafeHtml> generateSdkHeader;
   generateSdkHeader = new SafeHtmlHeader(
     SafeHtmlUtils.fromSafeConstant(Utils.constants.generateSdk()));
   generateSdkColumn = constructGenerateSdkColumn("");
   table.addColumn(generateSdkColumn, generateSdkHeader);
   table.setColumnWidth(generateSdkColumn, 40, Unit.PX);
   result += 40;
  }
  if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
   Header<SafeHtml> deleteHeader;
   if (embedded) {
    deleteHeader = new SafeHtmlHeader(
      SafeHtmlUtils.fromSafeConstant(Utils.constants.remove()));
   } else {
    deleteHeader = new SafeHtmlHeader(
      SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));
   }
   deleteColumn = constructDeleteColumn("");
   table.addColumn(deleteColumn, deleteHeader);
   table.setColumnWidth(deleteColumn, 40, Unit.PX);
   result += 40;
  }
 }
 return result;
}

代码示例来源:origin: kaaproject/kaa

SafeHtmlUtils.fromSafeConstant(Utils.constants.action()));
table.addColumn(actionColumn, actionHeader);
actionColumn.setFieldUpdater(
  new FieldUpdater<ApplicationEventMapDto, ApplicationEventAction>() {

代码示例来源:origin: org.kie.guvnor/guvnor-test-scenario-editor-client

private void addSuccessColumn() {
  Column<Failure, ImageResource> column = new Column<Failure, ImageResource>(new ImageResourceCell()) {
    @Override
    public ImageResource getValue(Failure failure) {
      presenter.onAddingFailure(failure);
      return CommonImages.INSTANCE.error();
    }
  };
  dataGrid.addColumn(column);
  dataGrid.setColumnWidth(column, 10, Style.Unit.PCT);
}

代码示例来源:origin: marianbuenosayres/jBPM6-Developer-Guide

private void initTableColumns() {
  Column<String, String> messageTextColumn = new Column<String, String>(new TextCell()) {
    @Override
    public String getValue(String string) {
      return string;
    }
  };
  messageTextColumn.setSortable(true);
  sortHandler.setComparator(messageTextColumn, new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
      return o1.compareTo(o2);
    }
  });
  messageListGrid.addColumn(messageTextColumn);
}

代码示例来源:origin: bedatadriven/activityinfo

public ValidationMappingGrid() {
  this.dataGrid = new DataGrid<>(100, DataGridResources.INSTANCE);
  dataGrid.addColumn(new ValidationClassGridColumn(), new TextHeader(I18N.CONSTANTS.message()));
  initWidget(dataGrid);
}

代码示例来源:origin: org.geomajas/geomajas-puregwt-example-base

grid.addColumn(titleColumn, "Title");
grid.setColumnWidth(titleColumn, 300, Unit.PX);
sortHandler.setComparator(titleColumn, new Comparator<ShowcaseSampleDefinition>() {
grid.addColumn(categoryColumn, "Category");
grid.setColumnWidth(categoryColumn, 250, Unit.PX);
sortHandler.setComparator(categoryColumn, new Comparator<ShowcaseSampleDefinition>() {
grid.addColumn(descriptionColumn, "Description");
sortHandler.setComparator(descriptionColumn, new Comparator<ShowcaseSampleDefinition>() {

代码示例来源:origin: org.geomajas/geomajas-gwt-example-base

grid.addColumn(titleColumn, "Title");
grid.setColumnWidth(titleColumn, 300, Unit.PX);
sortHandler.setComparator(titleColumn, new Comparator<ShowcaseSampleDefinition>() {
grid.addColumn(categoryColumn, "Category");
grid.setColumnWidth(categoryColumn, 250, Unit.PX);
sortHandler.setComparator(categoryColumn, new Comparator<ShowcaseSampleDefinition>() {
grid.addColumn(descriptionColumn, "Description");
sortHandler.setComparator(descriptionColumn, new Comparator<ShowcaseSampleDefinition>() {

代码示例来源:origin: org.jresearch.logui/org.jresearch.logui.gwt.core

dataGrid.addColumn(colName, "Name");
dataGrid.setColumnWidth(colName, 90, Unit.PCT);
dataGrid.addColumn(colClassName, "Type");
dataGrid.setColumnWidth(colClassName, 30, Unit.PCT);

代码示例来源:origin: org.kie.guvnor/guvnor-test-scenario-editor-client

private void addTextColumn() {
  Column<Failure, String> column = new Column<Failure, String>(new ClickableTextCell()) {
    @Override
    public String getValue(Failure failure) {
      return failure.getDisplayName();
    }
  };
  column.setFieldUpdater(new FieldUpdater<Failure, String>() {
    @Override
    public void update(int index, Failure failure, String value) {
      presenter.onMessageSelected(failure);
    }
  });
  dataGrid.addColumn(column, TestScenarioConstants.INSTANCE.Text());
  dataGrid.setColumnWidth(column, 60, Style.Unit.PCT);
}

代码示例来源:origin: bedatadriven/activityinfo

public void refresh(ValidatedRowTable table) {
  while (dataGrid.getColumnCount() > 0) {
    dataGrid.removeColumn(0);
  }
  for(int i = 0; i< table.getColumns().size(); i++) {
    final FieldImporterColumn column = table.getColumns().get(i);
    String columnHeader = column.getAccessor().getHeading();
    dataGrid.addColumn(new ValidationRowGridColumn(column.getAccessor(), i),
        new TextHeader(columnHeader));
    dataGrid.setColumnWidth(i, GwtUtil.columnWidthInEm(columnHeader), Style.Unit.EM);
  }
  dataGrid.setRowData(table.getRows());
}

代码示例来源:origin: oVirt/ovirt-engine

private void addColumnImpl(Column<T, ?> column, Header<?> header) {
  // build resizable headers, if necessary
  if (columnResizingEnabled && header instanceof AbstractCheckboxHeader) {
    header = createResizableCheckboxHeader(header, column);
  } else if (columnResizingEnabled) {
    header = createResizableHeader(column, header);
  } else if (applyHeaderStyle && header instanceof SafeHtmlHeader) {
    SafeHtmlHeader safeHtmlHeader = (SafeHtmlHeader) header;
    // not using Resizeable header, but still want it to look that way.
    // nonResizeableColumnHeader does that.
    // TODO nonResizeableColumnHeader copy-pastes CSS. fix.
    SafeHtml newValue = templates.nonResizeableColumnHeader(safeHtmlHeader.getValue());
    header = new SafeHtmlHeader(newValue, safeHtmlHeader.getTooltip());
  }
  // actually add the column
  super.addColumn(column, header);
  // Add empty no-width column as the last column
  if (columnResizingEnabled) {
    if (isColumnPresent(emptyNoWidthColumn)) {
      removeColumn(emptyNoWidthColumn);
    }
    super.addColumn(emptyNoWidthColumn, emptyNoWidthColumnHeader);
  }
  // Add column to header context menu
  if (header instanceof AbstractHeader) {
    ((AbstractHeader) header).setContextMenuHandler(ensureContextMenuHandler());
    contextPopup.getContextMenu().addItem(column);
  }
}

代码示例来源:origin: org.eclipse.che.core/che-core-ide-app

@Inject
public ExtensionManagerViewImpl(
  ToolbarPresenter toolbarPresenter, ActionManager actionManager, Resources resources) {
 dataGrid = new DataGrid<>(100, resources);
 rootElement = ourUiBinder.createAndBindUi(this);
 DefaultActionGroup actionGroup =
   new DefaultActionGroup("extensionManager", false, actionManager);
 actionManager.registerAction("extensionManagerGroup", actionGroup);
 toolbarPresenter.bindMainGroup(actionGroup);
 UIObject.ensureDebugId(descriptionArea, "window-preferences-extensions-descriptionArea");
 Column<ExtensionDescription, String> titleColumn =
   new Column<ExtensionDescription, String>(new TextCell()) {
    @Override
    public String getValue(ExtensionDescription object) {
     return object.getTitle();
    }
   };
 titleColumn.setCellStyleNames(style.titleColumn());
 dataGrid.addColumn(titleColumn);
 SingleSelectionModel<ExtensionDescription> selectionModel =
   new SingleSelectionModel<ExtensionDescription>();
 dataGrid.setSelectionModel(selectionModel);
 selectionModel.addSelectionChangeHandler(
   new SelectionChangeEvent.Handler() {
    @Override
    public void onSelectionChange(SelectionChangeEvent event) {}
   });
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

widget.addColumn(column, classAttributeMetadata.getLabel());

相关文章