Name of a PackageFragmentRoot [message #41840] |
Wed, 28 May 2003 07:53  |
Eclipse User |
|
|
|
Originally posted by: jmordax.terra.es
Hi, I am trying to develop a Java inspector. The plugin tries to show
all the element of a Java Project.
Using JDT, I am getting inside the Java Project but I have not found a
way to show the nema of the PackageFragmentsRoots of a Java Test Project.
What I have been able is to print its IPath beacuse getElementName
always return "".
Any idea?
Thanks in advance,
Chemi.
|
|
|
|
|
|
|
|
Re: Name of a PackageFragmentRoot [message #42663 is a reply to message #42603] |
Thu, 29 May 2003 02:59   |
Eclipse User |
|
|
|
Originally posted by: jmordax.terra.es
This is a multi-part message in MIME format.
--------------040508020205020207000504
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Frank, I didn't setup anything special. I just created a Java Project
and executed my inspection plugin. The result of getting the children of
the Java Project was:
- 1 Package Fragment Root which was the Java Project.
- 20 Package Fragment Roots which were the JAR files in the Library.
I am using Eclipse R2.1
Hope this helps,
Chemi.
Frank Sauer wrote:
>The project itself can be a package fragment root???
>If that is true, I'll have to deal with that in my metrics plugin.
>How do I set up a project with that behavior?
>
>Frank
>
>"Adam Kiezun" <adam_kiezun@ch.ibm.spam.protection.com> wrote in message
>news:bb2bko$tpc$1@rogue.oti.com...
>
>
>>i think you have to do the following:
>>check if getResource() called on the packageFragmentRoot gives you the
>>
>>
>project
>
>
>>and if yes, then you know that the project itself is the package fragment
>>
>>
>root
>
>
>>and return the name of the project in that case
>>
>>when the project is a package fragment root, then there exist 2 elements -
>>
>>
>the project and the package fragment root itself
>
>
>>they're not equal (in the sense of equals()) but they really are
>>looks like the root's name is empty in that case
>>i think it'd be reasonable to expact that it be of the same name as the
>>
>>
>project
>
>
>>you could enter a bug report if you wanted (JDT CORE)
>>
>>cheers
>>a.
>>--
>>eclipse.org
>>
--------------040508020205020207000504
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
Frank, I didn't setup anything special. I just created a Java Project
and executed my inspection plugin. The result of getting the children
of the Java Project was:<br>
<br>
- 1 Package Fragment Root which was the Java Project.<br>
<br>
- 20 Package Fragment Roots which were the JAR files in the Library.<br>
<br>
I am using Eclipse R2.1<br>
<br>
Hope this helps,<br>
<br>
Chemi.<br>
<br>
Frank Sauer wrote:<br>
<blockquote type="cite" cite="midbb3ilp$26e$1@rogue.oti.com">
<pre wrap="">The project itself can be a package fragment root???
If that is true, I'll have to deal with that in my metrics plugin.
How do I set up a project with that behavior?
Frank
"Adam Kiezun" <a class="moz-txt-link-rfc2396E" href="mailto:adam_kiezun@ch.ibm.spam.protection.com"><adam_kiezun@ch.ibm.spam.protection.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:bb2bko$tpc$1@rogue.oti.com">news:bb2bko$tpc$1@rogue.oti.com</a>...
</pre>
<blockquote type="cite">
<pre wrap="">i think you have to do the following:
check if getResource() called on the packageFragmentRoot gives you the
</pre>
</blockquote>
<pre wrap=""><!---->project
</pre>
<blockquote type="cite">
<pre wrap="">and if yes, then you know that the project itself is the package fragment
</pre>
</blockquote>
<pre wrap=""><!---->root
</pre>
<blockquote type="cite">
<pre wrap="">and return the name of the project in that case
when the project is a package fragment root, then there exist 2 elements -
</pre>
</blockquote>
<pre wrap=""><!---->the project and the package fragment root itself
</pre>
<blockquote type="cite">
<pre wrap="">they're not equal (in the sense of equals()) but they really are
looks like the root's name is empty in that case
i think it'd be reasonable to expact that it be of the same name as the
</pre>
</blockquote>
<pre wrap=""><!---->project
</pre>
<blockquote type="cite">
<pre wrap="">you could enter a bug report if you wanted (JDT CORE)
cheers
a.
--
eclipse.org</pre>
</blockquote>
</blockquote>
</body>
</html>
--------------040508020205020207000504--
|
|
|
|
Re: Name of a PackageFragmentRoot [message #47125 is a reply to message #41840] |
Tue, 03 June 2003 04:53  |
Eclipse User |
|
|
|
Just some clarification.
Package fragment roots denote classpath entries in the JavaModel. If you
choose to use the project itself as a souce folder, then the project gets a
package fragment root of relative path "" (empty - this is consistent with
default packages for PackageFragments).
When you create a Java project, by default the UI will create such a project
where project==source folder==binary output, you can change this using the
buildpath wizard.
For any element, #getElementName() is the way to go, now for this particular
one, it is indeed highly desirable you'd want to hide it in the UI and
simply show the project instead.
"Chemi" <jmordax@terra.es> wrote in message
news:bb27u1$pqh$1@rogue.oti.com...
> Hi, I am trying to develop a Java inspector. The plugin tries to show
> all the element of a Java Project.
> Using JDT, I am getting inside the Java Project but I have not found a
> way to show the nema of the PackageFragmentsRoots of a Java Test Project.
>
> What I have been able is to print its IPath beacuse getElementName
> always return "".
>
> Any idea?
>
> Thanks in advance,
>
> Chemi.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05422 seconds