@SuppressWarnings("unchecked") @Override public E set(int index, E element) { return (E) this.list.set(index, element); }
public Object set(int index, Object element) { checkRealm(); return decorated.set(index, element); }
/** * Replaces the element in the observable list located at the given index to * with the given element. * * @param observableList * @param index * @param element * @return a status * @since 1.2 */ protected IStatus doReplace(IObservableList observableList, int index, Object element) { try { observableList.set(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; } }
/** * Replaces the element in the observable list located at the given index to * with the given element. * * @param observableList * @param index * @param element * @return a status * @since 1.2 */ protected IStatus doReplace(IObservableList<? super D> observableList, int index, D element) { try { observableList.set(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; } }
public Object set(int index, Object o) { int offset = 0; for (int i = 0; i < lists.length; i++) { if (index - offset < lists[i].size()) { return lists[i].set(index - offset, o); } offset += lists[i].size(); } throw new IndexOutOfBoundsException("index: " + index + ", size: " //$NON-NLS-1$ //$NON-NLS-2$ + offset); }
/** * Replaces the element in the observable list located at the given index to * with the given element. * * @param observableList * @param index * @param element * @return a status * @since 1.2 */ protected IStatus doReplace(IObservableList observableList, int index, Object element) { try { observableList.set(index, element); } catch (Exception ex) { return ValidationStatus .error( BindingMessages .getString(BindingMessages.VALUEBINDING_ERROR_WHILE_SETTING_VALUE), ex); } return Status.OK_STATUS; } }
protected void doSetValue(Object value) { final Object oldValue = cachedValue; boolean wasUpdating = updating; try { updating = true; for (int i = 0; i < target.size(); i++) target.set(i, value); } finally { updating = wasUpdating; } // Fire the "dirty" event. This implementation recomputes the new // value lazily. if (hasListeners()) { fireValueChange(new ValueDiff() { public Object getOldValue() { return oldValue; } public Object getNewValue() { return getValue(); } }); } }