X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.message.ui%2Fsrc%2Forg%2Fsimantics%2Fmessage%2Fui%2Fscheme%2FResourceSchemeHandler.java;fp=bundles%2Forg.simantics.message.ui%2Fsrc%2Forg%2Fsimantics%2Fmessage%2Fui%2Fscheme%2FResourceSchemeHandler.java;h=2f536eb6f3810fc5d8a1bcfc007f401e4eae3605;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=cf63714341d783aaf79493d92a5788740703098f;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceSchemeHandler.java b/bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceSchemeHandler.java index cf6371434..2f536eb6f 100644 --- a/bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceSchemeHandler.java +++ b/bundles/org.simantics.message.ui/src/org/simantics/message/ui/scheme/ResourceSchemeHandler.java @@ -1,52 +1,52 @@ -/******************************************************************************* - * 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.message.ui.scheme; - -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.simantics.db.Resource; -import org.simantics.db.Session; -import org.simantics.message.AbstractMessageSchemeHandler; -import org.simantics.ui.SimanticsUI; -import org.simantics.ui.workbench.action.ChooseActionRequest; -import org.simantics.utils.ui.workbench.WorkbenchUtils; - -/** - * @author Tuukka Lehtonen - */ -public class ResourceSchemeHandler extends AbstractMessageSchemeHandler { - - public ResourceSchemeHandler() { - super("resource", Resource.class); - } - - @Override - public void doPerform(Resource r) { - Session session = SimanticsUI.peekSession(); - if (session == null) { - // FIXME: not stdout. - System.out.println("ResourceSchemeHandler: no session"); - return; - } - - // Try the doubleClick-extensions - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window == null) - return; - - final String perspectiveId = WorkbenchUtils.getCurrentPerspectiveId(); - - session.asyncRequest(new ChooseActionRequest(window.getShell(), r, perspectiveId, false, true)); - - } - -} +/******************************************************************************* + * 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.message.ui.scheme; + +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.message.AbstractMessageSchemeHandler; +import org.simantics.ui.SimanticsUI; +import org.simantics.ui.workbench.action.ChooseActionRequest; +import org.simantics.utils.ui.workbench.WorkbenchUtils; + +/** + * @author Tuukka Lehtonen + */ +public class ResourceSchemeHandler extends AbstractMessageSchemeHandler { + + public ResourceSchemeHandler() { + super("resource", Resource.class); + } + + @Override + public void doPerform(Resource r) { + Session session = SimanticsUI.peekSession(); + if (session == null) { + // FIXME: not stdout. + System.out.println("ResourceSchemeHandler: no session"); + return; + } + + // Try the doubleClick-extensions + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window == null) + return; + + final String perspectiveId = WorkbenchUtils.getCurrentPerspectiveId(); + + session.asyncRequest(new ChooseActionRequest(window.getShell(), r, perspectiveId, false, true)); + + } + +}