X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.platform%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fplatform%2Fdebug%2FBrowseDebuggerView.java;h=a78ce0097fc7a65b346f3d7abc7075a5421da72e;hp=34af4c2938072487a8450109e2db9743d4b6671b;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/debug/BrowseDebuggerView.java b/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/debug/BrowseDebuggerView.java index 34af4c293..a78ce0097 100644 --- a/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/debug/BrowseDebuggerView.java +++ b/bundles/org.simantics.browsing.ui.platform/src/org/simantics/browsing/ui/platform/debug/BrowseDebuggerView.java @@ -1,94 +1,94 @@ -/******************************************************************************* - * 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.platform.debug; - -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPart; -import org.simantics.browsing.ui.GraphExplorer; -import org.simantics.browsing.ui.common.EvaluatorData; -import org.simantics.browsing.ui.graph.impl.Evaluators; -import org.simantics.browsing.ui.graph.impl.SessionContextInputSource; -import org.simantics.browsing.ui.platform.GraphExplorerView; -import org.simantics.browsing.ui.swt.DefaultSelectionDataResolver; -import org.simantics.browsing.ui.swt.GraphExplorerFactory; -import org.simantics.db.Session; -import org.simantics.db.management.ISessionContext; -import org.simantics.db.management.ISessionContextProvider; -import org.simantics.utils.ui.workbench.WorkbenchUtils; - -public class BrowseDebuggerView extends GraphExplorerView { - - final private Set browseContexts = Collections.singleton("browseDebuggerView"); - - @Override - protected GraphExplorer createExplorerControl(Composite parent) { - return GraphExplorerFactory.getInstance() - .selectionDataResolver(new DefaultSelectionDataResolver()) - .create(parent); - } - - public BrowseDebuggerView() { - - setInputSource(new SessionContextInputSource() { - - @Override - public Object get(ISessionContext ctx) { - - Map args = getViewArguments(); - System.out.println("args=" + args); - - IViewPart view = WorkbenchUtils.findView(args.get("view")); - System.out.println("view=" + view); - - return view; - - } - - @Override - public IWorkbenchPart getProvider() { - Map args = getViewArguments(); - IViewPart view = WorkbenchUtils.findView(args.get("view")); - return view; - } - - }); - - } - - @Override - protected EvaluatorData createEvaluatorData(Session session) { - - return Evaluators.load(session, browseContexts, resourceManager); - - } - - @SuppressWarnings({ "rawtypes" }) - @Override - public Object getAdapter(Class adapter) { - -// if(adapter == IPropertyPage.class) { -// return new UserPropertyPage(getSite(), this); -// } - if(adapter == ISessionContextProvider.class) { - return getSessionContextProvider(); - } - - return super.getAdapter(adapter); - - } - -} +/******************************************************************************* + * 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.platform.debug; + +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.IWorkbenchPart; +import org.simantics.browsing.ui.GraphExplorer; +import org.simantics.browsing.ui.common.EvaluatorData; +import org.simantics.browsing.ui.graph.impl.Evaluators; +import org.simantics.browsing.ui.graph.impl.SessionContextInputSource; +import org.simantics.browsing.ui.platform.GraphExplorerView; +import org.simantics.browsing.ui.swt.DefaultSelectionDataResolver; +import org.simantics.browsing.ui.swt.GraphExplorerFactory; +import org.simantics.db.Session; +import org.simantics.db.management.ISessionContext; +import org.simantics.db.management.ISessionContextProvider; +import org.simantics.utils.ui.workbench.WorkbenchUtils; + +public class BrowseDebuggerView extends GraphExplorerView { + + final private Set browseContexts = Collections.singleton("browseDebuggerView"); + + @Override + protected GraphExplorer createExplorerControl(Composite parent) { + return GraphExplorerFactory.getInstance() + .selectionDataResolver(new DefaultSelectionDataResolver()) + .create(parent); + } + + public BrowseDebuggerView() { + + setInputSource(new SessionContextInputSource() { + + @Override + public Object get(ISessionContext ctx) { + + Map args = getViewArguments(); + System.out.println("args=" + args); + + IViewPart view = WorkbenchUtils.findView(args.get("view")); + System.out.println("view=" + view); + + return view; + + } + + @Override + public IWorkbenchPart getProvider() { + Map args = getViewArguments(); + IViewPart view = WorkbenchUtils.findView(args.get("view")); + return view; + } + + }); + + } + + @Override + protected EvaluatorData createEvaluatorData(Session session) { + + return Evaluators.load(session, browseContexts, resourceManager); + + } + + @SuppressWarnings({ "rawtypes" }) + @Override + public Object getAdapter(Class adapter) { + +// if(adapter == IPropertyPage.class) { +// return new UserPropertyPage(getSite(), this); +// } + if(adapter == ISessionContextProvider.class) { + return getSessionContextProvider(); + } + + return super.getAdapter(adapter); + + } + +}