This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37292 - Property Ant Home does not have a specific editor
Summary: Property Ant Home does not have a specific editor
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: UI
: 41379 57088 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-18 11:04 UTC by vbrabant
Modified: 2005-11-28 18:51 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch to file editor to allow filtering of values that will trigger a call to setValue. I don't know if it will work. (1.63 KB, patch)
2003-11-18 16:00 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vbrabant 2003-11-18 11:04:11 UTC
The property Ant Home for Options | Building | Ant
Settings has not a specific editor that open the
file browser to be able to select the directory or
file where ant is located.

Would be friendler, and not so difficult because
it's not necessary to develop a new property editor.
Comment 1 Jesse Glick 2003-11-18 14:30:58 UTC
[IDE 200311130740]

The trouble is that it possibly *is* necessary to develop a new
property editor. I initially had it using the normal java.io.File
editor. However this turned out to be very, very bad - every time you
selected a directory in the chooser (to navigate into) the property
editor would send a change back to AntSettings, causing it to attempt
to reload the Ant installation from some bogus location, throwing a
bunch of exceptions internally that had to be caught one by one, and
causing poor performance.

So this is blocked by the need to have a way to ask the java.io.File
editor to not call setValue unless and until the user actually closes
the dialog.

Ideally would also permit AntSettings to reject the change (keeping
the dialog open) after the user presses OK, if the directory is found
to not be an Ant installation - though maybe a quick check can be done
for every new directory whether it simply has lib/ant.jar.
Comment 2 _ tboudreau 2003-11-18 15:57:51 UTC
Well, we could try something like the (untested) attachment: 
your Property can return a FileFilter from getValue("valueFilter").  SetValue 
on the property editor will never be called unless the filter accepts the result. 
Your accept() implementation will need to figure out if the selected directory 
represents a valid ant install or not. 
 
The problem is that the instant calls to setValue on selection changes are 
needed by wizards in order to enable/disable the Next/Finish buttons. 
 
A real API with a contract for how custom editors behave would solve much 
of this - as it is, the custom editor code works mainly by caching the old 
value and restoring it if the user clicks cancel.  
EnhancedCustomPropertyEditor would let you do this...and is deprecated 
(well, we could use something with a little more contract than that offers 
anyway). 
 
Comment 3 _ tboudreau 2003-11-18 16:00:12 UTC
Created attachment 12200 [details]
Patch to file editor to allow filtering of values that will trigger a call to setValue.   I don't know if it will work.
Comment 4 vbrabant 2003-12-05 10:40:43 UTC
If it's possible for the Working directory of External Execution, why
it's not possible for Ant Home dire ?

I am sorry, but I can't understand why !
Comment 5 Jesse Glick 2003-12-05 15:24:57 UTC
Vincent please check my comments of 2003-11-18. I *did* try to
implement  a property editor when first writing the property, and it
was very evil so I removed it. Could be fixed but probably requires
some tricks from property sheet and some work to implement, TBD.
Comment 6 vbrabant 2003-12-13 11:53:22 UTC
OK. Now I rereaded what you said, play with it, and finally
understanded the problem. 

So, I propose another approach: an intermediate dialog box.

I will try to summarize the idea here and attach a more detailled
document:

You transform that properties editor as a ListBox. By default the
listbox contains only the Ant home integrated with netbeans.

When the user click on the ...
He see a dialog box where the ant home integrated with netbeans is
displayed by default.
At the right, he can see the Add / Remove / Modify / Set Default Buttons.
If user clicks on Add, he has to give a name and select a directory.
When he click ok. You check if it's a validate Ant home directory.
When user click on Remove, you removed it of the list.
When user click on Modify, he can change the displayed name and/or the 
directory.
When user click on set default. It means that it's the default one
used for all IDE.

It will facilitate switch between Ant Installation because not
necessary to reintroduce a complete path.
Comment 7 Jesse Glick 2003-12-13 17:42:57 UTC
Sounds nice to me. Do you want to work on a patch for it? :-) Would
just require edits to AntSettings.java and AntSettingsBeanInfo.java, I
think, incl. adding some new classes for the GUI form etc.

You could also use the standard ServiceType architecture, but the UI
is not great there and it is not clear what the future of this design
pattern is w.r.t. the Registry API.

I might have time to work on this issue at some point but it is not a
high priority compared to other stuff I am working on. Definitely I
don't have time to do it for 3.6.
Comment 8 Jesse Glick 2004-03-30 13:39:29 UTC
*** Issue 41379 has been marked as a duplicate of this issue. ***
Comment 9 vbrabant 2004-08-11 22:17:47 UTC
Jesse, 
I know you asked me for a patch, but NetBeans API are too hermetics
for me.

Do you think you will have time for 4.0 ?
Personally, I think it would be nice to do it for 4.0 because in 4.0,
we have in Tools a Palette Manager, a Java Platform Manager, a Library
Manager. A Ant Manager, with possibilty to switch easily between them,
would be nice.
Comment 10 Jesse Glick 2004-08-11 22:38:07 UTC
Too late for 4.0; past feature freeze. Only bugs are being fixed now.
Comment 11 Jesse Glick 2005-03-29 16:26:02 UTC
*** Issue 57088 has been marked as a duplicate of this issue. ***
Comment 12 Jesse Glick 2005-11-28 18:51:20 UTC
Fixed w/ new Options dialog in 5.0.