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.
API for adding additional component into the Run customizer panel is needed. The component will be used for setting additional properties for given configuration. I propose following interface: package org.netbeans.modules.java.j2seproject.api; import org.netbeans.api.project.Project; public interface ConfigComponentProvider { /** * Provides component that is added to Run Customizer panel of j2seproject */ JComponent createComponent(Project p, ConfigChangedListener listener); /** * Is called when the config is changed (or created), * component is updated according to properties of the config */ void configUpdated(Map<String,String> props); /** * Callback listener for setting properties that are changed by changing * the component; null prop value means property will be removed from the * prop file */ interface ConfigChangedListener { void propertiesChanged(Map<String,String> updates); } } Implementation of the interface will be set through META-INF/services.
Created attachment 37781 [details] patch file
Please review attached diff with implementation. The API will be used by javawebstart module. Thanks.
minor nitpick. given that the impl gets registered in meta-inf services and it's just for the run panel in j2se customizer, I would expect a more specific name ConfigComponentProvider --> J2SERunConfigProvider
[JG01] "Implementation of the interface will be registered via META-INF/services/." - "should be", not "will be", I guess. Also should say that it should be registered to default lookup (e.g. META-INF/services). [JG02] s/ConfigChangedListener/ConfigChangeListener/g for consistency. [JG03] configUpdated leaves it unclear whether 'props' are evaluated properties (from PropertyEvaluator.getProperties()), or raw properties (of the shared kind?). [JG04; already mentioned in person, but repeating here for reference] propertiesChanged also fails to specify whether these should be evaluated or raw properties; and it unclear whether only shared properties can be set in this way, or private properties as well.
Milos: You are right the name should not be so general, I will change it. [JG01], [JG02]: Done [JG03]: props are not evaluated and it's all properties of given config (shared + private) [JG04]: props are not evaluated and only shared properties can be set this way. If JG03 and JG04 are considered OK I will update the javadoc and integrate.
JG03 & JG04 are OK if it is documented that way.
Done. Checking in ui/customizer/CustomizerRun.form; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerRun.form,v <-- CustomizerRun.form new revision: 1.14; previous revision: 1.13 done Checking in ui/customizer/CustomizerRun.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerRun.java,v <-- CustomizerRun.java new revision: 1.23; previous revision: 1.22 done RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SERunConfigProvider.java,v done Checking in api/J2SERunConfigProvider.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SERunConfigProvider.java,v <-- J2SERunConfigProvider.java initial revision: 1.1 done Checking in J2SERunConfigProvider.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SERunConfigProvider.java,v <-- J2SERunConfigProvider.java new revision: 1.2; previous revision: 1.1 done
Reopening to reassign.
.