-/*******************************************************************************\r
- * Copyright (c) 2007, 2012 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.browsing.ui.swt.widgets;\r
-\r
-import org.eclipse.jface.viewers.ISelection;\r
-import org.simantics.browsing.ui.swt.widgets.impl.ReadFactory;\r
-import org.simantics.db.management.ISessionContext;\r
-import org.simantics.db.procedure.Listener;\r
-import org.simantics.utils.ReflectionUtils;\r
-import org.simantics.utils.ui.ISelectionUtils;\r
-\r
-\r
-public class IdentityFactory<T> implements ReadFactory<T, T> {\r
-\r
- final Class<?> inputClass;\r
- \r
- public IdentityFactory() {\r
- inputClass = ReflectionUtils.getSingleParameterType(getClass());\r
- }\r
- \r
- @SuppressWarnings("unchecked")\r
- @Override\r
- public void listen(ISessionContext context, Object input, Listener<T> listener) {\r
- \r
- final Object inputContents = ISelectionUtils.filterSingleSelection((ISelection)input, inputClass);\r
- listener.execute((T)inputContents);\r
- \r
- }\r
-\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.browsing.ui.swt.widgets;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.simantics.browsing.ui.swt.widgets.impl.ReadFactory;
+import org.simantics.db.management.ISessionContext;
+import org.simantics.db.procedure.Listener;
+import org.simantics.utils.ReflectionUtils;
+import org.simantics.utils.ui.ISelectionUtils;
+
+
+public class IdentityFactory<T> implements ReadFactory<T, T> {
+
+ final Class<?> inputClass;
+
+ public IdentityFactory() {
+ inputClass = ReflectionUtils.getSingleParameterType(getClass());
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void listen(ISessionContext context, Object input, Listener<T> listener) {
+
+ final Object inputContents = ISelectionUtils.filterSingleSelection((ISelection)input, inputClass);
+ listener.execute((T)inputContents);
+
+ }
+
+
+}