? 74373.patch
Index: src/org/netbeans/spi/project/ui/support/ProjectCustomizer.java
===================================================================
RCS file: /cvs/projects/projectuiapi/src/org/netbeans/spi/project/ui/support/ProjectCustomizer.java,v
retrieving revision 1.6
diff -c -r1.6 ProjectCustomizer.java
*** src/org/netbeans/spi/project/ui/support/ProjectCustomizer.java 5 Dec 2005 20:10:33 -0000 1.6
--- src/org/netbeans/spi/project/ui/support/ProjectCustomizer.java 5 Apr 2006 13:04:58 -0000
***************
*** 27,32 ****
--- 27,33 ----
import org.netbeans.modules.project.uiapi.Utilities;
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
import org.openide.util.HelpCtx;
+ import org.openide.util.Lookup;
/** Support for creating dialogs which can be used as project
* customizers. The dialog may display multiple panels or categories.
***************
*** 76,81 ****
--- 77,114 ----
Dialog dialog = CustomizerDialog.createDialog( okOptionListener, innerPane, helpCtx, categories );
return dialog;
}
+
+ /**
+ * Creates standard customizer dialog that can be used for implementation of
+ * {@link org.netbeans.spi.project.ui.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. 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.
+ * @param folderPath the path in the System Filesystem that is used as root for panel composition.
+ * The content of the folder is assummed to be {@link org.netbeans.spi.project.ui.support.ProjectCustomizer.CompositeCategoryProvider} instances
+ * @param context the context for the panels, up to the project type what the context shall be, for example org.netbeans.api.project.Project instance
+ * @param 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.
+ * @param okOptionListener listener which will be notified when the user presses
+ * the OK button.
+ * @param helpCtx Help context for the dialog, which will be used when the
+ * panels in the customizer do not specify their own help context.
+ * @return standard project customizer dialog.
+ */
+ public static Dialog createCustomizerDialog( String folderPath,
+ Lookup context,
+ String preselectedCategory,
+ ActionListener okOptionListener,
+ HelpCtx helpCtx) {
+ throw new IllegalStateException("Not implemented yet");
+ }
/** Creates standard innerPane for customizer dialog.
*/
***************
*** 123,128 ****
--- 156,179 ----
*/
JComponent create( Category category );
+ }
+
+ /**
+ * Interface for creation of Customizer categories and their respective UI panels.
+ * Implementations are to be registered in System FileSystem via module layers. Used by the
+ * {@link org.netbeans.spi.project.ui.support.ProjectCustomizer#createCustomizerDialog(String,Lookup,String,ActionListener,HelpCtx)}
+ */
+ public static interface CompositeCategoryProvider {
+
+ /**
+ * create the Category instance for the given project customizer context.
+ */
+ Category createCategory( Lookup context );
+
+ /**
+ * create the UI component for given category and context.
+ */
+ JComponent createComponent (Category category, Lookup context );
}
/** Describes category of properties to be customized by given component