Skip to main content
summaryrefslogtreecommitdiffstats
blob: 18614b539c3e54e9e8e07f935d58bfbd76d4a072 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package org.eclipse.fx.ui.workbench.renderers.base;

import java.util.Collection;
import java.util.Collections;

import org.osgi.service.event.Event;

public class Util {

	@SuppressWarnings("unchecked")
	public static <E> Collection<E> asCollection(Event event,
			String propertyName) {
		Object o = event.getProperty(propertyName);
		return o instanceof Collection<?> ? (Collection<E>) o : Collections
				.singleton((E) o);
	}

}

Back to the top