Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 32378 - Java Build Path properties page [general issue] [build path]
Summary: Java Build Path properties page [general issue] [build path]
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-20 13:30 EST by Jason Sholl CLA
Modified: 2005-03-02 11:04 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Sholl CLA 2003-02-20 13:30:59 EST
The Java Build Path properties page should refresh when it is opened and should 
also have an apply button.  We are running into problems because we also 
contribute a properties page to Java projects that edits the build properties 
and it is unclear what the current state of the build path is.  There are two 
main problems. 

First, the user opens our page, modifies and applies the change and then goes 
to the Java Build Path page where the change is not available because it is not 
refreshed.  At this point if the user modifies the Java Build Path page and 
exits.  The changes he first made are wiped out and replaced with current state 
of the Java Build Path page.

Second, the user opens the Java Build Path page and modifies some information 
and then goes to our page; these changes are unavaible.  It would be nice if 
the user could have applied the changes from the Java Build Path page to make 
them avaible to our page.  We are able to handle this state (in English at 
least) because our page comes after the Java Build path page and is saved last.

Ultimatly, the best solution would be to create an in memory copy of the Build 
Properties that both pages could use without these synchronization issues.
Comment 1 Dirk Baeumer CLA 2003-02-20 14:15:06 EST
Why is it necessary that you provide your own page to edit Java build path 
properties ?
Comment 2 Ritchie Schacher CLA 2003-02-25 09:52:21 EST
Our J2EE tools plugin provides a "Java JAR Dependencies" property page.  This 
page is used to modify the runtime classpath, aka in the MANIFEST.MF file, AND 
the Java build path in a one-stop-shopping approach.  In our project structure, 
each module in an EAR is mapped to a project or JAR file in an EAR.

We try to steer our customers to use our page instead of the Java build path 
page, when they are modifying the build path to set up project-to-project 
dependencies when the projects represent modules or JARs in an EAR.  However, 
we can't stop them from using the Java build path page as well and therefore it 
would be nice if we can have better syncronization to mitigate the update 
anomolies that users often encounter.

The web tools plugin contains a similar page for "web library projects", which 
allows you to treat a Java project as a "virtual" JAR under the WEB-INF/lib 
directory.

At a minimum, the Java build path page could listen for updates to the 
classpath and refresh accordingly when it is focused.  More advanced would be 
for us to work together and figure out a way for the Java build path page to be 
extended, where other plugins can contribute pages that would be synchronized 
with the other pages.
Comment 3 Dirk Baeumer CLA 2003-02-26 09:09:45 EST
The same problem exists with other perference/properties pages as well. 
 
Given the current schedule (we have passed RC1 and only consider critical bugs) 
there is little we can do since opening the build path dialog or listening to class path 
changes envolves recoding. 
 
A "low risk" solution would be to commit the changes on page flip instead of dialog 
closing. But to do so, platform support is needed. 
 
Postponing > 2.1. But we should look into this for 2.2 
Comment 4 Ritchie Schacher CLA 2003-08-04 10:15:41 EDT
Users are still having difficulty with this.  Will it be resolved for 3.0?
Comment 5 Jason Sholl CLA 2003-08-04 10:18:10 EDT
Is this going to be addressed for Eclipse 3.0?
Comment 6 Dirk Baeumer CLA 2003-08-04 10:37:31 EDT
Martin, can you please comment on possible solutions to solve this problem. 
Comment 7 Martin Aeschlimann CLA 2003-08-06 03:54:17 EDT
We should discuss this also with the core. The 'project capability' proposal was
the solution for that (depending on the nature a project can decide which
property pages are there)
Comment 8 Marc Southard CLA 2003-08-25 10:19:53 EDT
I've discovered a partial workaround for this problem. It seems to force a 
refresh of the classpath settings if one changes the order of the JAR or 
project that satisfies the dependency using the Order and Export tab of the 
Java Build Path page. This doesn't always work, but I've been able to save a 
little frustration by resorting to it.
Comment 9 Tim Koss CLA 2003-10-20 16:41:43 EDT
proposed for 3.0
Comment 10 Ritchie Schacher CLA 2003-10-20 17:28:47 EDT
Is there a design doc available?
Comment 11 Ritchie Schacher CLA 2003-12-15 10:36:51 EST
CC'ing Dan as we discussed this at length recently.
Comment 12 Ritchie Schacher CLA 2003-12-15 10:46:14 EST
CC'ing Dan as we discussed this at length recently.
Comment 13 Ritchie Schacher CLA 2003-12-15 10:48:03 EST
CC'ing Dan as we discussed this at length recently.
Comment 14 Ritchie Schacher CLA 2003-12-15 10:51:28 EST
Sorry about the multiple updates, having some problems with bugzilla:

As we discussed recently, there are a few approaches to solve this:

1)  Add exclusion filters which would allow us to replace the Java build path 
page with our own, based on the nature.  There are some limitations to this.
-A.  We don't want to copy all the code in the Java build path page and 
reference internal code.  There is some function in Java build path that we 
still want to keep, e.g., source folders, classes folders, libraries.
-B.  We actually have 3 different property pages that can modify the build path

2)  Change the build path page to use a notification based working copy of the 
Java build path.  The all our pages can use this as well.  When the working 
copy is changed, the property pages can refresh accordingly.

3)  Change the behavior of preferences such that changing the page will apply 
the changes.  Then all build path related pages need to refresh when they are 
re-focused.  Pages that force an autobuild would indicate this but the 
autobuild would not fire until the dialog is closed.

This issue is very important to our product, and we'd like to see some 
resolution in the 3.0 timeframe.
Comment 15 Dirk Baeumer CLA 2004-01-05 06:45:52 EST
Regarding the proposed solution:

3.) this requires lots of work since we have to do it for "all" preference
    pages to be consistent.

Another solution is:

4.) pages that manipulate the Java build path create a "copy" of the build 
    path when they first open. If the loose and gain focus the compare the
    current setting with the stored copy. If they differ, some other page
    has changed the build path and they could be adjusted.
    This solution doesn't require additional API nor new concepts (overriding
    of preference pages).
Comment 16 Ritchie Schacher CLA 2004-01-05 09:49:56 EST
In option 4, what would happen if the user modified one page but did not 
hit "Apply", then flipped to another page?  How would the changes be kept in 
sync?  Options 2 or 3 would address this.
Comment 17 Dirk Baeumer CLA 2004-01-05 10:00:46 EST
This is correct. But the case gets detected when the users presses apply on 
the second page. So it handles the "last save wins" case which I thought 
causes the most trouble.
Comment 18 Ritchie Schacher CLA 2004-01-05 10:09:35 EST
Getting the Java build path page to refresh after one of our pages has been 
applied is certainly an improvement.  Synchronization even when changes are not 
applied would be even better.  I think the right solution should take that into 
consideration, but would settle for option 4 only if the "right" solution 
cannot be contained.
Comment 19 Martin Aeschlimann CLA 2004-01-14 06:46:11 EST
We decided to implement solution 4. It will also work if we get 3.) from the
platform (I'm not conviced they will like that idea).

In fact all preference and property pages should to implement 4: Our preference
keys are API so for any kind of setting conflicts are possible.

Summary of solution 4:
Whenever a page becomes visible, it has to read the options it configures from
the store and compare them with it's working values. If different, a dialog is
opened to ask which if you want to update the working values with the stored
changes.
Open point is how to react if the conflict is discovered on finish. Cascaded
dialogs could be the result.


Comment 20 Daniel Berg CLA 2004-01-14 09:46:10 EST
Solution 3 is the preferred solution but we will take solution 4 in the 
Eclipse 3.0 timeframe if 3 cannot be contained.  A reasonable solution is 
better than no solution at all. ;-)
Comment 21 Martin Aeschlimann CLA 2004-02-18 10:44:06 EST
I implemented solution 3 for the Java Build path page. When leaving the page
with unapplied changes, a dialog asks the user to apply the changes so that
other build path related pages can update. When becoming visible, the page
always refreshes with the settings from the build path.
Other options are 'dicard and keep unapplied'.
This is implemented in 'setVisible' which has some limitations, e.g. I can't
e.g. prevent that the page switch.

Have a look and let me know what you think.
> 20040218 (for M8)
Comment 22 Chuck Bridgham CLA 2005-03-02 11:04:20 EST
Verified by Jialin Chen