当前位置: 首页>>代码示例>>Java>>正文


Java DataGrid类代码示例

本文整理汇总了Java中com.google.gwt.user.cellview.client.DataGrid的典型用法代码示例。如果您正苦于以下问题:Java DataGrid类的具体用法?Java DataGrid怎么用?Java DataGrid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataGrid类属于com.google.gwt.user.cellview.client包,在下文中一共展示了DataGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: constructBooleanColumn

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
protected float constructBooleanColumn(DataGrid<T> table, String title,
        final BooleanValueProvider<T> valueProvider, 
        Comparator<T> comparator, Boolean isSortAscending, float prefWidth) {
    Header<SafeHtml> header = new SafeHtmlHeader(
            SafeHtmlUtils.fromSafeConstant(title));
    Column<T, Boolean> column = new Column<T, Boolean>(new UneditableCheckboxCell()) {
        @Override
        public Boolean getValue(T item) {
            return valueProvider.getValue(item);
        }
    };
    column.setFieldUpdater(new FieldUpdater<T,Boolean>() {
        @Override
        public void update(int index, T object, Boolean value) {
            onRowClicked(getObjectId(object));
        }
    });
    table.addColumn(column, header);
    table.setColumnWidth(column, prefWidth, Unit.PX);
    processColumnSort(table, column, comparator, isSortAscending);
    return prefWidth;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:23,代码来源:AbstractGrid.java

示例2: constructActions

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
protected float constructActions(DataGrid<T> table, float prefWidth) {
    if (enableActions) {
        if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
            Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
                    SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));

            deleteColumn = constructDeleteColumn("");
            table.addColumn(deleteColumn, deleteHeader);
            table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX);
            return ACTION_COLUMN_WIDTH;
        }
        else {
            return 0;
        }
    }
    else {
        return 0;
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:20,代码来源:AbstractGrid.java

示例3: constructActions

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@Override
protected float constructActions(DataGrid<FormField> table, float prefWidth) {
    if (enableActions) {
        if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
            Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
                    SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));

            deleteColumn = constructDeleteColumn("");
            table.addColumn(deleteColumn, deleteHeader);
            table.setColumnWidth(deleteColumn, DELETE_COLUMN_WIDTH, Unit.PX);
            return DELETE_COLUMN_WIDTH;
        }
        else {
            return 0;
        }
    }
    else {
        return 0;
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:21,代码来源:ArrayFieldWidget.java

示例4: constructActions

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@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;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:BasePluginGrid.java

示例5: constructColumnsImpl

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@Override
protected float constructColumnsImpl(DataGrid<ApplicationDto> table) {
  float prefWidth = 0;

  prefWidth += constructStringColumn(table,
      Utils.constants.appName(),
      new StringValueProvider<ApplicationDto>() {
        @Override
        public String getValue(ApplicationDto item) {
          return item.getName();
        }
      },
      new Comparator<ApplicationDto>() {
        @Override
        public int compare(ApplicationDto o1, ApplicationDto o2) {
          return o1.getName().compareToIgnoreCase(o2.getName());
        }
      },
      Boolean.TRUE,
      true,
      160);

  return prefWidth;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:25,代码来源:ApplicationsGrid.java

示例6: constructColumnsImpl

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@Override
protected float constructColumnsImpl(DataGrid<TenantDto> table) {
  float prefWidth = 0;

  prefWidth += constructStringColumn(table,
      Utils.constants.tenantName(),
      new StringValueProvider<TenantDto>() {
        @Override
        public String getValue(TenantDto item) {
          return item.getName();
        }
      }, 160);


  return prefWidth;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:TenantsGrid.java

示例7: constructColumnsImpl

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@Override
protected float constructColumnsImpl(DataGrid<ConfigurationRecordDto> table) {
  float prefWidth = 0;
  prefWidth += constructStringColumn(table,
      Utils.constants.configurationSchema(),
      new StringValueProvider<ConfigurationRecordDto>() {
        @Override
        public String getValue(ConfigurationRecordDto item) {
          return item.getSchemaVersion() + "";
        }
      }, 80);

  prefWidth += super.constructColumnsImpl(table);

  return prefWidth;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:ConfigurationStructGrid.java

示例8: constructActions

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@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;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:27,代码来源:ConfigSchemaGrid.java

示例9: constructActions

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@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;
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:22,代码来源:EndpointProfileGrid.java

示例10: initializeGrid

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
protected void initializeGrid() {
	
	/*
	 * Set a key provider that provides a unique key for each payment.
	 */
	loanResults = new DataGrid<Payment>(KEY_PROVIDER);
	
	/*
	 * Do not refresh the headers every time the data is updated. The footer
	 * depends on the current data, so we do not disable auto refresh on the
	 * footer.
	 */
	loanResults.setAutoHeaderRefreshDisabled(true);
	
	// Set the message to display when the table is empty.
	loanResults.setEmptyTableWidget(new Label(Messages.INSTANCE.no_results()));
	
	dataProvider.addDataDisplay(loanResults);
	
}
 
开发者ID:fastnsilver,项目名称:fns-projects,代码行数:21,代码来源:LoanMainViewImpl.java

示例11: ExtensionManagerViewImpl

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@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) {}
      });
}
 
开发者ID:eclipse,项目名称:che,代码行数:31,代码来源:ExtensionManagerViewImpl.java

示例12: MailListView

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
@SuppressWarnings("unused")
private MailListView() {
  list = new DataGrid<MailItem>();

  initWidget(binder.createAndBindUi(this));

  createGrid();
}
 
开发者ID:mvp4g,项目名称:mvp4g-examples,代码行数:9,代码来源:MailListView.java

示例13: setupGrid

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
private void setupGrid() {
    attrGrid = new DataGrid<String[]>(1024*1024, ZicoDataGridResources.INSTANCE, KEY_PROVIDER);
    selectionModel = new SingleSelectionModel<String[]>(KEY_PROVIDER);
    attrGrid.setSelectionModel(selectionModel);

    Column<String[], String> colAttribute = new Column<String[], String>(ATTR_CELL) {
        @Override
        public String getValue(String[] attr) {
            return attr[0];
        }
    };
    attrGrid.addColumn(colAttribute);
    attrGrid.setColumnWidth(colAttribute, 100, Style.Unit.PCT);

    attrStore = new ListDataProvider<String[]>(KEY_PROVIDER);
    attrStore.addDataDisplay(attrGrid);

    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        @Override
        public void onSelectionChange(SelectionChangeEvent event) {
            String[] item = selectionModel.getSelectedObject();
            if (item != null) {
                lblAttrName.setText("Selected attribute: " + item[0]);
                txtAttrVal.setText(item[1]);
            }
        }
    });

    attrGrid.setSize("100%", "100%");
}
 
开发者ID:jitlogic,项目名称:zico,代码行数:31,代码来源:MethodAttrsDialog.java

示例14: constructStringColumn

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
protected float constructStringColumn(DataGrid<T> table, String title,
        final StringValueProvider<T> valueProvider, 
        Comparator<T> comparator, Boolean isSortAscending, boolean filtrable, float prefWidth) {
    Header<SafeHtml> header = new SafeHtmlHeader(
            SafeHtmlUtils.fromSafeConstant(title));
    Column<T, String> column = null;
    if (filtrable) {
        FiltrableStringColumn<T> filtrableColumn = new FiltrableStringColumn<T>(new LinkCell()) {
            @Override
            public String getValue(T item) {
                return valueProvider.getValue(item);
            }
        };
        filtrableColumns.add(filtrableColumn);
        column = filtrableColumn;
    } else {
        column = new Column<T, String>(new LinkCell()) {
            @Override
            public String getValue(T item) {
                return valueProvider.getValue(item);
            }
        };
    }
    column.setFieldUpdater(new FieldUpdater<T,String>() {
        @Override
        public void update(int index, T object, String value) {
            onRowClicked(getObjectId(object));
        }
    });
    table.addColumn(column, header);
    table.setColumnWidth(column, prefWidth, Unit.PX);
    processColumnSort(table, column, comparator, isSortAscending);
    return prefWidth;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:35,代码来源:AbstractGrid.java

示例15: processColumnSort

import com.google.gwt.user.cellview.client.DataGrid; //导入依赖的package包/类
private void processColumnSort(DataGrid<T> table, Column<?,?> column, 
        Comparator<T> comparator, Boolean isSortAscending) {
    if (comparator != null) {
        comparators.put(column, comparator);
        column.setSortable(true);
        if (isSortAscending != null) {
            ColumnSortList.ColumnSortInfo sortInfo = new ColumnSortList.ColumnSortInfo(column, isSortAscending.booleanValue());
            ColumnSortList sortList = table.getColumnSortList();
            sortList.insert(sortList.size(), sortInfo);
        }
    }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:13,代码来源:AbstractGrid.java


注:本文中的com.google.gwt.user.cellview.client.DataGrid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。