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;h=0c29189ff33fe6e2ae83ec183f3f63ca74f8d487;hb=47269fe0acb894f346810417d950a1ab59cdc0ea;hp=cf63714341d783aaf79493d92a5788740703098f;hpb=969bd23cab98a79ca9101af33334000879fb60c5;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..0c29189ff 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.Simantics; +import org.simantics.db.Resource; +import org.simantics.db.Session; +import org.simantics.message.AbstractMessageSchemeHandler; +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); //$NON-NLS-1$ + } + + @Override + public void doPerform(Resource r) { + Session session = Simantics.peekSession(); + if (session == null) { + // FIXME: not stdout. + System.out.println("ResourceSchemeHandler: no session"); //$NON-NLS-1$ + 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)); + + } + +}