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 47947

Summary: [40cat] Properly handle a project with no AntArtifactQueryImplementation
Product: guibuilder Reporter: Jesse Glick <jglick>
Component: CodeAssignee: Jan Stola <jstola>
Status: CLOSED FIXED    
Severity: blocker CC: shemnon
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41448    

Description Jesse Glick 2004-08-25 18:52:39 UTC
See issue #47807 for details. Need to somehow
report the condition to the user, or disable Add
to Palette... to begin with.
Comment 1 Jesse Glick 2004-08-25 18:54:32 UTC
BTW a bug in the way form module uses AntArtifact:

File outputFile = new File(
    + File.separator
    + artifacts[i].getArtifactLocation().getPath());

is not correct. artifactLocation may be an absolute URI. Anyway
constructing a File with '/' separators on Windows is also wrong. You
need to do (with some added error checking):

Comment 2 shemnon 2004-08-25 19:11:27 UTC
If Add to Pallette... is disabled then it would become lost
functionality from 3.6.  If too much more lost functionality occurs
people are going to bail on 4.0.

From my perspective the product feature is seriously affected, so it
should stay P2.
Comment 3 Jesse Glick 2004-08-25 19:26:02 UTC
You misunderstand this bug report - this is about politely handling
the case that a project does not supply a particular feature, not
about adding the feature to the project.

Again, you can use Tools -> Palette Manager to set up whatever you
like. The "Add to Palette" shortcut is available on some project
types, such as standard Java projects. Currently not on freeform
projects, since it would require an addition to the freeform
project.xml syntax as well as some logic in the freeform properties
dialog to update it, which we did not have time to do for 4.0 before
feature freeze.
Comment 4 shemnon 2004-08-25 20:47:14 UTC
If the official line will be "not supported in freeform for 4.0" then
it sohuld be consistant.  

From the Palette Manager "add from project" lists no available beans
from a selected freeform project, my supposition being that it is the
same reason Add to Palette... fails.  That may be a P4/P5 type bug
since it makes the wizard unprogressable rather than throwing up
exception dialogs or silently failing but I feel the user shouldn't be
lead on to beleieve that by some rain dance they could make it work if
only they shook it the right way.  

I would recommend either (1) disableing the next button when a
freeform project is seeclted on the first page, possibly with a red
highlight text right above the button bar line "Components cannot be
automatically imported from a FreeForm Project" or (2) a "stopper"
page after the select page explaining that components cannot be
imported from a freeform project and recommending that the user
instead import from a built jar.  A select component page that is
entirely empty but otherwise functional implies to me that I could do
something to the selected project so that later I could make the beans
show up.  In fact a "no beans found" stopper page may be better wether
or not it is a freeform project.

I am uncertian wether to open another bug for this or keep it under
this bug with a broader umbrella for "properly handle" no AAQ
Comment 5 Jesse Glick 2004-08-25 21:22:35 UTC
Use Add from JAR, not Add from Project, in the case of a freeform
project in 4.0. But yes, the import bean wizard should detect such
border cases early and deal with them better.
Comment 6 Jan Stola 2004-08-26 16:40:11 UTC
Fixed - both the Add to Palette action and Palette Manager
handle this situation more politely.
Comment 7 shemnon 2004-10-08 15:51:09 UTC
Well, it's hard to verify now since freeform now updates thw export 
element, and it seems to work for adding components to the swing 
pallette (as of dev build 200409291800).

Comment 8 Jesse Glick 2004-10-08 15:59:23 UTC
Well it's nice to hear it's hard to verify for that reason. :-) Should
be possible to verify by making a test freeform project and deleting
the <export> elements in project.xml.
Comment 9 Marek Grummich 2005-07-11 16:15:49 UTC