/** * Appends a cell to the specified row. * * @param row the row to which the new cell will be added * @throws IndexOutOfBoundsException */ public void addCell(int row) { insertCell(row, getCellCount(row)); }
/** * Ensure that the cell exists. * * @param row the row to prepare. * @param column the column to prepare. * @throws IndexOutOfBoundsException if the row is negative */ @Override protected void prepareCell(int row, int column) { prepareRow(row); if (column < 0) { throw new IndexOutOfBoundsException( "Cannot create a column with a negative index: " + column); } // Ensure that the requested column exists. int cellCount = getCellCount(row); int required = column + 1 - cellCount; if (required > 0) { addCells(getBodyElement(), row, required); } }
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; } }
/** * Appends a cell to the specified row. * * @param row the row to which the new cell will be added * @throws IndexOutOfBoundsException */ public void addCell(int row) { insertCell(row, getCellCount(row)); }
/** * Appends a cell to the specified row. * * @param row the row to which the new cell will be added * @throws IndexOutOfBoundsException */ public void addCell(int row) { insertCell(row, getCellCount(row)); }
private void clearLineIcons(int row, int col) { if (layout.getCellCount(row) <= col) { return; } Widget widget = layout.getWidget(row, col); if (widget instanceof DirtyableHorizontalPane) { DirtyableHorizontalPane horiz = (DirtyableHorizontalPane) widget; horiz.clear(); } }
private void clearLineIcons(int row, int col) { if (layout.getCellCount(row) <= col) { return; } Widget widget = layout.getWidget(row, col); if (widget instanceof DirtyableHorizontalPane) { DirtyableHorizontalPane horiz = (DirtyableHorizontalPane) widget; horiz.clear(); } }
@Override public void setEnabled(boolean b) { enabled = b; for (int i=0; i < layout.getRowCount(); i++){ for (int j=0; j < layout.getCellCount(i); j++){ ((KSCheckBox)layout.getWidget(i, j)).setEnabled(b); } } }
@Override public void setEnabled(boolean b) { enabled = b; for (int i=0; i < layout.getRowCount(); i++){ for (int j=0; j < layout.getCellCount(i); j++){ ((KSRadioButton)layout.getWidget(i, j)).setEnabled(b); } } }
@Override public void setText( String text ) { if( (table.getRowCount() > row) && (table.getCellCount( row ) > col) ) table.clearCell( row, col ); table.setText( row, col, text ); }
@Override public void setText( String text ) { if( (table.getRowCount() > row) && (table.getCellCount( row ) > col) ) table.clearCell( row, col ); table.setText( row, col, text ); }
@Override public void setHTML( String html ) { if( (table.getRowCount() > row) && (table.getCellCount( row ) > col) ) table.clearCell( row, col ); table.setHTML( row, col, html ); }
@Override public void setHTML( String html ) { if( (table.getRowCount() > row) && (table.getCellCount( row ) > col) ) table.clearCell( row, col ); table.setHTML( row, col, html ); }
/** * @see org.kuali.student.common.ui.client.widgets.list.KSSelectItemWidgetAbstract#deSelectItem(java.lang.String) */ public void deSelectItem(String id) { for (int i=0; i < layout.getRowCount(); i++){ for (int j=0; j < layout.getCellCount(i); j++){ KSCheckBox checkbox = (KSCheckBox)layout.getWidget(i, j); if (checkbox.getFormValue().equals(id)){ this.selectedItems.remove(id); checkbox.setValue(false); fireChangeEvent(false); break; } } } }
public static void addBottomAndRightPaddingToTableCells(final FlexTable table) { for (int rowIndex = 0; rowIndex < table.getRowCount(); rowIndex++) { for (int cellIndex = 0; cellIndex < table.getCellCount(rowIndex); cellIndex++) { table.getCellFormatter().getElement(rowIndex, cellIndex).setAttribute("style", BOTTOM_RIGHT_PADDING); } } } }
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; } }
public void addCell(int row, String w) { int currentColSize = table.getCellCount(row); table.addCell(row); table.setWidget(row, currentColSize, new WSCell(this, new WSCellSimpleTextCell(w), row, currentColSize)); }
@Test public void testAddBottomAndRightPaddingToTableCells() throws Exception { final Element cellOne = mock(Element.class); final Element cellTwo = mock(Element.class); final HTMLTable.CellFormatter cellFormatter = mock(HTMLTable.CellFormatter.class); final FlexTable testedTable = mock(FlexTable.class); doReturn(1).when(testedTable).getRowCount(); doReturn(2).when(testedTable).getCellCount(0); doReturn(cellFormatter).when(testedTable).getCellFormatter(); doReturn(cellOne).when(cellFormatter).getElement(0, 0); doReturn(cellTwo).when(cellFormatter).getElement(0, 1); ScenarioUtils.addBottomAndRightPaddingToTableCells(testedTable); verify(cellOne).setAttribute("style", ScenarioUtils.BOTTOM_RIGHT_PADDING); verify(cellTwo).setAttribute("style", ScenarioUtils.BOTTOM_RIGHT_PADDING); } }
/** * 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%"); }