X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2Fwidgets%2FIdentityFactory.java;h=acd4fd8e06c3bc6a58ea822d8a9bf765b6d4c725;hp=7ce2aac55c5d1adfef664d1a628a5fd0fbd49aeb;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/IdentityFactory.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/IdentityFactory.java index 7ce2aac55..acd4fd8e0 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/IdentityFactory.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/IdentityFactory.java @@ -1,40 +1,40 @@ -/******************************************************************************* - * 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 implements ReadFactory { - - final Class inputClass; - - public IdentityFactory() { - inputClass = ReflectionUtils.getSingleParameterType(getClass()); - } - - @SuppressWarnings("unchecked") - @Override - public void listen(ISessionContext context, Object input, Listener listener) { - - final Object inputContents = ISelectionUtils.filterSingleSelection((ISelection)input, inputClass); - listener.execute((T)inputContents); - - } - - -} +/******************************************************************************* + * 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 implements ReadFactory { + + final Class inputClass; + + public IdentityFactory() { + inputClass = ReflectionUtils.getSingleParameterType(getClass()); + } + + @SuppressWarnings("unchecked") + @Override + public void listen(ISessionContext context, Object input, Listener listener) { + + final Object inputContents = ISelectionUtils.filterSingleSelection((ISelection)input, inputClass); + listener.execute((T)inputContents); + + } + + +}