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.

Bug 93299 - API for adding a component to Run customizer panel
Summary: API for adding a component to Run customizer panel
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2007-01-26 12:41 UTC by Milan Kubec
Modified: 2007-02-07 10:36 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
patch file (12.37 KB, patch)
2007-01-29 15:31 UTC, Milan Kubec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Kubec 2007-01-26 12:41:33 UTC
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.
Comment 1 Milan Kubec 2007-01-29 15:31:39 UTC
Created attachment 37781 [details]
patch file
Comment 2 Milan Kubec 2007-01-29 15:34:37 UTC
Please review attached diff with implementation. The API will be used by
javawebstart module. Thanks.
Comment 3 Milos Kleint 2007-01-31 09:42:42 UTC
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

Comment 4 Jesse Glick 2007-02-01 18:07:27 UTC
[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.
Comment 5 Milan Kubec 2007-02-05 14:43:35 UTC
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.
Comment 6 Jesse Glick 2007-02-05 17:39:46 UTC
JG03 & JG04 are OK if it is documented that way.
Comment 7 Milan Kubec 2007-02-07 10:34:10 UTC
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
Comment 8 Milan Kubec 2007-02-07 10:35:04 UTC
Reopening to reassign.
Comment 9 Milan Kubec 2007-02-07 10:36:35 UTC
.