|
|
Re: Problems integrating a workflow in a plugin [message #650393 is a reply to message #650363] |
Mon, 24 January 2011 17:33   |
|
Hello Tom,
maybe there different instances of uml packages registered to your epackage reistry at runtime
here is a action that tests this
package terterter.popup.actions;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.mwe.utils.StandaloneSetup;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.xtend.expression.TypeSystemImpl;
import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel;
import org.eclipse.xtend.typesystem.uml2.Setup;
public class NewAction implements IObjectActionDelegate {
private Shell shell;
/**
* Constructor for Action1.
*/
public NewAction() {
super();
}
/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
shell = targetPart.getSite().getShell();
}
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
StandaloneSetup ss = new StandaloneSetup();
Setup s = new Setup();
s.setStandardUML2Setup(true);
EmfRegistryMetaModel mm = new EmfRegistryMetaModel();
mm.setTypeSystem(new TypeSystemImpl());
for (String name : EPackage.Registry.INSTANCE.keySet()) {
Object o = EPackage.Registry.INSTANCE.get(name);
if (o instanceof EPackage) {
if ("uml".equals(((EPackage)o).getNsPrefix())) {
System.out.println(name + " " + o.hashCode());
}
}
}
}
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
}
}
an output like
is ok since the instance is the same all the time.
might not be ok since there are different instances bound.
~ Christian
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
|
|
|
Re: Problems integrating a workflow in a plugin [message #650413 is a reply to message #650393] |
Mon, 24 January 2011 18:26   |
|
Hi,
Regarding your XtendComponent problem.
do not rely on transitive dependencies.
the workflow is executed in the context of the ui plugin, not the dev.test.codegen plugin. so add the transformation plugin to the ui plugins dependencies.
~Christian
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
|
|
|
Re: Problems integrating a workflow in a plugin [message #650432 is a reply to message #650413] |
Mon, 24 January 2011 20:27   |
|
Hi,
so doing following things finally makes your sample runnable with my eclipse
(1) add dev.test.codegen.generation and dev.test.codegen.transformation to deps of dev.test.codegen.ui
(2) let dev.test.codegen.generation export the dev.test.codegen.generation.generic package dev.test.codegen.generation.generic
(3) set the store location for the dump file in CommandHandler to something where eclipse can write to (not a platform:/plugin/...) uri.
~Christian
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
|
|
|
|
|
|
|
Re: Problems integrating a workflow in a plugin [message #650526 is a reply to message #650525] |
Tue, 25 January 2011 12:37  |
|
Hi,
this seems not be be the problem.
you could try to debug there the duplicate things come from:
org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel.allPac kages()
org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel.getNam edElementRec(ENamedElement[], String)
~Christian
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
|
|
|
Powered by
FUDForum. Page generated in 0.02720 seconds