/** * Returns a List with the current contents of the source's list property * * @param source * the property source * @return a List with the current contents of the source's list property * @noreference This method is not intended to be referenced by clients. * @since 1.6 */ protected List<E> doGetList(S source) { IObservableList<E> observable = observe(source); try { return new ArrayList<>(observable); } finally { observable.dispose(); } }
/** * Returns a List with the current contents of the source's list property * * @param source * the property source * @return a List with the current contents of the source's list property * @noreference This method is not intended to be referenced by clients. * @since 1.6 */ protected List<E> doGetList(S source) { IObservableList<E> observable = observe(source); try { return new ArrayList<>(observable); } finally { observable.dispose(); } }
@SuppressWarnings("unchecked") private List<?> listFromDelegate(Object source) { List<?> list = Collections.EMPTY_LIST; if (source != null) { // we can't use IListProperty#getList(Object) because our lower bound is DB 1.2 if( delegate instanceof EMFListProperty ) { list = ((EMFListProperty)delegate).doGetList(source); } else { IObservableList observable = delegate.observe(source); try { list = new ArrayList<Object>(observable); } finally { observable.dispose(); } } } return list; }
@SuppressWarnings("unchecked") private List<?> listFromDelegate(Object source) { List<?> list = Collections.EMPTY_LIST; if (source != null) { // we can't use IListProperty#getList(Object) because our lower bound is DB 1.2 if( delegate instanceof EMFListProperty ) { list = ((EMFListProperty)delegate).doGetList(source); } else { IObservableList observable = delegate.observe(source); try { list = new ArrayList<Object>(observable); } finally { observable.dispose(); } } } return list; }
private List<?> listFromDelegate(Object source) { List<?> list = Collections.EMPTY_LIST; if (source != null) { // we can't use IListProperty#getList(Object) because our lower bound is DB 1.2 if( delegate instanceof EMFListProperty ) { list = ((EMFListProperty)delegate).doGetList(source); } else { IObservableList observable = delegate.observe(source); try { list = new ArrayList<Object>(observable); } finally { observable.dispose(); } } } return list; }
/** * Updates the property on the source with the specified change * * @param source * the property source * @param diff * a diff describing the change * @since 1.3 */ protected void doUpdateList(S source, ListDiff<E> diff) { IObservableList<E> observable = observe(source); try { diff.applyTo(observable); } finally { observable.dispose(); } }
/** * Updates the property on the source with the specified change * * @param source * the property source * @param diff * a diff describing the change * @since 1.3 */ protected void doUpdateList(S source, ListDiff<E> diff) { IObservableList<E> observable = observe(source); try { diff.applyTo(observable); } finally { observable.dispose(); } }
@Override protected void doSetValue(Object source, Object value) { IObservableList list = delegate.observe(source); try { WriteData data = elementAccess.getWriteValueData(list); if (data != null) { doSetListValue((EObject)source, list, data, value); } } finally { list.dispose(); } }
@SuppressWarnings("unchecked") @Override protected void doSetValue(Object source, Object value) { IObservableList list = delegate.observe(source); try { WriteData data = elementAccess.getWriteValueData(list); if (data != null) { doSetListValue((EObject)source, list, data, value); } } finally { list.dispose(); } }
@SuppressWarnings("unchecked") @Override protected void doSetValue(Object source, Object value) { IObservableList list = delegate.observe(source); try { WriteData data = elementAccess.getWriteValueData(list); if (data != null) { doSetListValue((EObject)source, list, data, value); } } finally { list.dispose(); } }
@Override public void dispose() { if (targets != null) { targets.clear(); // Remove listeners from dependencies } if (unmodifiableValidationStatus != null) { unmodifiableValidationStatus.dispose(); unmodifiableValidationStatus = null; } if (validationStatus != null) { validationStatus.dispose(); validationStatus = null; } if (unmodifiableTargets != null) { unmodifiableTargets.dispose(); unmodifiableTargets = null; } if (targets != null) { targets.dispose(); targets = null; } if (models != null) { models.dispose(); models = null; } realm = null; super.dispose(); }
public synchronized void dispose() { super.dispose(); if (outerObservableValue != null) { outerObservableValue.removeValueChangeListener(outerChangeListener); } if (innerObservableList != null) { innerObservableList.removeListChangeListener(innerChangeListener); innerObservableList.dispose(); } outerObservableValue = null; outerChangeListener = null; currentOuterValue = null; factory = null; innerObservableList = null; innerChangeListener = null; }
@Override public void dispose() { if (targets != null) { targets.clear(); // Remove listeners from dependencies } if (unmodifiableValidationStatus != null) { unmodifiableValidationStatus.dispose(); unmodifiableValidationStatus = null; } if (validationStatus != null) { validationStatus.dispose(); validationStatus = null; } if (unmodifiableTargets != null) { unmodifiableTargets.dispose(); unmodifiableTargets = null; } if (targets != null) { targets.dispose(); targets = null; } if (models != null) { models.dispose(); models = null; } realm = null; super.dispose(); }
public void dispose() { if (targets != null) { targets.clear(); // Remove listeners from dependencies } if (unmodifiableValidationStatus != null) { unmodifiableValidationStatus.dispose(); unmodifiableValidationStatus = null; } if (validationStatus != null) { validationStatus.dispose(); validationStatus = null; } if (unmodifiableTargets != null) { unmodifiableTargets.dispose(); unmodifiableTargets = null; } if (targets != null) { targets.dispose(); targets = null; } if (models != null) { models.dispose(); models = null; } realm = null; super.dispose(); }
private void updateInnerObservableList() { if (innerObservableList != null) { innerObservableList.removeListChangeListener(innerChangeListener); innerObservableList.dispose(); } currentOuterValue = outerObservableValue.getValue(); if (currentOuterValue == null) { innerObservableList = null; wrappedList = Collections.EMPTY_LIST; } else { ObservableTracker.setIgnore(true); try { innerObservableList = (IObservableList) factory .createObservable(currentOuterValue); } finally { ObservableTracker.setIgnore(false); } DetailObservableHelper.warnIfDifferentRealms(getRealm(), innerObservableList.getRealm()); wrappedList = innerObservableList; if (detailType != null) { Object innerValueType = innerObservableList.getElementType(); Assert.isTrue(getElementType().equals(innerValueType), "Cannot change value type in a nested observable list"); //$NON-NLS-1$ } innerObservableList.addListChangeListener(innerChangeListener); } }