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.
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.
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
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.
It's not planned for long time. It's fair to close as WONTFIX