Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-core-dev] Re: [flexible project structure] querying of linked resources


At any given time the workspace has a "root set" of locations below which all resources are found on disk.  This set can be computed by gathering the locations (IResource#getLocation) of all projects, and all linked resources.  There can be overlap within this root set, although project locations are still not permitted to overlap.  You can detect overlap by using IPath#isPrefixOf on the paths returned by #getLocation.  We have no way of being aware of OS linking... they are transparent to the JVM.  Note that project and linked resource locations can be "null" in the case where they are relative to undefined path variables.  There are a number of workspace operations that can cause this root set to change.  These are:

- Project deletion, open, close, move. (project creation is not important because newly created projects start out in the closed state, and closed projects have no local contents.  However, creation often happens in the same delta as project open).

- Linked resource creation, deletion.
- Change of a workspace path variable

You can listen for all of these changes using IResourceChangeListener, and IPathVariableChangeListener (see IPathVariableManager).  




"Jed Anderson" <Jed_Anderson@xxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

12/06/2002 05:28 PM
Please respond to platform-core-dev

       
        To:        platform-core-dev@xxxxxxxxxxx
        cc:        
        Subject:        [platform-core-dev] [flexible project structure] querying of linked resources



I started thinking about the project structure problem in relation to the
Autorefresh support, and I've come up with a few questions.

The two issues I will have to solve are:
1. Determine if a resource links outside of the set of subtrees that the
natives are monitoring, so that I can start monitoring it.
2. Determine if a resource links into an already monitored subtree, so that
I can skip monitoring it.

Will there be some mechanism which will allow me to query if one resource
contains another?  I could try checking the resource's OS filenames against
each other, but this wouldn't work if the user is mixing Eclipse linking
and OS linking.

jkca




Back to the top