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.
The Swing Application Framework support will need to access some information managed by java project and web start support. 1) Main class of the application The app framework support needs to know the main application class. It is a subclass of the framework's Application class which starts the application and is a central point for accessing resources, actions, etc. It could be found by scanning the project sources, but it would be much quicker to just ask for the main class of the project. Also in the theoretical case there are more Application subclasses found, the main class would point to the right one. 2) Web Start configuration - data going to the "information" element of the JNLP file. The app framework support will need to be able to copy some of the data to application resources on user request, so it is available to the application. (As I understand it, the jnlp file may not contain the data until a build is invoked, so will need to get it from the project properties.) There are several options how to implement these requests. Consider e.g. giving read access to all properties as a friend API, or you can create dedicated APIs for the two cases separately...
The API for accessing project properties is dangerous it will imply that the names and values of these properties will become an API.
I think that having friend API for accessing set of particular properties by their functionality (e.g. getJnlpAppTitle(), getMainClass() or similar) won't be that dangerous.
What would be then other possible ways of accessing project properties. Currently I use impl. dep. on j2seproject to be able to read some properties from javawebstart module. Some friend API with narrow PropertyEvaluator only with getProperty() method?
I think a simple friend API would be fine. E.g. add to j2seproject lookup an instance of /*friend-*/public interface J2SEProjectProperties { PropertyEvaluator evaluator(); }
Attaching patch for the friend API in java/j2seproject. The name of the interface J2SEProjectProperties could be probably changed not to confuse with o.n.m.java.j2seproject.ui.customizer.J2SEProjectProperties to something like J2SEPropertyEvaluator?
Created attachment 36795 [details] patch file
Friend users of the API will be javawebstart module and form module (Swing Appl Framework).
Attaching patch with API change and all related docs. I've changed the name of the interface to J2SEPropertyEvaluator.
Created attachment 37065 [details] patch file
Please review. Thanks.
Please use diff -u, which currently means not using the IDE to generate the diff. Javadoc implies that properties defined in configs are *not* included. Should not be too specific about where they are loaded from. No need to add a @see tag for the return type of a method, since it will already be linked to. I think apichanges is unnecessary for modules providing only friend APIs. You know what the friends are, so you are responsibility for updating them. But no harm to have one.
diff -u -N that is.
Created attachment 37377 [details] better diff file
Attached better diff (not from IDE), Jesse's comments fixed. If there are no more comments I will integrate the patch tomorrow.
please also include this module in nbbuild/build.propeties as one that offers friend API.
Done. RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SEPropertyEvaluator.java,v done Checking in src/org/netbeans/modules/java/j2seproject/api/J2SEPropertyEvaluator.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/api/J2SEPropertyEvaluator.java,v <-- J2SEPropertyEvaluator.java initial revision: 1.1 done Checking in nbproject/project.xml; /cvs/java/j2seproject/nbproject/project.xml,v <-- project.xml new revision: 1.39; previous revision: 1.38 done Checking in nbproject/project.properties; /cvs/java/j2seproject/nbproject/project.properties,v <-- project.properties new revision: 1.36; previous revision: 1.35 done Checking in arch.xml; /cvs/java/j2seproject/arch.xml,v <-- arch.xml new revision: 1.18; previous revision: 1.17 done Checking in manifest.mf; /cvs/java/j2seproject/manifest.mf,v <-- manifest.mf new revision: 1.8; previous revision: 1.7 done RCS file: /cvs/java/j2seproject/apichanges.xml,v done Checking in apichanges.xml; /cvs/java/j2seproject/apichanges.xml,v <-- apichanges.xml initial revision: 1.1 done Checking in src/org/netbeans/modules/java/j2seproject/J2SEProject.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProject.java,v <-- J2SEProject.java new revision: 1.72; previous revision: 1.71 done
Javadoc fixed afterwards: Checking in build.properties; /cvs/nbbuild/build.properties,v <-- build.properties new revision: 1.451; previous revision: 1.450 done
Relevant changes in ide/golden files: Checking in modules.txt; /cvs/ide/golden/modules.txt,v <-- modules.txt new revision: 1.104; previous revision: 1.103 done Checking in group-friend-packages.txt; /cvs/ide/golden/group-friend-packages.txt,v <-- group-friend-packages.txt new revision: 1.25; previous revision: 1.24 done Checking in deps.txt; /cvs/ide/golden/deps.txt,v <-- deps.txt new revision: 1.424; previous revision: 1.423 done Checking in friend-packages.txt; /cvs/ide/golden/friend-packages.txt,v <-- friend-packages.txt new revision: 1.85; previous revision: 1.84 done
Another related commit in modules that declare impl. dep. Checking in xtest/nbjunit/ide/nbproject/project.xml; /cvs/xtest/nbjunit/ide/nbproject/project.xml,v <-- project.xml new revision: 1.6; previous revision: 1.5 done Checking in ide/projectimport/jbuilder/nbproject/project.xml; /cvs/ide/projectimport/jbuilder/nbproject/project.xml,v <-- project.xml new revision: 1.9; previous revision: 1.8 done Checking in ide/projectimport/nbproject/project.xml; /cvs/ide/projectimport/nbproject/project.xml,v <-- project.xml new revision: 1.11; previous revision: 1.10 done Checking in xtest/module/nbproject/project.xml; /cvs/xtest/module/nbproject/project.xml,v <-- project.xml new revision: 1.7; previous revision: 1.6 done
Reopening to reassign.
.
One more related fix. Checking in ide/projectimport/jbuilder/manifest.mf; /cvs/ide/projectimport/jbuilder/manifest.mf,v <-- manifest.mf new revision: 1.7; previous revision: 1.6 done Checking in xtest/nbjunit/ide/manifest.mf; /cvs/xtest/nbjunit/ide/manifest.mf,v <-- manifest.mf new revision: 1.5; previous revision: 1.4 done Checking in ide/projectimport/nbproject/project.properties; /cvs/ide/projectimport/nbproject/project.properties,v <-- project.properties new revision: 1.16; previous revision: 1.15 done
Another related fix, this time in javadoc: Checking in nbbuild/javadoctools/properties.xml; /cvs/nbbuild/javadoctools/properties.xml,v <-- properties.xml new revision: 1.32; previous revision: 1.31 done Checking in nbbuild/javadoctools/replaces.xml; /cvs/nbbuild/javadoctools/replaces.xml,v <-- replaces.xml new revision: 1.33; previous revision: 1.32 done Checking in nbbuild/javadoctools/disallowed-links.xml; /cvs/nbbuild/javadoctools/disallowed-links.xml,v <-- disallowed-links.xml new revision: 1.9; previous revision: 1.8 done Checking in nbbuild/javadoctools/links.xml; /cvs/nbbuild/javadoctools/links.xml,v <-- links.xml new revision: 1.35; previous revision: 1.34 done Checking in java/j2seproject/arch.xml; /cvs/java/j2seproject/arch.xml,v <-- arch.xml new revision: 1.19; previous revision: 1.18 done