package com.planimod.ui.databinding;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.ComputedValue;

/**
 */
public class ListObservableValue extends ComputedValue {

	private IObservableList list;

	public ListObservableValue(IObservableList list, Object valueType) {
		super(valueType);
		if (list == null) {
			throw new NullPointerException();
		}
		this.list = list;
	}

	@Override
	public Object getValueType() {
		return List.class;
	}

	@Override
	protected Object calculate() {
		return new ArrayList(list);
	}

}
