Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to retrieve project from an action targeted by an XXXEditPart
How to retrieve project from an action targeted by an XXXEditPart [message #155154] Sat, 13 October 2007 05:01 Go to next message
Eclipse UserFriend
Originally posted by: steven.huet.gmail.com

Hi all,

Very simple question : is there a way to retrieve the project which
contains the resource in which the EditPart is saved ?

I tried to do this through EditingDomain.getResourceSet(), but could not
find a pointer to the project at the end.

I need this to enable the user to open a C-Source file associated to the
node he selects, and I now grep the file in the whole worspace which
takes a lot of time.

Thanks for your help !

Steven
Re: How to retrieve project from an action targeted by an XXXEditPart [message #155190 is a reply to message #155154] Sat, 13 October 2007 07:16 Go to previous message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

Hi,

WorkspaceSynchronizer.getFile(element.eResource()).getProjec t();

or

public static IProject getProjectOfEObject(EObject element)
{
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
String projectName = element.eResource().getURI().segment(1);
return root.getProject(projectName);
}

should work.

Steven HUET schrieb:
> Hi all,
>
> Very simple question : is there a way to retrieve the project which
> contains the resource in which the EditPart is saved ?
>
> I tried to do this through EditingDomain.getResourceSet(), but could not
> find a pointer to the project at the end.
>
> I need this to enable the user to open a C-Source file associated to the
> node he selects, and I now grep the file in the whole worspace which
> takes a lot of time.
>
> Thanks for your help !
>
> Steven
Previous Topic:sequencing
Next Topic:Palette (gmf): Layout, ToolEntry, ContextMenu
Goto Forum:
  


Current Time: Mon Nov 10 06:30:42 EST 2025

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

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

Back to the top