I have a Node.Property for a file. How can I control the file chooser that is the custom editor?
A number of the built-in property editors in NetBeans can have their behavior controlled by passing "hints" to them. Hints are providing by calling setValue("something", someValue) on the Node.Property. For example, to suppress the custom editor button for a property, use
Node.Property<String> myProp = new MyStringProp();
myProp.setValue ("suppressCustomEditor", Boolean.TRUE);
The built-in property editors for files and arrays of files support a number of hints:
String Hint Name | Value Type | Effect |
---|---|---|
|
|
Sets the file filter used by the file chooser |
|
|
Set the file chooser to accept only directories. If combined with the "files" hint set to true (see below), will accept both directories and files. |
|
|
Set the file chooser to accept only files (unless combined with the "directories" hint set to true above - in which case simply not using either hint has the same effect |
|
|
The directory the file chooser should default to when it is first opened |
|
|
The base directory for the file property. This is needed only if the file has a relative path. Java files are just wrappers for a path name, and need not exist on disk. So if the file property is |
|
|
Value to call |
The built-in bean property editors in NetBeans are found in the package org.netbeans.beaninfo
editors in the module o.n.core
in NetBeans' sources.