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%2FDoubleClickableNodeMouseListener.java;h=9ade40868cd50e5329b7c374d00040fe5e1fb66e;hp=d60506974e08b6eaf077f6f0a911e3f59c5333c1;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DoubleClickableNodeMouseListener.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DoubleClickableNodeMouseListener.java index d60506974..9ade40868 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DoubleClickableNodeMouseListener.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DoubleClickableNodeMouseListener.java @@ -1,39 +1,39 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.swt.widgets.Control; -import org.simantics.browsing.ui.GraphExplorer; -import org.simantics.browsing.ui.common.node.IDoubleClickableNode; -import org.simantics.utils.ui.AdaptionUtils; - -/** - * A double click event handler for {@link GraphExplorer} that tries to see whether - * - * @author Tuukka Lehtonen - */ -public class DoubleClickableNodeMouseListener extends GraphExplorerMouseAdapter { - - public DoubleClickableNodeMouseListener(GraphExplorer ge) { - super(ge); - } - - @Override - protected void handleContextDoubleClick(Control tree, ISelection context) { - IDoubleClickableNode doubleClickable = AdaptionUtils.adaptToSingle(context, IDoubleClickableNode.class); - if (doubleClickable != null) { - doubleClickable.handleDoubleClick(); - } - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 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; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.widgets.Control; +import org.simantics.browsing.ui.GraphExplorer; +import org.simantics.browsing.ui.common.node.IDoubleClickableNode; +import org.simantics.utils.ui.AdaptionUtils; + +/** + * A double click event handler for {@link GraphExplorer} that tries to see whether + * + * @author Tuukka Lehtonen + */ +public class DoubleClickableNodeMouseListener extends GraphExplorerMouseAdapter { + + public DoubleClickableNodeMouseListener(GraphExplorer ge) { + super(ge); + } + + @Override + protected void handleContextDoubleClick(Control tree, ISelection context) { + IDoubleClickableNode doubleClickable = AdaptionUtils.adaptToSingle(context, IDoubleClickableNode.class); + if (doubleClickable != null) { + doubleClickable.handleDoubleClick(); + } + } + +}