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 82557 - Put wizard utils somewhere public
Summary: Put wizard utils somewhere public
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Dialogs&Wizards (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2006-08-12 00:05 UTC by Rochelle Raccah
Modified: 2008-12-22 13:45 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2006-08-12 00:05:58 UTC
There's some code in JavaTargetChooserPanel and related classes which:
1) checks for writable dirs and has an error if not
2) checks for existing files and has an error if so
3) copies code with this comment:helper methods copied from
project/ui/ProjectUtilities

The problem is, wizards which use the whole JavaTargetChooserPanel inherit these
checks.  Wizards which need to do something similar (say Entity from DB in
JavaEE support) need a slightly different panel, so need to implement these
checks on their own.  Most forget until bugs are filed, then they need to copy
the code and bundle messages or end up with an inconsistent user experience. 
And, of course, whenever there are changes, the copied code needs to be changed
as well.

Best would be to put these kind of common utility methods in a public api so
they can be used.
Comment 1 Jiri Rechtacek 2006-08-14 13:52:57 UTC
Please, describe the use-cases and some justification what methods should be
public and who will use these method. It's need to consider where should publish
them. Thanks
Comment 2 Rochelle Raccah 2006-08-18 01:26:05 UTC
The use case is any wizard which creates a set of files and therefore cannot use
JavaTargetChooserPanel directly.  Mostly those wizards create their own ui
including a PackageView (examples: entity from db, jsf from entity, etc).

For each of the 3 points:
1 & 2) Allow usage of a smaller component (than the whole
JavaTargetChooserPanel) which automatically update the wizard's valid status
with an error if an unwritable dir is chosen.  Alternatively, introduce another
kind of Panel like JavaTargetChooserPanel which allows the use of customized ui.
 Or, have some kind of wizard utils class which has methods similar to the
isValid and canUseFileName methods in JavaTargetChooserPanel.
For the case of existing file, there needs to be something like canUseFileName
because the target folder package is not sufficient to do the test
A similar check for a valid identifier would be the same case.

3) Here we see that the methods which would be useful canUseFileName and
existsFileName are already copied into JavaTargetChooserPanel from somewhere
else.  To me, that reinforces the idea that they should be shared from somewhere
else.
Comment 3 Jiri Rechtacek 2008-10-16 15:19:45 UTC
It's not planned for long time. It's fair to close as WONTFIX