public static void paintInstanceRowSelected( DataGrid<ProcessInstanceSummary> myProcessInstanceListGrid, Long id ) { for ( int i = 0; i < myProcessInstanceListGrid.getRowCount(); i++ ) { boolean idMatch = false; if ( myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 1 ).getInnerText().equals( String.valueOf( id ) ) ) { idMatch = true; } for ( int k = 0; k < myProcessInstanceListGrid.getColumnCount(); k++ ) { if ( idMatch ) { myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( k ).getStyle().setBackgroundColor( BG_ROW_SELECTED ); } else { myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( k ).getStyle().clearBackgroundColor(); } } } }
public static String getProcessInstanceVersionRowSelected( DataGrid<ProcessInstanceSummary> myProcessInstanceListGrid ) { String processDefVersion = null; for ( int i = 0; i < myProcessInstanceListGrid.getRowCount(); i++ ) { if ( myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 3 ).getStyle().getBackgroundColor().equals( BG_ROW_SELECTED ) ) { processDefVersion = myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 3 ).getInnerText(); break; } } return processDefVersion; }
private void setCursorType( Cursor cursor ) { for ( int iRow = 0; iRow < widget.rowHeaders.length; iRow++ ) { TableRowElement tre = widget.rowHeaders[ iRow ].<TableRowElement>cast(); for ( int iCol = 0; iCol < tre.getCells().getLength(); iCol++ ) { TableCellElement tce = tre.getCells().getItem( iCol ); tce.getStyle().setCursor( cursor ); } } }
public static String getProcessVersionRowSelected( DataGrid<ProcessSummary> myProcessDefListGrid ) { String processDefVersion = null; for ( int i = 0; i < myProcessDefListGrid.getRowCount(); i++ ) { if ( myProcessDefListGrid.getRowElement( i ).getCells().getItem( 1 ).getStyle().getBackgroundColor().equals( BG_ROW_SELECTED ) ) { processDefVersion = myProcessDefListGrid.getRowElement( i ).getCells().getItem( 1 ).getInnerText(); break; } } return processDefVersion; }
public static String getProcessNameRowSelected( DataGrid<ProcessSummary> myProcessDefListGrid ) { String processDefName = null; for ( int i = 0; i < myProcessDefListGrid.getRowCount(); i++ ) { if ( myProcessDefListGrid.getRowElement( i ).getCells().getItem( 0 ).getStyle().getBackgroundColor().equals( BG_ROW_SELECTED ) ) { processDefName = myProcessDefListGrid.getRowElement( i ).getCells().getItem( 0 ).getInnerText(); break; } } return processDefName; }
private void setCursorType( Cursor cursor ) { for ( int iRow = 0; iRow < widget.headerRows.length; iRow++ ) { TableRowElement tre = widget.headerRows[ iRow ].<TableRowElement>cast(); for ( int iCol = 0; iCol < tre.getCells().getLength(); iCol++ ) { TableCellElement tce = tre.getCells().getItem( iCol ); tce.getStyle().setCursor( cursor ); } } }
public static String getProcessInstanceNameRowSelected( DataGrid<ProcessInstanceSummary> myProcessInstanceListGrid ) { String processDefName = null; for ( int i = 0; i < myProcessInstanceListGrid.getRowCount(); i++ ) { if ( myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 1 ).getStyle().getBackgroundColor().equals( BG_ROW_SELECTED ) ) { processDefName = myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 1 ).getInnerText(); break; } } return processDefName; }
public static String getProcessInstanceStartDateRowSelected( DataGrid<ProcessInstanceSummary> myProcessInstanceListGrid ) { String processStartDate = null; for ( int i = 0; i < myProcessInstanceListGrid.getRowCount(); i++ ) { if ( myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 5 ).getStyle().getBackgroundColor().equals( BG_ROW_SELECTED ) ) { processStartDate = myProcessInstanceListGrid.getRowElement( i ).getCells().getItem( 5 ).getInnerText(); break; } } return processStartDate; }
private void addSpannedCell(UIDL rowUidl, Widget w, char align, String style, boolean sorted, int colCount) { TableCellElement td = DOM.createTD().cast(); td.setColSpan(colCount); initCellWithWidget(w, align, style, sorted, td); td.getStyle().setHeight(getRowHeight(), Unit.PX); if (addTreeSpacer(rowUidl)) { widgetInHierarchyColumn = w; } }
private void addSpannedCell(UIDL rowUidl, String text, char align, String style, boolean textIsHTML, boolean sorted, String description, int colCount) { // String only content is optimized by not using Label widget final TableCellElement td = DOM.createTD().cast(); td.setColSpan(colCount); initCellWithText(text, align, style, textIsHTML, sorted, description, td); td.getStyle().setHeight(getRowHeight(), Unit.PX); addTreeSpacer(rowUidl); }
public static void paintRowSelected( DataGrid<ProcessSummary> myProcessDefListGrid, String nameProcessDef, String versionProcessDef ) { for ( int i = 0; i < myProcessDefListGrid.getRowCount(); i++ ) { boolean nameMatch = false; boolean versionMatch = false; for ( int j = 0; j < myProcessDefListGrid.getColumnCount(); j++ ) { if ( myProcessDefListGrid.getRowElement( i ).getCells().getItem( j ).getInnerText().equals( nameProcessDef ) ) { nameMatch = true; } if ( myProcessDefListGrid.getRowElement( i ).getCells().getItem( j ).getInnerText().equals( versionProcessDef ) ) { versionMatch = true; } } for ( int k = 0; k < myProcessDefListGrid.getColumnCount(); k++ ) { if ( nameMatch && versionMatch ) { myProcessDefListGrid.getRowElement( i ).getCells().getItem( k ).getStyle().setBackgroundColor( BG_ROW_SELECTED ); } else { myProcessDefListGrid.getRowElement( i ).getCells().getItem( k ).getStyle().clearBackgroundColor(); } } } }
private void setHeaderWidthInformation(boolean shouldAffix) { // header if (shouldAffix) { table.getTableHeadElement().getStyle().setWidth(headerWidth, Style.Unit.PX); } else { table.getTableHeadElement().getStyle().clearWidth(); } final NodeList<TableRowElement> headerRows = table.getTableHeadElement().getRows(); for (int i = 0; i < headerRows.getLength(); i++) { final TableRowElement row = headerRows.getItem(i); // rows if (shouldAffix) { row.getStyle().setWidth(headerRowToWidthMap.get(i), Style.Unit.PX); } else { row.getStyle().clearWidth(); } // cells final NodeList<TableCellElement> cells = row.getCells(); for (int j = 0; j < cells.getLength(); j++) { final TableCellElement cell = cells.getItem(j); if (shouldAffix) { cell.getStyle().setWidth(headerCellToWidthMap.get(new Pair<>(i, j)), Style.Unit.PX); } else { cell.getStyle().clearWidth(); } } } }
headerCell.getStyle().setVisibility(columnVisible ? Visibility.VISIBLE : Visibility.HIDDEN);