Home » Eclipse Projects » Plugin Development Environment (PDE) » Name of Active project
Name of Active project [message #3402] |
Mon, 19 May 2008 22:16 |
Eclipse User |
|
|
|
Originally posted by: cschilli.rumms.uni-mannheim.de
Hi,
I am currently expanding an EMF generated Editor Plugin.
I run some tests on resources, which were created with the
editor and stored in a project.
Now want to retrieve the current active project, so that
i can analyze resources from arbitrary projects.
I use the following code to obtain the name of the current resource
IEditorPart editor = HandlerUtil.getActiveEditor(event);
String plmInstanceFileName = editor.getEditorInput().getName();
But to create the whole URI for my Resource Loader i need the
the current project name too.
"platform:/resource/" + currentActiveProjectName + "/" +
plmInstanceFileName
Can somebody tell me, how I can retrieve the project name ?
Thanks and regards
Christian
|
|
|
Re: Name of Active project [message #3538 is a reply to message #3402] |
Tue, 20 May 2008 15:21 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Christian wrote:
> Hi,
> I am currently expanding an EMF generated Editor Plugin.
> I run some tests on resources, which were created with the
> editor and stored in a project.
>
> Now want to retrieve the current active project, so that
> i can analyze resources from arbitrary projects.
What exactly do you mean by the "active" project?
Eric
|
|
|
Re: Name of Active project [message #3570 is a reply to message #3538] |
Tue, 20 May 2008 17:24 |
Eclipse User |
|
|
|
Originally posted by: cschilli.rumms.uni-mannheim.de
Eric Rizzo schrieb:
> Christian wrote:
>> Hi,
>> I am currently expanding an EMF generated Editor Plugin.
>> I run some tests on resources, which were created with the
>> editor and stored in a project.
>>
>> Now want to retrieve the current active project, so that
>> i can analyze resources from arbitrary projects.
>
> What exactly do you mean by the "active" project?
>
> Eric
The project to which the Resource belongs, which is currently
open with the "activeEditor".
I allready have an IEditorInput Object, but did not know, how to
get the full resource URI, of the resouce, whicht is currently
opened.
I hope that i am properly describing my problem.
Regards
Christian
|
|
|
Re: Name of Active project [message #3602 is a reply to message #3570] |
Wed, 21 May 2008 13:51 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Christian wrote:
> Eric Rizzo schrieb:
>> Christian wrote:
>>> Hi,
>>> I am currently expanding an EMF generated Editor Plugin.
>>> I run some tests on resources, which were created with the
>>> editor and stored in a project.
>>>
>>> Now want to retrieve the current active project, so that
>>> i can analyze resources from arbitrary projects.
>>
>> What exactly do you mean by the "active" project?
>>
>> Eric
>
> The project to which the Resource belongs, which is currently
> open with the "activeEditor".
>
> I allready have an IEditorInput Object, but did not know, how to
> get the full resource URI, of the resouce, whicht is currently
> opened.
If you are certain that the input is a file, you can cast it to a
FileEditorInput and then call getFile().getProject() to get the IProject
that contains it.
Hope this helps,
Eric
|
|
|
Re: Name of Active project [message #3667 is a reply to message #3602] |
Fri, 23 May 2008 14:03 |
Eclipse User |
|
|
|
Originally posted by: cschilli.rumms.uni-mannheim.de
Eric Rizzo schrieb:
> Christian wrote:
>> Eric Rizzo schrieb:
>>> Christian wrote:
>>>> Hi,
>>>> I am currently expanding an EMF generated Editor Plugin.
>>>> I run some tests on resources, which were created with the
>>>> editor and stored in a project.
>>>>
>>>> Now want to retrieve the current active project, so that
>>>> i can analyze resources from arbitrary projects.
>>>
>>> What exactly do you mean by the "active" project?
>>>
>>> Eric
>>
>> The project to which the Resource belongs, which is currently
>> open with the "activeEditor".
>>
>> I allready have an IEditorInput Object, but did not know, how to
>> get the full resource URI, of the resouce, whicht is currently
>> opened.
>
> If you are certain that the input is a file, you can cast it to a
> FileEditorInput and then call getFile().getProject() to get the IProject
> that contains it.
>
> Hope this helps,
> Eric
Hi Eric,
that was exactly what i was looking for !
Many thanks
Christian
|
|
| | |
Re: Name of Active project [message #567129 is a reply to message #3570] |
Wed, 21 May 2008 13:51 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
Christian wrote:
> Eric Rizzo schrieb:
>> Christian wrote:
>>> Hi,
>>> I am currently expanding an EMF generated Editor Plugin.
>>> I run some tests on resources, which were created with the
>>> editor and stored in a project.
>>>
>>> Now want to retrieve the current active project, so that
>>> i can analyze resources from arbitrary projects.
>>
>> What exactly do you mean by the "active" project?
>>
>> Eric
>
> The project to which the Resource belongs, which is currently
> open with the "activeEditor".
>
> I allready have an IEditorInput Object, but did not know, how to
> get the full resource URI, of the resouce, whicht is currently
> opened.
If you are certain that the input is a file, you can cast it to a
FileEditorInput and then call getFile().getProject() to get the IProject
that contains it.
Hope this helps,
Eric
|
|
|
Re: Name of Active project [message #567178 is a reply to message #3602] |
Fri, 23 May 2008 14:03 |
Christian Messages: 72 Registered: July 2009 |
Member |
|
|
Eric Rizzo schrieb:
> Christian wrote:
>> Eric Rizzo schrieb:
>>> Christian wrote:
>>>> Hi,
>>>> I am currently expanding an EMF generated Editor Plugin.
>>>> I run some tests on resources, which were created with the
>>>> editor and stored in a project.
>>>>
>>>> Now want to retrieve the current active project, so that
>>>> i can analyze resources from arbitrary projects.
>>>
>>> What exactly do you mean by the "active" project?
>>>
>>> Eric
>>
>> The project to which the Resource belongs, which is currently
>> open with the "activeEditor".
>>
>> I allready have an IEditorInput Object, but did not know, how to
>> get the full resource URI, of the resouce, whicht is currently
>> opened.
>
> If you are certain that the input is a file, you can cast it to a
> FileEditorInput and then call getFile().getProject() to get the IProject
> that contains it.
>
> Hope this helps,
> Eric
Hi Eric,
that was exactly what i was looking for !
Many thanks
Christian
|
|
|
Goto Forum:
Current Time: Sat Apr 27 00:00:36 GMT 2024
Powered by FUDForum. Page generated in 0.03224 seconds
|