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 52993 - Change the J2EE platform to provide an icon
Summary: Change the J2EE platform to provide an icon
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2005-01-05 14:50 UTC by Andrei Badea
Modified: 2005-01-12 14:37 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Diff with changes (2.96 KB, patch)
2005-01-05 14:52 UTC, Andrei Badea
Details | Diff
New Javadoc for J2eePlatform (26.80 KB, text/html)
2005-01-05 15:01 UTC, Andrei Badea
Details
New Javadoc for J2eePlatformImpl (28.10 KB, text/html)
2005-01-05 15:02 UTC, Andrei Badea
Details
Updated diff (4.76 KB, patch)
2005-01-06 13:21 UTC, Andrei Badea
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2005-01-05 14:50:39 UTC
The J2EE platform should also provide an icon.
This is useful for nodes which represent the
platform. For example a Libraries node will be
added to  projects allowing to browse the
libraries. For web and ejbjar projects this node
will also contain a child node representing the
J2EE platform.

This change implies adding a new getIcon() method
to J2eePlatformImpl. This method will be
implemented by server plugins and will usually
return the same icon that the plugin uses for
server instances (this is not mandatory). Another
getIcon() method will be added to J2eePlatform,
which will use J2eePlatformImpl.getIcon() to
obtain the icon from the plugin and return it or a
default icon if the icon from the plugin was null.
Comment 1 Andrei Badea 2005-01-05 14:52:18 UTC
Created attachment 19494 [details]
Diff with changes
Comment 2 Andrei Badea 2005-01-05 15:01:36 UTC
Created attachment 19495 [details]
New Javadoc for J2eePlatform
Comment 3 Andrei Badea 2005-01-05 15:02:09 UTC
Created attachment 19496 [details]
New Javadoc for J2eePlatformImpl
Comment 4 Jaroslav Tulach 2005-01-06 12:37:01 UTC
Missing @since tags in new methods that would refer to entry in
apichanges.xml

You could save one class and make the Image garbage collectable by
removing DefaultImageProvider and using

-        if (result == null) 
-            result = DefaultImageProvider.IMAGE;
+        if (result == null) 
+            result = Utilities.loadImage(".../ServerRegistry.gif");

speed shall stay comparable for a method that is called one over a
time or not at all (if the icon is correctly provided).
Comment 5 Andrei Badea 2005-01-06 13:21:42 UTC
Created attachment 19521 [details]
Updated diff
Comment 6 Andrei Badea 2005-01-06 13:28:25 UTC
I increased the specification version and added the @since tags, see
the updated diff.

Regarding the DefaultImageProvider inner class: I made the change you
suggested. In which circumstances do you think the idiom I used would
be appropriate?
Comment 7 Jaroslav Tulach 2005-01-06 15:08:36 UTC
Diff looks ok to me.

According to my knowledge of classloading. The solution with
innerclass is good for synchronization as it guarantees that the field
is going to be initialized just once. However it will not release the
field from memory while the module classloader is active. 

Both is solved by Utilities.loadImage. It is synchronized itself and
it maintains internal cache of images using SoftReferences (maybe with
some timeout). I think that the current code is simpler and not worse.
Comment 8 Andrei Badea 2005-01-06 16:48:07 UTC
Thank you for the explanation. Do I understand correctly that I'm now
allowed to commit?
Comment 9 Jaroslav Tulach 2005-01-06 17:43:20 UTC
According to the fasttrack described at 
http://openide.netbeans.org/tutorial/review-steps.html

the first step is to wait a week after begining of review and resolve
problems. the second step is to reassign to you saying that you are
going to integrate and wait 24h. the third is to integrate.

De jure - you should wait. De facto - I do not know if anybody else is
going to review your request, I have not seen too much comments on
j2eeserver in the past. So maybe you can shorten the first step a bit.
Comment 10 Andrei Badea 2005-01-11 12:23:02 UTC
I will commit the last attached diff tomorrow if there are no more
comments to this.
Comment 11 Andrei Badea 2005-01-12 14:37:21 UTC
Integrated.