public WrappedValue(IObservableValue value) { this.value = value; this.value.addDisposeListener(new IDisposeListener() { @Override public void handleDispose(DisposeEvent event) { if (WrappedValue.this.fxInvalidationListeners != null) { WrappedValue.this.fxInvalidationListeners.clear(); } WrappedValue.this.dbInvalidationListener = null; if (WrappedValue.this.fxChangeListeners != null) { WrappedValue.this.fxChangeListeners.clear(); } WrappedValue.this.dbChangeListener = null; } }); }
protected StringSplitListObservable ( final IObservableValue value, final String delimiter, final String pattern, final Object valueType ) { super ( value.getRealm (), new LinkedList<Object> (), valueType ); this.value = value; this.pattern = pattern; this.delimiter = delimiter; value.addValueChangeListener ( this.changeListener ); value.addStaleListener ( this.staleListener ); value.addDisposeListener ( this.disposeListener ); }
/** * Constructs a DateAndTimeObservableValue with the specified constituent * observables. * * @param dateObservable * the observable used for the date component (year, month and * day) of the constructed observable. * @param timeObservable * the observable used for the time component (hour, minute, * second and millisecond) of the constructed observable. */ public DateAndTimeObservableValue(IObservableValue dateObservable, IObservableValue timeObservable) { super(dateObservable.getRealm()); this.dateObservable = dateObservable; this.timeObservable = timeObservable; Assert.isTrue(dateObservable.getRealm().equals( timeObservable.getRealm())); privateInterface = new PrivateInterface(); dateObservable.addDisposeListener(privateInterface); timeObservable.addDisposeListener(privateInterface); }
/** * @param factory * @param outerObservableValue * @param detailType */ public DetailObservableSet(IObservableFactory factory, IObservableValue outerObservableValue, Object detailType) { super(outerObservableValue.getRealm(), Collections.EMPTY_SET, detailType); Assert.isTrue(!outerObservableValue.isDisposed(), "Master observable is disposed"); //$NON-NLS-1$ this.factory = factory; this.outerObservableValue = outerObservableValue; outerObservableValue.addDisposeListener(new IDisposeListener() { public void handleDispose(DisposeEvent staleEvent) { dispose(); } }); ObservableTracker.setIgnore(true); try { updateInnerObservableSet(); } finally { ObservableTracker.setIgnore(false); } outerObservableValue.addValueChangeListener(outerChangeListener); }
/** * @param outerObservableValue * @param factory * @param detailType */ public DetailObservableValue(IObservableValue outerObservableValue, IObservableFactory factory, Object detailType) { super(outerObservableValue.getRealm()); Assert.isTrue(!outerObservableValue.isDisposed(), "Master observable is disposed"); //$NON-NLS-1$ this.factory = factory; this.detailType = detailType; this.outerObservableValue = outerObservableValue; outerObservableValue.addDisposeListener(new IDisposeListener() { public void handleDispose(DisposeEvent staleEvent) { dispose(); } }); ObservableTracker.setIgnore(true); try { updateInnerObservableValue(); } finally { ObservableTracker.setIgnore(false); } outerObservableValue.addValueChangeListener(outerChangeListener); }
/** * @param factory * @param outerObservableValue * @param detailType */ public DetailObservableList(IObservableFactory factory, IObservableValue outerObservableValue, Object detailType) { super(outerObservableValue.getRealm(), Collections.EMPTY_LIST, detailType); Assert.isTrue(!outerObservableValue.isDisposed(), "Master observable is disposed"); //$NON-NLS-1$ this.factory = factory; this.outerObservableValue = outerObservableValue; this.detailType = detailType; outerObservableValue.addDisposeListener(new IDisposeListener() { public void handleDispose(DisposeEvent staleEvent) { dispose(); } }); ObservableTracker.setIgnore(true); try { updateInnerObservableList(); } finally { ObservableTracker.setIgnore(false); } outerObservableValue.addValueChangeListener(outerChangeListener); }
private ControlDecorationSupport(IObservableValue<IStatus> validationStatus, IObservableList<IObservable> targetsToBeDecorated, int position, Composite composite, ControlDecorationUpdater updater) { this.position = position; this.composite = composite; this.updater = updater; this.validationStatus = validationStatus; Assert.isTrue(!this.validationStatus.isDisposed()); this.targets = targetsToBeDecorated; Assert.isTrue(!this.targets.isDisposed()); this.targetDecorations = new ArrayList<TargetDecoration>(); validationStatus.addDisposeListener(disposeListener); validationStatus.addValueChangeListener(statusChangeListener); targets.addDisposeListener(disposeListener); targets.addListChangeListener(targetsChangeListener); for (Object name : targets) targetAdded((IObservable) name); statusChanged(validationStatus.getValue()); }
this.detailValueType = valueType; master.addDisposeListener(new IDisposeListener() { public void handleDispose(DisposeEvent staleEvent) { dispose();