X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2Fwidgets%2FExplorerMouseListenerImpl.java;h=1cafa8f41eeb8c462db81fb16daa3b7bca6537b6;hb=70d03af6b040eee42d3461907e9ea2c8ad4cfb77;hp=7b38a9fddfe98cc29b137b0789ca9149e4e08da1;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/ExplorerMouseListenerImpl.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/ExplorerMouseListenerImpl.java index 7b38a9fdd..1cafa8f41 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/ExplorerMouseListenerImpl.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/ExplorerMouseListenerImpl.java @@ -1,56 +1,56 @@ -/******************************************************************************* - * 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.IPostSelectionProvider; -import org.eclipse.jface.viewers.ISelection; -import org.simantics.browsing.ui.GraphExplorer; -import org.simantics.browsing.ui.swt.widgets.impl.MouseListenerImpl; -import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.management.ISessionContext; - -abstract public class ExplorerMouseListenerImpl extends MouseListenerImpl { - - private GraphExplorer explorer = null; - private ISelection selection; - - public ExplorerMouseListenerImpl(ISessionContext context) { - super(context); - } - - void register(GraphExplorer explorer) { - this.explorer = explorer; - } - - public void doubleClick(WriteGraph graph, T input) throws DatabaseException { - - if(explorer == null) return; - - doubleClick(graph, input, selection); - - } - - @Override - public void beforeApply(T input) { - - if(explorer == null) return; - - IPostSelectionProvider selectionProvider = (IPostSelectionProvider)explorer.getAdapter(IPostSelectionProvider.class); - selection = selectionProvider.getSelection(); - - } - - abstract public void doubleClick(WriteGraph graph, T input, ISelection selection) throws DatabaseException; - -} +/******************************************************************************* + * 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.IPostSelectionProvider; +import org.eclipse.jface.viewers.ISelection; +import org.simantics.browsing.ui.GraphExplorer; +import org.simantics.browsing.ui.swt.widgets.impl.MouseListenerImpl; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; + +abstract public class ExplorerMouseListenerImpl extends MouseListenerImpl { + + private GraphExplorer explorer = null; + private ISelection selection; + + public ExplorerMouseListenerImpl(ISessionContext context) { + super(context); + } + + void register(GraphExplorer explorer) { + this.explorer = explorer; + } + + public void doubleClick(WriteGraph graph, T input) throws DatabaseException { + + if(explorer == null) return; + + doubleClick(graph, input, selection); + + } + + @Override + public void beforeApply(T input) { + + if(explorer == null) return; + + IPostSelectionProvider selectionProvider = (IPostSelectionProvider)explorer.getAdapter(IPostSelectionProvider.class); + selection = selectionProvider.getSelection(); + + } + + abstract public void doubleClick(WriteGraph graph, T input, ISelection selection) throws DatabaseException; + +} \ No newline at end of file