Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Integration with eclipse launch fwk
Integration with eclipse launch fwk [message #1091594] Wed, 21 August 2013 18:13 Go to next message
erwin de ley is currently offline erwin de ley
Messages: 2
Registered: August 2013
Junior Member
Dear graphiti community,

First of all thanks for the great work on this very nice extension/encapsulation on GEF and EMF!

I am in the process of migrating/upgrading a graphical model editor from a GEF-based implementation to Graphiti, with non-EMF business model.

See http : / / code.google.com/a/eclipselabs.org/p/passerelle/ for more info on our project.

For Passerelle, the model has to be executable. I've seen some other cases where Graphiti users (or BPMN2) would be interested in executable models as well.

We're (in the GEF-based version) using the eclipse launch fwk to run a model, and would like/need to keep this approach. For this we need to be able to consult the selected model file (i.e. the one open in the editor) via a system property selected_resource_path (provided by org.eclipse.debug.ui for use in the launch configurations).

The eclipse launch/debug fwk uses org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager to resolve this variable during the launch. This one internally does a call :

 protected IResource getSelectedResource0() {
  IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
  IResource resource = null;
  if(window != null) {
   IWorkbenchPage page  = window.getActivePage();
   if(page != null) {
    IWorkbenchPart part = page.getActivePart();
    if(part instanceof IEditorPart) {
     IEditorPart epart = (IEditorPart) part;
     resource = (IResource) epart.getEditorInput().getAdapter(IResource.class);
    }
...


And with graphiti this last line returns null, from the implementation in org.eclipse.graphiti.ui.editor.DiagramEditorInput :

 public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
  if (IFile.class.isAssignableFrom(adapter)) {
   return GraphitiUiInternal.getEmfService().getFile(getUri());
  } 
  return null;
 }


Could this be changed to allow IResource as adapter class?

Or would this break other things in Graphiti? In which case I would probably need to provide a custom EditorInput implementation for our needs?

kind regards
erwin
Re: Integration with eclipse launch fwk [message #1092965 is a reply to message #1091594] Fri, 23 August 2013 11:31 Go to previous messageGo to next message
Felix Velasco is currently offline Felix Velasco
Messages: 43
Registered: July 2009
Member
Please fill an enhancement bugzilla for this change, we'll modify as soon as possible.
Re: Integration with eclipse launch fwk [message #1095065 is a reply to message #1092965] Mon, 26 August 2013 15:19 Go to previous message
erwin de ley is currently offline erwin de ley
Messages: 2
Registered: August 2013
Junior Member
I created https://bugs.eclipse.org/bugs/show_bug.cgi?id=415888

thanks
erwin
Previous Topic:Caching of features
Next Topic:Drag & drop of (text)elements?
Goto Forum:
  


Current Time: Sat Oct 25 19:01:53 GMT 2014

Powered by FUDForum. Page generated in 0.08264 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software