本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.Grid类的典型用法代码示例。如果您正苦于以下问题:Java Grid类的具体用法?Java Grid怎么用?Java Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Grid类属于com.extjs.gxt.ui.client.widget.grid包,在下文中一共展示了Grid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePossibleDuplicatesGrid
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
private Grid<ContactDTO> generatePossibleDuplicatesGrid() {
ColumnConfig nameColumn = new ColumnConfig(ContactDTO.FULLNAME, I18N.CONSTANTS.fullName(), 250);
ColumnConfig emailColumn = new ColumnConfig(ContactDTO.EMAIL, I18N.CONSTANTS.email(), 250);
ColumnConfig actionsColumn = new ColumnConfig();
actionsColumn.setWidth(100);
actionsColumn.setRenderer(new GridCellRenderer<ContactDTO>() {
@Override
public Object render(final ContactDTO contact, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
Button button = Forms.button(I18N.CONSTANTS.dedupeContactUpdateButton());
button.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
cardLayout.setActiveItem(secondStepContainer);
secondStepHandler.initialize(contact.getId(), duplicatedPropertiesGrid.getStore());
selectedContact = contact;
}
});
return button;
}
});
ColumnModel columnModel = new ColumnModel(Arrays.asList(nameColumn, emailColumn, actionsColumn));
return new Grid<ContactDTO>(new ListStore<ContactDTO>(), columnModel);
}
示例2: onAttachTabWidgets
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
* On attach tab widgets.
*
* @param event
* the event
*/
private void onAttachTabWidgets(AppEvent event)
{
if (tabWidget == null)
{
tabWidget = (TabWidget) event.getData();
tabWidget.add(new RulesTabItem(RULES_TAB_ITEM_ID, rulesManagerServiceRemote,
gsManagerServiceRemote, profilesManagerServiceRemote,
instancesManagerServiceRemote, workspacesManagerServiceRemote));
RulesTabItem rulesTabItem = (RulesTabItem) tabWidget.getItemByItemId(RULES_TAB_ITEM_ID);
final RuleGridWidget rulesInfoWidget = rulesTabItem.getRuleManagementWidget().getRulesInfo();
final Grid<RuleModel> grid = rulesInfoWidget.getGrid();
grid.getStore().setSortField(BeanKeyValue.PRIORITY.getValue());
grid.getStore().setSortDir(SortDir.ASC);
grid.getStore().sort(BeanKeyValue.PRIORITY.getValue(), SortDir.ASC);
}
}
示例3: render
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public Object render(final RuleModel model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<RuleModel> store, Grid<RuleModel> grid) {
if (!init) {
init = true;
grid.addListener(Events.ColumnResize, new ResizeListener(20));
}
LabelField field = new LabelField();
field.setId(fieldId);
field.setName(fieldId);
field.setEmptyText("*");
field.setFieldLabel(BeanKeyValue.NAME.getValue());
field.setValue(BeanKeyValue.NAME.getValue());
field.setReadOnly(true);
// field.setWidth(initialWidth - 10);
field.setAutoWidth(true);
field.show();
setFieldValue(model, field);
return field;
}
示例4: render
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Object render(final ProjectFundingDTO model, final String property, final ColumnData config, final int rowIndex, final int colIndex,
final ListStore<ProjectFundingDTO> store, final Grid<ProjectFundingDTO> grid) {
// Creates the button with its icon.
final PushButton editButton = new PushButton(IconImageBundle.ICONS.editLinkedProject().createImage());
editButton.setStylePrimaryName(STYLE_EDIT_BUTTON);
// Sets the button click handler.
editButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
view.getPresenterHandler().onLinkedProjectEditClickEvent(model, projectType);
}
});
// Returns this button.
return editButton;
}
示例5: buildGrid
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public Grid<DiffEntry> buildGrid() {
final ColumnModel columnModel = new ColumnModel(Arrays.asList(new ColumnConfig[] {
new ColumnConfig(DiffEntry.FIELD_NAME, 200),
new ColumnConfig(DiffEntry.DISPLAY_VALUE_1, 200),
new ColumnConfig(DiffEntry.DISPLAY_VALUE_2, 200)
}));
final Grid<DiffEntry> grid = new Grid<DiffEntry>(new ListStore<DiffEntry>(), columnModel);
grid.setHideHeaders(true);
grid.setHeight(500);
grid.setAutoWidth(true);
grid.getView().setForceFit(true);
return grid;
}
示例6: createGrid
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
* Creates the grid component.
*
* @return The grid component.
*/
private Component createGrid() {
grid = new Grid<PhaseModelDTO>(new ListStore<PhaseModelDTO>(), new PhaseModelsColumnsProvider() {
@Override
protected GridEventHandler<PhaseModelDTO> getGridEventHandler() {
return gridEventHandler;
}
}.getColumnModel());
grid.setAutoHeight(true);
grid.getView().setForceFit(true);
grid.getStore().setSortField(PhaseModelDTO.SUCCESSORS);
final GridSelectionModel<PhaseModelDTO> selectionModel = new GridSelectionModel<PhaseModelDTO>();
selectionModel.setSelectionMode(SelectionMode.SINGLE);
grid.setSelectionModel(selectionModel);
return grid;
}
示例7: initialize
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
@Override
public void initialize() {
contactHistoryGrid = new Grid<ContactHistory>(new ListStore<ContactHistory>(), buildColumnModel());
contactHistoryGrid.getView().setForceFit(true);
contactHistoryGrid.setAutoHeight(true);
contactHistoryGrid.addListener(Events.ViewReady, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
resizeGrid(contactHistoryGrid, container, true);
}
});
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
resizeGrid(contactHistoryGrid, container, true);
}
});
container = Panels.content(null, false, Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))), "x-border-layout-ct");
container.setScrollMode(Style.Scroll.AUTOY);
container.add(contactHistoryGrid);
add(container);
}
示例8: render
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
@Override
public Object render(PivotGridPanel.PivotTableRow model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<PivotGridPanel.PivotTableRow> store, Grid<PivotGridPanel.PivotTableRow> grid) {
Double value = model.get(property);
if(value == null) {
return "";
} else {
String formattedValue = formatValue(model.getRowAxis(), value);
if(model.getRowAxis().isTotal()) {
return "<span class='" + PivotResources.INSTANCE.css().totalCell() + "'>" +
formattedValue + "</span>";
} else {
return formattedValue;
}
}
}
示例9: PasswordAccessAuditDialog
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public PasswordAccessAuditDialog(Password password)
{
this.setSize("350", "460");
this.setHeading(textMessages.passwordAccessAuditLog());
VBoxLayout boxLayout = new VBoxLayout();
boxLayout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
this.setLayout(boxLayout);
this.setModal(true);
this.setResizable(false);
gridStore = new ListStore<PasswordAccessAuditData>();
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig columnConfigDate = new ColumnConfig(Constants.DATE, textMessages.dateAccessed(), 130);
columnConfigDate.setDateTimeFormat(DateTimeFormat.getFormat(textMessages.displayDateFormat()));
configs.add(columnConfigDate);
ColumnConfig columnConfigUser = new ColumnConfig(Constants.USER, textMessages.userAccessed(), 160);
configs.add(columnConfigUser);
Grid<PasswordAccessAuditData> grid = new Grid<PasswordAccessAuditData>(gridStore, new ColumnModel(configs));
grid.setStripeRows(true);
add(grid);
grid.setSize("320px", "390px");
grid.setBorders(true);
Button closeButton = new Button(textMessages.close(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
doClose();
}
});
setButtonAlign(HorizontalAlignment.CENTER);
addButton(closeButton);
loadAccessAuditData(password.getId());
}
示例10: init
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
if (component instanceof Grid) {
this.grid = (Grid) component;
grid.addListener(CMDBSession.get().getConfig().getGridToolClick(), new Listener<GridEvent>() {
public void handleEvent(GridEvent e) {
onMouseDown(e);
}
});
}
}
示例11: init
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
if (component instanceof Grid) {
this.grid = (Grid) component;
grid.addListener(Events.CellClick, new Listener<GridEvent>() {
public void handleEvent(GridEvent e) {
onMouseDown(e);
}
});
}
}
示例12: init
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
if (component instanceof Grid) {
this.grid = (Grid)component;
this.field.init(component);
grid.addListener(CMDBSession.get().getConfig().getGridToolClick(), new Listener<GridEvent>() {
public void handleEvent(GridEvent e) {
onMouseDown(e);
}
});
}
}
示例13: getGridContextMenu
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
private Menu getGridContextMenu(final Grid grid) {
Menu menu = new Menu();
MenuItem item = new MenuItem("Properties", new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
CellSelectionModel<ModelData> selectionModel = (CellSelectionModel<ModelData>) grid.getSelectionModel();
ModelData data = selectionModel.getSelectCell().model;
}
});
menu.add(item);
return(menu);
}
示例14: onTestConnection
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
*
* @param event
*/
private void onTestConnection(AppEvent event)
{
if (tabWidget != null)
{
InstancesTabItem instancesTabItem = (InstancesTabItem) tabWidget.getItemByItemId(INSTANCES_TAB_ITEM_ID);
final InstanceGridWidget instancesInfoWidget =
instancesTabItem.getInstanceManagementWidget().getInstancesInfo();
final Grid<GSInstanceModel> grid = instancesInfoWidget.getGrid();
if ((grid != null) && (grid.getStore() != null) && (event.getData() != null) && (event.getData() instanceof GSInstanceModel))
{
GSInstanceModel instance = event.getData();
instancesManagerServiceRemote.testConnection(instance, new AsyncCallback<Void>()
{
public void onFailure(Throwable caught)
{
Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
new String[] { /* TODO: I18nProvider.getMessages().ruleServiceName() */"Instance Service",
/* TODO: I18nProvider.getMessages().ruleFetchFailureMessage() */ "Error occurred testing connection to Instance ("+caught.getMessage()+")!" });
}
public void onSuccess(Void result)
{
Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
new String[] { /* TODO: I18nProvider.getMessages().ruleServiceName() */"Instance Service",
/* TODO: I18nProvider.getMessages().ruleFetchFailureMessage() */ "Connection to Instance succesful!" });
}
});
}
}
}
示例15: initGrid
import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
* Inits the grid.
*/
public void initGrid()
{
ColumnModel cm = prepareColumnModel();
grid = new Grid<RuleModel>(store, cm);
grid.setBorders(true);
grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
grid.setHeight("70px");
grid.setLazyRowRender(0);
setGridProperties();
}