Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312074 - The "Link Source' wizard in the Build Path property page does not show Project Path Variables
Summary: The "Link Source' wizard in the Build Path property page does not show Projec...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P5 normal (vote)
Target Milestone: 3.6 RC2   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 10:43 EDT by Serge Beauchamp CLA
Modified: 2010-05-20 07:11 EDT (History)
2 users (show)

See Also:
daniel_megert: review+
raksha.vasisht: review+


Attachments
fix (1.95 KB, patch)
2010-05-18 08:27 EDT, Deepak Azad CLA
no flags Details | Diff
reworked patch (2.34 KB, patch)
2010-05-18 10:32 EDT, Deepak Azad CLA
daniel_megert: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Beauchamp CLA 2010-05-07 10:43:04 EDT
Reproducible: Always

Steps to Reproduce:
* In the Java perspective, right click a Java project, goto Build Path > Link
Source...
* Select Variables...

Notice that none of the project path variables are listed (to see the project path variable list, see the property page "Resource / Linked Resources").

This is done by adding in 'AddSourceFolderWizardPage.java" line 171:

PathVariableSelectionDialog dialog = new PathVariableSelectionDialog(getShell(), variableTypes);
dialog.setResource(fParent);

Note that internally, the resolution of that Path (if done manually) must call IResource.getPathVariableManager() instead of IWorkspace.getPathVariableManager().
Comment 1 Dani Megert CLA 2010-05-11 11:49:51 EDT
Deepak, can you check how much work this would be and whether it makes sense that clients have to fill in/resolve that information?
Comment 2 Dani Megert CLA 2010-05-12 12:51:46 EDT
Deepak, if you don't see what's going on then please reassign to me.

Most likely we'll defer this to 3.7.
Comment 3 Deepak Azad CLA 2010-05-18 08:27:58 EDT
Created attachment 168907 [details]
fix

Fix as per Serge's suggestions.
Comment 4 Dani Megert CLA 2010-05-18 08:51:39 EDT
+1 for RC2.

To reduce code duplication I would assign
fNewElement.getJavaProject().getProject()
to a local variable (same code already used a few lines above).

Please attach a new patch and ask Raksha for review.

There's also a second reference to IPathVariableManager.resolvePath(IPath) but that code is no longer used (filed bug 313339 to remove this for 3.7).
Comment 5 Serge Beauchamp CLA 2010-05-18 08:56:16 EDT
That looks great. thanks
Comment 6 Deepak Azad CLA 2010-05-18 10:32:58 EDT
Created attachment 168938 [details]
reworked patch
Comment 7 Raksha Vasisht CLA 2010-05-19 05:00:26 EDT
Patch is good.
Comment 8 Deepak Azad CLA 2010-05-19 05:16:48 EDT
Patch released to HEAD.
Comment 9 Raksha Vasisht CLA 2010-05-19 05:18:12 EDT
Dani, I have a question : Why do we allow to create a new Variable using a Variable location recursively? I could do this operation 

* In the Java perspective, right click a Java project, goto Build Path > Link
Source...
* Select Variables... (Lets say you already have a variable 'x')
* Create a new variable using New... button
* Say 'y', use 'Variables...' to select location
* Remove... 'x', select some other variable location , OK 
 => In the old dialog , you can still see the removed variable in the list
That variable is never removed from the list even after you finish all the dialogs.

Should we allow 'New/Edit/Remove' operations recursively at all or should we only allow it once and then use another dialog to show only the list for selection?
Comment 10 Serge Beauchamp CLA 2010-05-19 05:20:45 EDT
(In reply to comment #9)
> Dani, I have a question : Why do we allow to create a new Variable using a
> Variable location recursively? I could do this operation 
> 
> * In the Java perspective, right click a Java project, goto Build Path > Link
> Source...
> * Select Variables... (Lets say you already have a variable 'x')
> * Create a new variable using New... button
> * Say 'y', use 'Variables...' to select location
> * Remove... 'x', select some other variable location , OK 
>  => In the old dialog , you can still see the removed variable in the list
> That variable is never removed from the list even after you finish all the
> dialogs.
> 
> Should we allow 'New/Edit/Remove' operations recursively at all or should we
> only allow it once and then use another dialog to show only the list for
> selection?

This dialog is a standard ui.ide dialog, not a JDT specific one, and there's an open bug tracking this issue: Bug 312084
Comment 11 Raksha Vasisht CLA 2010-05-19 06:20:09 EDT
(In reply to comment #10)
> (In reply to comment #9)
> This dialog is a standard ui.ide dialog, not a JDT specific one, and there's an
> open bug tracking this issue: Bug 312084

Okay, I have added my comment there. Thanks!
Comment 12 Dani Megert CLA 2010-05-20 07:11:29 EDT
Verified in N20100519-2000.