org.netbeans.modules.projectuiapi/1 1.51.1 8

org.netbeans.spi.project.ui.support
Class ProjectCustomizer

java.lang.Object
  extended by org.netbeans.spi.project.ui.support.ProjectCustomizer

public final class ProjectCustomizer
extends Object

Support for creating dialogs which can be used as project customizers. The dialog may display multiple panels or categories.

See Also:
CustomizerProvider, ProjectCustomizer.Category

Nested Class Summary
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.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCustomizerDialog

public 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. You don't need to call pack() method on the dialog. The resulting dialog will be non-modal.
Call show() on the dialog to make it visible. The dialog will be closed automatically after click on "OK" or "Cancel" button.

Parameters:
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.
Returns:
standard project customizer dialog.

createCustomizerDialog

public 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. 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.
Call 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.

Parameters:
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.
Returns:
standard project customizer dialog.
Since:
org.netbeans.modules.projectuiapi/1 1.26

createCustomizerDialog

public 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. 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.
Call show() on the dialog to make it visible. The dialog will be closed automatically after click on "OK" or "Cancel" button.

Parameters:
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 instances
context - the context for the panels, up to the project type what the context shall be, for example org.netbeans.api.project.Project instance
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.
Returns:
standard project customizer dialog.
Since:
org.netbeans.modules.projectuiapi/1 1.15

createCustomizerDialog

public 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. 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.
Call 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.

Parameters:
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 instances
context - the context for the panels, up to the project type what the context shall be, for example org.netbeans.api.project.Project instance
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.
Returns:
standard project customizer dialog.
Since:
org.netbeans.modules.projectuiapi/1 1.26

encodingRenderer

public static ListCellRenderer encodingRenderer()
Create a new cell renderer for lists or combo boxes whose model object type is Charset.

Returns:
A renderer
Since:
1.42

encodingModel

public 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. If the provided name is null or not a known character set, a dummy Charset instance will be used for the selection.

Parameters:
initialCharset - The initial character encoding, e.g. "UTF-8" or Charset.defaultCharset().name()
Returns:
A combo box model of all available character encodings
Since:
1.42

org.netbeans.modules.projectuiapi/1 1.51.1 8

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.