Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » IJavaProject.isOpen()
IJavaProject.isOpen() [message #251351] Tue, 12 February 2008 05:16 Go to next message
Eclipse UserFriend
Originally posted by: email.hidden.org

Is there any explanation for why calling IJavaProject.isOpen() would
return false if the project was opened (e.g. the state after which the
user would right-click the project and select 'Open Project') but not
expanded (e.g the plus/minus sign next to the project is a plus meaning
the project is 'collapsed')? This seemed counter intuitive and I had to
use IJavaProject.getResource().isAccessible() instead. Just curious to
know if this was a bug or not.

--Matthew
Re: IJavaProject.isOpen() [message #251356 is a reply to message #251351] Tue, 12 February 2008 05:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: email.hidden.org

Matthew Bowman wrote:
> Is there any explanation for why calling IJavaProject.isOpen() would
> return false if the project was opened (e.g. the state after which the
> user would right-click the project and select 'Open Project') but not
> expanded (e.g the plus/minus sign next to the project is a plus meaning
> the project is 'collapsed')? This seemed counter intuitive and I had to
> use IJavaProject.getResource().isAccessible() instead. Just curious to
> know if this was a bug or not.

As a follow up, if you create a New Java Project, once it's created it's
in the collapsed state. At this point IJavaProject.isOpen() returns
false, however expanding and/or collapsing from this point on make
IJavaProject.isOpen() return true. This makes me think the collapsed /
expanded state of the project has no effect on IJavaProject.isOpen() and
this is a bug. Any other ideas?

--Matthew
Re: IJavaProject.isOpen() [message #251364 is a reply to message #251356] Wed, 13 February 2008 08:03 Go to previous messageGo to next message
Eclipse UserFriend
Matthew Bowman wrote:
> Matthew Bowman wrote:
>> Is there any explanation for why calling IJavaProject.isOpen() would
>> return false if the project was opened (e.g. the state after which the
>> user would right-click the project and select 'Open Project') but not
>> expanded (e.g the plus/minus sign next to the project is a plus
>> meaning the project is 'collapsed')? This seemed counter intuitive and
>> I had to use IJavaProject.getResource().isAccessible() instead. Just
>> curious to know if this was a bug or not.
>
> As a follow up, if you create a New Java Project, once it's created it's
> in the collapsed state. At this point IJavaProject.isOpen() returns
> false, however expanding and/or collapsing from this point on make
> IJavaProject.isOpen() return true. This makes me think the collapsed /
> expanded state of the project has no effect on IJavaProject.isOpen() and
> this is a bug. Any other ideas?
>
> --Matthew

This is not related to project resource being open/closed. I agree this
is misleading.

IOpenable#isOpen() is somewhat an advanced feature for model users,
which allows to tell whether some Java element got loaded in memory
already (the model is backed with a LRU cache). So this allows power
users to decide whether the data they look for is in cache already
(efficient) or will need to be lazy populated (in which case you may
want to consider alternate solutions).

Maybe the doc should be improved.
Re: IJavaProject.isOpen() [message #251373 is a reply to message #251364] Wed, 13 February 2008 11:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Philippe Mulet" <philippe_mulet@fr.ibm.com> wrote in message
news:foups0$867$1@build.eclipse.org...
>
> IOpenable#isOpen() is somewhat an advanced feature for model users, which
> allows to tell whether some Java element got loaded in memory already (the
> model is backed with a LRU cache). So this allows power users to decide
> whether the data they look for is in cache already (efficient) or will
> need to be lazy populated (in which case you may want to consider
> alternate solutions).
>
> Maybe the doc should be improved.


+1 for adding exactly what you just wrote to the javadoc :-)
Re: IJavaProject.isOpen() [message #251376 is a reply to message #251356] Wed, 13 February 2008 12:47 Go to previous message
Eclipse UserFriend
Matthew Bowman wrote:
> Matthew Bowman wrote:
>> Is there any explanation for why calling IJavaProject.isOpen() would
>> return false if the project was opened (e.g. the state after which the
>> user would right-click the project and select 'Open Project') but not
>> expanded (e.g the plus/minus sign next to the project is a plus
>> meaning the project is 'collapsed')? This seemed counter intuitive and
>> I had to use IJavaProject.getResource().isAccessible() instead. Just
>> curious to know if this was a bug or not.
>
> As a follow up, if you create a New Java Project, once it's created it's
> in the collapsed state. At this point IJavaProject.isOpen() returns
> false, however expanding and/or collapsing from this point on make
> IJavaProject.isOpen() return true. This makes me think the collapsed /
> expanded state of the project has no effect on IJavaProject.isOpen() and
> this is a bug. Any other ideas?
>
> --Matthew

Please see Philippe's reply. This should also be explained on IOpenable
(that defines isOpen()). If this needs to be clarified, please enter
a bug report against JDT/Core.

Jerome
Previous Topic:"No Default Proposals" with the completion
Next Topic:JEM model => Java
Goto Forum:
  


Current Time: Sun Apr 20 10:25:21 EDT 2025

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

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

Back to the top