*******************************************************************************/\r
package org.simantics.browsing.ui.swt;\r
\r
+import java.lang.reflect.Method;\r
+\r
+import org.eclipse.core.runtime.Platform;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.widgets.Composite;\r
import org.eclipse.ui.services.IServiceLocator;\r
+import org.osgi.framework.Bundle;\r
import org.simantics.Simantics;\r
import org.simantics.browsing.ui.BuiltinKeys;\r
import org.simantics.browsing.ui.GraphExplorer;\r
import org.simantics.simulation.ontology.SimulationResource;\r
import org.simantics.utils.datastructures.BinaryFunction;\r
import org.simantics.utils.datastructures.hints.IHintContext;\r
+import org.simantics.utils.ui.ExceptionUtils;\r
\r
/**\r
* @author Tuukka Lehtonen\r
explorer.setServiceLocator(serviceLocator);\r
return explorer;\r
}\r
+ \r
+ public GraphExplorer create3(Composite parent, int style) {\r
+ //GraphExplorerImpl2 explorer = new GraphExplorerImpl2(parent, style);\r
+ try {\r
+ Bundle bundle = Platform.getBundle("org.simantics.browsing.ui.nattable");\r
+ Class<GraphExplorer> clazz = (Class<GraphExplorer>)bundle.loadClass("org.simantics.browsing.ui.nattable.NatTableGraphExplorer");\r
+ //Class<GraphExplorer> clazz = (Class<GraphExplorer>)bundle.getClass().getClassLoader().loadClass("org.simantics.browsing.ui.nattable.NatTableGraphExplorer");\r
+ GraphExplorer explorer = clazz.getConstructor(Composite.class, int.class).newInstance(parent,style);\r
+ explorer.setSelectionDataResolver(selectionDataResolver);\r
+ explorer.setSelectionFilter(selectionFilter);\r
+ explorer.setSelectionTransformation(selectionTransformation);\r
+ Method m = clazz.getMethod("setServiceLocator", IServiceLocator.class);\r
+ m.invoke(explorer, serviceLocator);\r
+ //explorer.setServiceLocator(serviceLocator);\r
+ return explorer;\r
+ } catch (Throwable t) {\r
+ ExceptionUtils.logAndShowError(t);\r
+ return null;\r
+ }\r
+ }\r
\r
// void hookActions(IWorkbenchSite site) {\r
// IActionBars actionBars = null;\r