Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 221973 - Make WorkingDirectoryBlock from JDT a Debug API class
Summary: Make WorkingDirectoryBlock from JDT a Debug API class
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M5   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 221042
  Show dependency tree
 
Reported: 2008-03-08 22:28 EST by Remy Suen CLA
Modified: 2009-06-01 10:00 EDT (History)
2 users (show)

See Also:


Attachments
org.eclipse.debug.ui.WorkingDirectoryBlock public API patch v1 (47.50 KB, patch)
2008-07-31 22:23 EDT, Remy Suen CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2008-03-08 22:28:14 EST
The WorkingDirectoryBlock class provides a fundamental launching functionality of setting a working directory.

Plug-in developers that want to let their users set a working directory when they launch scripts or binaries or whatever have to copy/paste the code or write their own variant for use within their own launch configuration tabs. Please consider taking this class out of JDT and making it API.

See bug 214696 for more details.
Comment 1 Darin Wright CLA 2008-03-31 16:01:40 EDT
Too late for 3.4
Comment 2 Remy Suen CLA 2008-07-24 15:27:55 EDT
From my analysis of the code, the only internal references left are for SWTFactory and LauncherMessages. For the SWTFactory references, would the Debug team want those static methods to be copy/pasted into private static methods of WDB or have the implementation details copied into createControl(Composite) directly (I don't know why I prefer the latter, but anyway...)?

Thanks.
Comment 3 Darin Wright CLA 2008-07-28 16:55:40 EDT
(In reply to comment #2)
> From my analysis of the code, the only internal references left are for
> SWTFactory and LauncherMessages. For the SWTFactory references, would the Debug
> team want those static methods to be copy/pasted into private static methods of
> WDB or have the implementation details copied into createControl(Composite)
> directly (I don't know why I prefer the latter, but anyway...)?
> Thanks.

The messages can still refer to an internal class.

I would suggest to use private methods to avoid code duplication (well, at least duplication within the one class...)
Comment 4 Remy Suen CLA 2008-07-28 17:10:28 EDT
Should the WDB go into org.eclipse.debug.ui? No problems there I presume?
Comment 5 Darin Wright CLA 2008-07-28 17:13:36 EDT
(In reply to comment #4)
> Should the WDB go into org.eclipse.debug.ui? No problems there I presume?

Yes, it is no longer JDT specific.
Comment 6 Remy Suen CLA 2008-07-29 10:45:49 EDT
Darin, there is, what I like to call, a "half API leak" in JavaArgumentsTab.
http://help.eclipse.org/stable/nftopic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/debug/ui/launchConfigurations/JavaArgumentsTab.html#createWorkingDirBlock()

As JavaArgumentsTab (and AppletArgumentsTab) is not intended to be subclassed and the references to the internal class is a protected field and not publicly accessible, is there any action that needs to be taken?
Comment 7 Darin Wright CLA 2008-07-29 11:06:12 EDT
This should be safe. This is a protected field who's type will change. Howvever, since no-one can subclass this class, no-one should be able to reference the field, and there are no breaking API changes.
Comment 8 Remy Suen CLA 2008-07-31 22:23:51 EDT
Created attachment 108922 [details]
org.eclipse.debug.ui.WorkingDirectoryBlock public API patch v1
Comment 9 Darin Wright CLA 2009-01-24 16:52:43 EST
Applied patch.
Comment 10 Remy Suen CLA 2009-01-24 16:55:45 EST
(In reply to comment #9)
> Applied patch.

Darin, you filed a CQ, right?
Comment 11 Darin Wright CLA 2009-01-24 22:16:02 EST
I did not file a CQ I see 536 lines added and 516 lines removed, of which 296 lines were identical. So 536 - 296 = 240 new lines. I think this is really just a re-org of existing code rather than a new contribution. Do you agree? I can file a CQ if you think it needs one.
Comment 12 Remy Suen CLA 2009-01-24 22:22:46 EST
(In reply to comment #11)
> I did not file a CQ I see 536 lines added and 516 lines removed, of which 296
> lines were identical. So 536 - 296 = 240 new lines. I think this is really just
> a re-org of existing code rather than a new contribution. Do you agree?

True, I forgot that the LOC rule doesn't necessarily apply for such copy/paste contributions (as I recall a CQ was not filed for a similar patch of mine that Platform/UI committed in the past).

> I can file a CQ if you think it needs one.

Nah, it's cool. Thank you for exposing this as an API and sorry for the noise, Darin. :)
Comment 13 Darin Wright CLA 2009-05-15 09:44:38 EDT
Verified.
Comment 14 John Arthorne CLA 2009-06-01 10:00:06 EDT
Removing iplog+ from bug - this indicates an IP contribution in a comment
rather than a patch.

http://wiki.eclipse.org/Development_Resources/Automatic_IP_Log