Bug 65240 - Hierarchical layout: Problems with inclusion filters [package explorer]
Summary: Hierarchical layout: Problems with inclusion filters [package explorer]
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal with 5 votes (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Benno Baumgartner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 69491 75105 83407 83491 86251 (view as bug list)
Depends on:
Blocks: 65637
  Show dependency tree
 
Reported: 2004-06-02 05:15 EDT by Martin Aeschlimann CLA
Modified: 2009-05-04 04:19 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2004-06-02 05:15:32 EDT
RC1

See setup from bug 65234.
proj
  src
    org
      eclipse
        mypack
          A.java
        otherpack
          B.java

Set an inclusion filter of src to "org/eclipse/mypack/".

The package explorer shows a package in flat mode, but not in hierarchical mode.
Comment 1 Dirk Baeumer CLA 2004-06-03 13:23:50 EDT
The problem is that in the given scenario the folder proj/src/org doesn't 
can't be converted into a package fragment. Calling JavaCore.create
("proj/src/org") return null.

The hierarchical layout assumes that if org.eclipse.mypack is a package org 
and org.eclipse are packages as well. This doesn't seem to be the case with 
inclusion filters anymore.
Comment 2 Dirk Baeumer CLA 2004-06-03 13:29:12 EDT
Jerome pointed out that the inclusion filter is equivalent to an exclusion 
filter: org/*.java, org/eclipse/*.java. Have to check what we do here.
Comment 3 Dirk Baeumer CLA 2004-06-03 13:35:06 EDT
This isn't equivalent. Specifying these exclusion filters still reports org 
and org.eclipse as packages.
Comment 4 Jerome Lanneluc CLA 2004-06-03 13:43:34 EDT
It looks like we're inconsistent here:
- for an inclusion filter org/eclipse/mypack/, org and org.eclipse are not 
package fragments
- for an exclusion filter org/*.java|org/eclipse/*.java, org and org.eclipse 
are package fragments

The exclusion filter case sounds like a bug, but fixing it might break the UI.

If we go the other way around (i.e. fix the inclusion filter case so that org 
and org.eclipse are package fragments), UI would be happy, but this is not 
what other clients of the Java model would expect.
Comment 5 Jerome Lanneluc CLA 2004-06-03 17:03:46 EDT
I was not quite right: an org/eclipse/mypack inclusion filter is equivalent to 
an org/*|org/eclipse/* exclusion filter. However even in this case we're still 
inconsistent as described in comment #4.
Comment 6 Jerome Lanneluc CLA 2004-06-03 17:16:45 EDT
Entered bug 65637 against JDT Core for the inconsistency issue.
Comment 7 Dirk Baeumer CLA 2004-06-04 04:13:46 EDT
This can't be fixed for 3.0 and has to be doced as a known limitation. The 
hierarchical mode in package explorer and packages view is based on the 
assumption the Java elements have Java elements as parents. This isn't the 
case when excluding parents or explicitly including children. 

Fixing this is basically a rewrite of the hierarchical layout mode which isn't 
an option so shortly before 3.0.
Comment 8 Dirk Baeumer CLA 2004-07-07 13:52:44 EDT
*** Bug 69491 has been marked as a duplicate of this bug. ***
Comment 9 Dirk Baeumer CLA 2004-10-11 05:32:50 EDT
*** Bug 75105 has been marked as a duplicate of this bug. ***
Comment 10 Dirk Baeumer CLA 2005-01-23 10:54:39 EST
*** Bug 83491 has been marked as a duplicate of this bug. ***
Comment 11 Frank Ganske CLA 2005-01-23 13:13:02 EST
Should'nt you switch the Package Explorer to flat, disable the menu and set a
tool tip text, if there is an open project with includes for a source folder of
an classpath item of its build paths block?

But, you need the answer for the previous question. Is somewhere a class
SourceFolder to ask? (and to get and to set...)

Should'nt it be?
Comment 12 Dirk Baeumer CLA 2005-01-29 06:16:45 EST
*** Bug 83407 has been marked as a duplicate of this bug. ***
Comment 13 Dirk Baeumer CLA 2005-02-23 09:16:10 EST
*** Bug 86251 has been marked as a duplicate of this bug. ***
Comment 14 Dirk Baeumer CLA 2005-05-09 11:14:11 EDT
This will not make it into 3.1. The workaround is to use flat layout when
dealing with inclusion filters.
Comment 15 Benno Baumgartner CLA 2006-01-11 10:48:03 EST
fixed > 20060111

IPackageFragment can now have an IFolder as parent and IFolder can have IPackageFragment as child in the package explorer. Please reopen if fix of bug 65234 does break the package explorer. 

The java browsing perspective does have the exact same problem. Created new bug 123424 since it is not the same code.