@Override
 public Object get(int index) {
   if (index < 0 || index >= masterList.size()) {
     throw new IndexOutOfBoundsException();
   }
   // We should have an element, now check to see if we've already
   // mapped it to an observable value.
   if (index >= observableValueList.size()) {
     // Just null-padding entries that we should have, but haven't
     // been explicitly requested.
     while (this.observableValueList.size() <= index) {
       this.observableValueList.add(null);
     }
   }
   // I'm assuming get is Realm-bound, so there are no concurrency issues
   // to worry about.
   if (observableValueList.get(index) == null) {
     IObservableValue value = aggregateProperty.observe(masterList.get(index));
     if (listener != null) {
       value.addValueChangeListener(listener);
     }
     observableValueList.set(index, value);
   }
   return observableValueList.get(index).getValue();
 }
コード例 #2
0
ファイル: TableRidgetTest.java プロジェクト: jodoming/riena
 @Override
 protected Object getRowValue(final int i) {
   // return getRidget().getRowObservables().get(i);
   final IObservableList rowObservables =
       ReflectionUtils.invokeHidden(getRidget(), "getRowObservables"); // $NON-NLS-1$
   return rowObservables.get(i);
 }
コード例 #3
0
  private void loadValues() {
    this.list.clear();

    final TaskTagsPreferences taskPrefs = new TaskTagsPreferences(this);
    this.list.addAll(taskPrefs.getTaskTags());

    if (!list.isEmpty()) {
      this.defaultValue.setValue(list.get(0));
    }
  }