private NumberValues createNumberValues() {
   NumberValues nv = new NumberValues();
   nv.setColumnOneNumber(100); // the value which should be used as 100%
   nv.setColumnTwoNumber(20); // the value 1 for calculation
   nv.setColumnThreeNumber(30); // the value 2 for calculation
   // as column 4 and 5 should be calculated values, we don't set them to the NumberValues object
   return nv;
 }
コード例 #2
0
 /* (non-Javadoc)
  * @see org.eclipse.nebula.widgets.nattable.data.IColumnAccessor#setDataValue(java.lang.Object, int, java.lang.Object)
  */
 public void setDataValue(NumberValues rowObject, int columnIndex, Object newValue) {
   // because of the registered conversion, the new value has to be an Integer
   switch (columnIndex) {
     case 0:
       rowObject.setColumnOneNumber((Integer) newValue);
       break;
     case 1:
       rowObject.setColumnTwoNumber((Integer) newValue);
       break;
     case 2:
       rowObject.setColumnThreeNumber((Integer) newValue);
       break;
   }
 }