public final class ProjectCustomizer extends Object
CustomizerProvider
,
ProjectCustomizer.Category
Modifier and Type | Class and Description |
---|---|
static class |
ProjectCustomizer.Category
Describes category of properties to be customized by given component
|
static interface |
ProjectCustomizer.CategoryComponentProvider
Provides components for categories.
|
static interface |
ProjectCustomizer.CompositeCategoryProvider
Interface for creation of Customizer categories and their respective UI panels.
|
Modifier and Type | Method and Description |
---|---|
static Dialog |
createCustomizerDialog(ProjectCustomizer.Category[] categories,
ProjectCustomizer.CategoryComponentProvider componentProvider,
String preselectedCategory,
ActionListener okOptionListener,
ActionListener storeListener,
HelpCtx helpCtx)
Creates standard customizer dialog which can be used for implementation
of
CustomizerProvider . |
static Dialog |
createCustomizerDialog(ProjectCustomizer.Category[] categories,
ProjectCustomizer.CategoryComponentProvider componentProvider,
String preselectedCategory,
ActionListener okOptionListener,
HelpCtx helpCtx)
Creates standard customizer dialog which can be used for implementation
of
CustomizerProvider . |
static Dialog |
createCustomizerDialog(String folderPath,
Lookup context,
String preselectedCategory,
ActionListener okOptionListener,
ActionListener storeListener,
HelpCtx helpCtx)
Creates standard customizer dialog that can be used for implementation of
CustomizerProvider based on content of a folder in Layers. |
static Dialog |
createCustomizerDialog(String folderPath,
Lookup context,
String preselectedCategory,
ActionListener okOptionListener,
HelpCtx helpCtx)
Creates standard customizer dialog that can be used for implementation of
CustomizerProvider based on content of a folder in Layers. |
static ComboBoxModel |
encodingModel(String initialCharset)
Create a new combo box model of all available Charsets
whose initial selection is a Charset with the provided name.
|
static ListCellRenderer |
encodingRenderer()
Create a new cell renderer for lists or combo boxes whose model
object type is Charset.
|
public static Dialog createCustomizerDialog(ProjectCustomizer.Category[] categories, ProjectCustomizer.CategoryComponentProvider componentProvider, String preselectedCategory, @NonNull ActionListener okOptionListener, HelpCtx helpCtx)
CustomizerProvider
. You don't need
to call pack()
method on the dialog. The resulting dialog will
be non-modal. show()
on the dialog to make it visible. The dialog
will be closed automatically after click on "OK" or "Cancel" button.categories
- nonempty array of descriptions of categories to be shown in the
dialog. Note that categories have the valid
property. If any of the given categories is not valid cusomizer's
OK button will be disabled until all categories become valid
again.componentProvider
- creator of GUI components for categories in the
customizer dialog.preselectedCategory
- name of one of the supplied categories or null.
Category with given name will be selected. If null
or if the category of given name does not exist the first category will
be selected.okOptionListener
- listener which will be notified when the user presses
the OK button.helpCtx
- Help context for the dialog, which will be used when the
panels in the customizer do not specify their own help context.public static Dialog createCustomizerDialog(ProjectCustomizer.Category[] categories, ProjectCustomizer.CategoryComponentProvider componentProvider, String preselectedCategory, @NonNull ActionListener okOptionListener, @NullAllowed ActionListener storeListener, HelpCtx helpCtx)
CustomizerProvider
. Use this version if you need
to run processing of the customizer data partially off AWT Event Queue. You don't need
to call pack()
method on the dialog. The resulting dialog will
be non-modal. show()
on the dialog to make it visible. If you want the dialog to be
closed after user presses the "OK" button you have to call hide() and dispose() on it.
(Usually in the actionPerformed(...)
method of the listener
you provided as a parameter. In case of the click on the "Cancel" button
the dialog will be closed automatically.categories
- nonempty array of descriptions of categories to be shown in the
dialog. Note that categories have the valid
property. If any of the given categories is not valid cusomizer's
OK button will be disabled until all categories become valid
again.componentProvider
- creator of GUI components for categories in the
customizer dialog.preselectedCategory
- name of one of the supplied categories or null.
Category with given name will be selected. If null
or if the category of given name does not exist the first category will
be selected.okOptionListener
- listener which will be notified when the user presses
the OK button.storeListener
- listener which will be notified when the user presses OK button.
Listener will be executed after okOptionListener outside of AWT EventQueue.
Usually to be used to save modified files on disk.helpCtx
- Help context for the dialog, which will be used when the
panels in the customizer do not specify their own help context.public static Dialog createCustomizerDialog(String folderPath, Lookup context, String preselectedCategory, @NonNull ActionListener okOptionListener, HelpCtx helpCtx)
CustomizerProvider
based on content of a folder in Layers.
Use this method when you want to allow composition and 3rd party additions to your customizer UI.
You don't need to call pack()
method on the dialog. The resulting dialog will
be non-modal. show()
on the dialog to make it visible. The dialog
will be closed automatically after click on "OK" or "Cancel" button.folderPath
- the path in the System Filesystem that is used as root for panel composition.
The content of the folder is assummed to be ProjectCustomizer.CompositeCategoryProvider
instancescontext
- the context for the panels, up to the project type what the context shall be, for example org.netbeans.api.project.Project instancepreselectedCategory
- name of one of the supplied categories or null.
Category with given name will be selected. If null
or if the category of given name does not exist the first category will
be selected.okOptionListener
- listener which will be notified when the user presses
the OK button.helpCtx
- Help context for the dialog, which will be used when the
panels in the customizer do not specify their own help context.public static Dialog createCustomizerDialog(String folderPath, Lookup context, String preselectedCategory, @NonNull ActionListener okOptionListener, @NullAllowed ActionListener storeListener, HelpCtx helpCtx)
CustomizerProvider
based on content of a folder in Layers.
Use this method when you want to allow composition and 3rd party additions to your customizer UI.
This version runs processing of the customizer data partially off AWT Event Queue.
You don't need to call pack()
method on the dialog. The resulting dialog will
be non-modal. show()
on the dialog to make it visible. If you want the dialog to be
closed after user presses the "OK" button you have to call hide() and dispose() on it.
(Usually in the actionPerformed(...)
method of the listener
you provided as a parameter. In case of the click on the "Cancel" button
the dialog will be closed automatically.folderPath
- the path in the System Filesystem that is used as root for panel composition.
The content of the folder is assummed to be ProjectCustomizer.CompositeCategoryProvider
instancescontext
- the context for the panels, up to the project type what the context shall be, for example org.netbeans.api.project.Project instancepreselectedCategory
- name of one of the supplied categories or null.
Category with given name will be selected. If null
or if the category of given name does not exist the first category will
be selected.okOptionListener
- listener which will be notified when the user presses
the OK button.storeListener
- listener which will be notified when the user presses OK button.
Listener will be executed after okOptionListener outside of AWT EventQueue.
Usually to be used to save modified files on diskhelpCtx
- Help context for the dialog, which will be used when the
panels in the customizer do not specify their own help context.public static ListCellRenderer encodingRenderer()
public static ComboBoxModel encodingModel(String initialCharset)
initialCharset
- The initial character encoding, e.g. "UTF-8" or
Charset.defaultCharset().name()