/** * This method adds a total page count label into the pager if the {@link #isTotalCountDisplayed()} method * returns <code>true</code>.<p/> * Otherwise it displays an empty cell. */ protected void addTotalCountLabel() { int column = table.getCellCount(0); if (isTotalCountDisplayed()) { Label label = new Label(); label.setText(RESOURCE.getTotalCount(String.valueOf(getModel().getTotalPagesNumber()))); label.setStyleName("label"); table.setWidget(0, column, label); } else { table.setText(0, column, ""); } table.getCellFormatter().setWidth(0, column, "100%"); }
rCellFormatter.setWidth(nRow, nCol, "100%");
_grid.getCellFormatter().setStyleName(0, 1, "metric-table-header"); //$NON-NLS-1$ _grid.getCellFormatter().setStyleName(0, 2, "metric-table-header"); //$NON-NLS-1$ _grid.getCellFormatter().setWidth(0, 2, "50%"); //$NON-NLS-1$
aToolBarTable.getCellFormatter().setWidth(1, 1, "100%");
aMainPanel.getCellFormatter().setWidth(DATA_ROW, 0, "100%"); aMainPanel.getCellFormatter().setHeight(DATA_ROW, 0, "100%"); aMainPanel.setCellSpacing(0);
this.mainGrid.getCellFormatter().setWidth(0, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(0, 0, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(0, 1, this.sideWidth+"px"); this.mainGrid.getCellFormatter().setHeight(0, 1, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(0, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(0, 2, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(1, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(1, 0, this.sideHeight+"px"); this.mainGrid.getCellFormatter().setWidth(1, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(1, 2, this.sideHeight+"px"); this.mainGrid.getCellFormatter().setWidth(2, 2, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(2, 2, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(2, 0, this.getConfiguration().getSideImagesWidth()+"px"); this.mainGrid.getCellFormatter().setHeight(2, 0, this.getConfiguration().getSideImagesHeight()+"px"); this.mainGrid.getCellFormatter().setWidth(2, 1, this.sideWidth+"px"); this.mainGrid.getCellFormatter().setHeight(2, 1, this.getConfiguration().getSideImagesHeight()+"px");
/** * See class docs. * * @param value is a value to be adopted. * @return a widget to be inserted into the list. */ public Widget createWidget(Object value) { if (value == null) return new Label(); else if (value instanceof String || value instanceof Number) return new Label(String.valueOf(value)); else if (value instanceof Date) { DatePicker datePicker = new DatePicker((Date) value); datePicker.setChoiceButtonVisible(false); return datePicker; } else if (value instanceof IconItem) { IconItem item = (IconItem) value; FlexTable table = new FlexTable(); table.setStyleName("icon-item"); table.setWidget(0, 0, new Image(item.getImageName())); table.setWidget(0, 1, new Label(item.getLabel())); table.getCellFormatter().setWidth(0, 0, "1%"); table.getCellFormatter().setWidth(0, 1, "99%"); return table; } else return null; }
/*************************************** * Creates a new instance. * * @param rTable The {@link GwtTable} this instance belongs to */ TableFilterPanel(GwtTable rTable) { this.rTable = rTable; aClearFilterButton.setTitle(expand("$ttClearTableFilter")); aFilterValue.setTitle(expand("$ttTableFilterValue")); aFilterPanel.setWidget(0, 0, aFilterButton); aFilterPanel.setWidget(0, 1, aFilterValue); aFilterPanel.setWidget(0, 2, aClearFilterButton); aFilterValue.setWidth("100%"); aFilterValue.setStylePrimaryName(GwtTable.CSS.ewtTableFilterValue()); aFilterValue.addKeyUpHandler(this); aFilterPanel.setWidth("100%"); aFilterPanel.getCellFormatter().setWidth(0, 1, "100%"); aFilterPanel.setStylePrimaryName(GwtTable.CSS.ewtFilter()); aFilterButton.setStylePrimaryName(GwtTable.CSS.ewtTableFilterButton()); aFilterButton.addClickHandler(this); aClearFilterButton.addClickHandler(this); initWidget(aFilterPanel); }
/** * Prepares the selected value box for displaying. */ protected void prepareSelectedValue() { TextBox selectedValue = getSelectedValue(); selectedValue.setReadOnly(!isCustomTextAllowed()); selectedValue.setStyleName("selected-value"); if(getHeight() != null) { getLayout().setHeight("100%"); getLayout().getCellFormatter().setHeight(0, 0, "100%"); getSelectedValue().setHeight("100%"); } if (getWidth() != null) { getLayout().setWidth("100%"); getLayout().getCellFormatter().setWidth(0, 0, "100%"); getSelectedValue().setWidth("100%"); } }
private int addCell(Widget widget, String width, String className) { int cell = grid.getCellCount(0); grid.setWidget(0, cell, widget); grid.getCellFormatter().setWidth(0, cell, width); if (className != null) { grid.getCellFormatter().setStyleName(0, cell, className); } return cell; } }
private int addCell(Widget widget, String width, String className) { int cell = grid.getCellCount(0); grid.setWidget(0, cell, widget); grid.getCellFormatter().setWidth(0, cell, width); if (className != null) { grid.getCellFormatter().setStyleName(0, cell, className); } return cell; } }
private int addCell(Widget widget, String width, String className) { int cell = grid.getCellCount(0); grid.setWidget(0, cell, widget); grid.getCellFormatter().setWidth(0, cell, width); if (className != null) { grid.getCellFormatter().setStyleName(0, cell, className); } return cell; } }