blob: 133c48a3c18593fb0431e9d28d615af439da8bdb [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.runtime.web.vaadin.databinding.values;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.IObserving;
import org.eclipse.core.databinding.observable.set.DecoratingObservableSet;
import org.eclipse.core.databinding.observable.set.IObservableSet;
// TODO: Auto-generated Javadoc
/**
* The Class VaadinObservableSetDecorator.
*/
public class VaadinObservableSetDecorator extends DecoratingObservableSet
implements IVaadinObservableSet {
/**
* Instantiates a new vaadin observable set decorator.
*
* @param decorated
* the decorated
*/
public VaadinObservableSetDecorator(IObservableSet decorated) {
super(decorated, true);
}
/**
* Gets the observed.
*
* @return the observed
*/
public Object getObserved() {
IObservable decorated = getDecorated();
if (decorated instanceof IObserving) {
return ((IObserving) decorated).getObserved();
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.osbp.runtime.web.vaadin.databinding.values.IVaadinObservableSet#getSource()
*/
@Override
public Object getSource() {
return getObserved();
}
}