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 89457 - Read-access to some project properties for app framework
Summary: Read-access to some project properties for app framework
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milan Kubec
Depends on:
Blocks: 91997
  Show dependency tree
Reported: 2006-11-16 13:42 UTC by Tomas Pavek
Modified: 2007-01-19 14:28 UTC (History)
2 users (show)

See Also:
Exception Reporter:

patch file (3.74 KB, text/plain)
2006-12-19 12:09 UTC, Milan Kubec
patch file (14.15 KB, patch)
2007-01-05 10:19 UTC, Milan Kubec
Details | Diff
better diff file (13.54 KB, text/plain)
2007-01-15 14:34 UTC, Milan Kubec

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2006-11-16 13:42:02 UTC
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...
Comment 1 Tomas Zezula 2006-11-23 14:21:49 UTC
The API for accessing project properties is dangerous it will imply that the
names and values of these properties will become an API.
Comment 2 Milan Kubec 2006-11-23 14:43:41 UTC
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.
Comment 3 Milan Kubec 2006-12-14 14:42:21 UTC
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?
Comment 4 Jesse Glick 2006-12-19 00:25:20 UTC
I think a simple friend API would be fine. E.g. add to j2seproject lookup an
instance of

/*friend-*/public interface J2SEProjectProperties {
  PropertyEvaluator evaluator();
Comment 5 Milan Kubec 2006-12-19 12:05:18 UTC
Attaching patch for the friend API in java/j2seproject.
The name of the interface J2SEProjectProperties could be probably changed not to
confuse with to
something like J2SEPropertyEvaluator?
Comment 6 Milan Kubec 2006-12-19 12:09:04 UTC
Created attachment 36795 [details]
patch file
Comment 7 Milan Kubec 2006-12-19 12:23:32 UTC
Friend users of the API will be javawebstart module and form module (Swing Appl
Comment 8 Milan Kubec 2007-01-05 10:17:12 UTC
Attaching patch with API change and all related docs. I've changed the name of
the interface to J2SEPropertyEvaluator.
Comment 9 Milan Kubec 2007-01-05 10:19:13 UTC
Created attachment 37065 [details]
patch file
Comment 10 Milan Kubec 2007-01-05 17:51:57 UTC
Please review. Thanks.
Comment 11 Jesse Glick 2007-01-05 23:26:19 UTC
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.
Comment 12 Jesse Glick 2007-01-05 23:38:09 UTC
diff -u -N that is.
Comment 13 Milan Kubec 2007-01-15 14:34:23 UTC
Created attachment 37377 [details]
better diff file
Comment 14 Milan Kubec 2007-01-15 14:37:10 UTC
Attached better diff (not from IDE), Jesse's comments fixed. If there are no
more comments I will integrate the patch tomorrow.
Comment 15 Jaroslav Tulach 2007-01-15 15:59:24 UTC
please also include this module in nbbuild/build.propeties as one that offers 
friend API.
Comment 16 Milan Kubec 2007-01-16 14:28:03 UTC

RCS file:
Checking in
initial revision: 1.1
Checking in nbproject/project.xml;
/cvs/java/j2seproject/nbproject/project.xml,v  <--  project.xml
new revision: 1.39; previous revision: 1.38
Checking in nbproject/;
/cvs/java/j2seproject/nbproject/,v  <--
new revision: 1.36; previous revision: 1.35
Checking in arch.xml;
/cvs/java/j2seproject/arch.xml,v  <--  arch.xml
new revision: 1.18; previous revision: 1.17
Checking in;
/cvs/java/j2seproject/,v  <--
new revision: 1.8; previous revision: 1.7
RCS file: /cvs/java/j2seproject/apichanges.xml,v
Checking in apichanges.xml;
/cvs/java/j2seproject/apichanges.xml,v  <--  apichanges.xml
initial revision: 1.1
Checking in src/org/netbeans/modules/java/j2seproject/;
new revision: 1.72; previous revision: 1.71
Comment 17 Milan Kubec 2007-01-16 14:30:38 UTC
Javadoc fixed afterwards:
Checking in;
/cvs/nbbuild/,v  <--
new revision: 1.451; previous revision: 1.450
Comment 18 Milan Kubec 2007-01-16 16:41:46 UTC
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
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
Checking in deps.txt;
/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.424; previous revision: 1.423
Checking in friend-packages.txt;
/cvs/ide/golden/friend-packages.txt,v  <--  friend-packages.txt
new revision: 1.85; previous revision: 1.84
Comment 19 Milan Kubec 2007-01-17 09:08:31 UTC
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
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
Checking in ide/projectimport/nbproject/project.xml;
/cvs/ide/projectimport/nbproject/project.xml,v  <--  project.xml
new revision: 1.11; previous revision: 1.10
Checking in xtest/module/nbproject/project.xml;
/cvs/xtest/module/nbproject/project.xml,v  <--  project.xml
new revision: 1.7; previous revision: 1.6
Comment 20 Milan Kubec 2007-01-17 11:12:05 UTC
Reopening to reassign.
Comment 21 Milan Kubec 2007-01-17 11:13:04 UTC
Comment 22 Milan Kubec 2007-01-18 14:36:48 UTC
One more related fix.

Checking in ide/projectimport/jbuilder/;
/cvs/ide/projectimport/jbuilder/,v  <--
new revision: 1.7; previous revision: 1.6
Checking in xtest/nbjunit/ide/;
/cvs/xtest/nbjunit/ide/,v  <--
new revision: 1.5; previous revision: 1.4
Checking in ide/projectimport/nbproject/;
/cvs/ide/projectimport/nbproject/,v  <--
new revision: 1.16; previous revision: 1.15
Comment 23 Milan Kubec 2007-01-19 14:28:05 UTC
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
Checking in nbbuild/javadoctools/replaces.xml;
/cvs/nbbuild/javadoctools/replaces.xml,v  <--  replaces.xml
new revision: 1.33; previous revision: 1.32
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
Checking in nbbuild/javadoctools/links.xml;
/cvs/nbbuild/javadoctools/links.xml,v  <--  links.xml
new revision: 1.35; previous revision: 1.34
Checking in java/j2seproject/arch.xml;
/cvs/java/j2seproject/arch.xml,v  <--  arch.xml
new revision: 1.19; previous revision: 1.18