Package org.drools.guvnor.client.widgets.decoratedgrid

Examples of org.drools.guvnor.client.widgets.decoratedgrid.SortConfiguration


                                  @SuppressWarnings({"rawtypes", "unchecked"})
                                  public int compare(DynamicDataRow leftRow,
                                                     DynamicDataRow rightRow) {
                                      int comparison = 0;
                                      for ( int index = 0; index < sortConfig.size(); index++ ) {
                                          SortConfiguration sc = sortConfig.get( index );
                                          Comparable leftColumnValue = leftRow.get( sc.getColumnIndex() );
                                          Comparable rightColumnValue = rightRow.get( sc.getColumnIndex() );
                                          comparison =
                                                  (leftColumnValue == rightColumnValue) ? 0
                                                      : (leftColumnValue == null) ? -1
                                                          : (rightColumnValue == null) ? 1
                                                              : leftColumnValue.compareTo( rightColumnValue );
                                          if ( comparison != 0 ) {
                                              switch ( sc.getSortDirection() ) {
                                                  case ASCENDING :
                              break;
                          case DESCENDING :
                              comparison = -comparison;
                              break;
                          default :
                              throw new IllegalStateException(
                                                               "Sorting can only be enabled for ASCENDING or"
                                                                       + " DESCENDING, not sortDirection ("
                                                                       + sc.getSortDirection()
                                                                       + ") ." );
                      }
                      return comparison;
                  }
              }
View Full Code Here


                              @SuppressWarnings({"rawtypes", "unchecked"})
                              public int compare(DynamicDataRow leftRow,
                                                 DynamicDataRow rightRow) {
                                  int comparison = 0;
                                  for ( int index = 0; index < sortConfig.size(); index++ ) {
                                      SortConfiguration sc = sortConfig.get( index );
                                      Comparable leftColumnValue = leftRow.get( sc.getColumnIndex() );
                                      Comparable rightColumnValue = rightRow.get( sc.getColumnIndex() );
                                      comparison =
                                              (leftColumnValue == rightColumnValue) ? 0
                                                  : (leftColumnValue == null) ? -1
                                                      : (rightColumnValue == null) ? 1
                                                          : leftColumnValue.compareTo( rightColumnValue );
                                      if ( comparison != 0 ) {
                                          switch ( sc.getSortDirection() ) {
                                              case ASCENDING :
                            break;
                        case DESCENDING :
                            comparison = -comparison;
                            break;
                        default :
                            throw new IllegalStateException(
                                                             "Sorting can only be enabled for ASCENDING or"
                                                                     + " DESCENDING, not sortDirection ("
                                                                     + sc.getSortDirection()
                                                                     + ") ." );
                    }
                    return comparison;
                }
            }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.widgets.decoratedgrid.SortConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.