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.
ClassCastException is thrown when I expand project file node in Filesystems tab of Explorer. Only projects which were opened when IDE started had a handle to expand them and also only these projects had small J on its icon, although all other my projects were java projects.
Created attachment 7604 [details] exc stack trace
java.lang.ClassCastException org.netbeans.modules.projects.ui.looks.SourcesLook$NS.<init>(SourcesLook.java:253) org.netbeans.modules.projects.ui.looks.SourcesLook.attachTo(SourcesLook.java:226) org.netbeans.spi.looks.ProxyLook$ProxySubstitute.looks(ProxyLook.java:1082) org.netbeans.spi.looks.ProxyLook$ProxySubstitute.access$000(ProxyLook.java:986) ...
Subcomponent changed to looks
The CCE shouldn't occure anymore (at least I can't reproduce it now and the code has been rewritten so it's hard to track what happend). However the second part of this report complaining about wrong icon displayed for closed projects node is still valid. The node for closed project should have the same icon as it has when project is open, it shouldn't ahve any children and it also should have different actions in popup menu (e.g. open vs. close action).
It seems that opening and parsing the project, creating PFS and scanning it for the looks just for the purpose of displaying the icon is an overkill. I suggest to define some simple tag in project file for this, e.g. as an attribute in ProjectDescriptor folder (next to the projectId, in future I can envision that somebody may want to add a user description of project -- a short text, etc.) This means a tiny b/w compatible extension of PFS and a note in documentation (I'm adding API keyword).
Yes, parsing the whole project file is overkil (e.g. by using XMLFileSystem), but perhaps some clever, simple, not validating SAXParser which would read data only from the <folder name="projectDescriptor"/> could be sufficiently fast. Anyway, the icon shouldn't be persisted in project file as it is not the user data. Moreover I am unclear even on how to persist the icon? Ideas?
huh, I did not mean to store the icon itself in project file. I mean that even if you read the project descriptor and you find the list of natures you then need to ask if they provide a look for the project node only to take the icon. I was proposing to create a simple tag that would identify something like "type" of project. There would be only one instance of it (unlike natures) and it would be easy to locate in project file. So a web project would be simply a web project, not java project -- although it has both natures in it. Each project type would have an icon associated with it (stored in IDE).
OK, let's see how fast/slow will be looking at the natures and asking looks for the ikon. If it will be slow we can try to create some special tag as you proposed.
As described in http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the current work on projects prototype has been stopped.
--> VERIFIED