X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.graph.impl%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fgraph%2Fimpl%2FWorkbenchSelectionResourceInputSource.java;h=af63a5a313efb4bb08d4eb0d6746f4dee49bf295;hp=4f7c3ab7dbbf3389be05f9bc8ffce5ab75020e0a;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/WorkbenchSelectionResourceInputSource.java b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/WorkbenchSelectionResourceInputSource.java index 4f7c3ab7d..af63a5a31 100644 --- a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/WorkbenchSelectionResourceInputSource.java +++ b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/WorkbenchSelectionResourceInputSource.java @@ -1,36 +1,36 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 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.graph.impl; - -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchPart; -import org.simantics.db.Resource; -import org.simantics.db.layer0.SelectionHints; -import org.simantics.utils.ui.ISelectionUtils; - -/** - * @author Antti Villberg - */ -public class WorkbenchSelectionResourceInputSource extends WorkbenchSelectionInputSource { - - /** - * @thread SWT - */ - @Override - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - Object old = this.selection; - this.selection = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_MAIN, Resource.class); - //System.err.println("WorkbenchSelectionResourceInputSource.selectionChanged(" + part + ", " + this.selection + ")"); - fireIfInputChanged(old, selection); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2011 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.graph.impl; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchPart; +import org.simantics.db.Resource; +import org.simantics.db.layer0.SelectionHints; +import org.simantics.utils.ui.ISelectionUtils; + +/** + * @author Antti Villberg + */ +public class WorkbenchSelectionResourceInputSource extends WorkbenchSelectionInputSource { + + /** + * @thread SWT + */ + @Override + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + Object old = this.selection; + this.selection = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_MAIN, Resource.class); + //System.err.println("WorkbenchSelectionResourceInputSource.selectionChanged(" + part + ", " + this.selection + ")"); + fireIfInputChanged(old, selection); + } + +}