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 103946 - Display structure view beneath layer files even under Source Packages
Summary: Display structure view beneath layer files even under Source Packages
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2007-05-14 22:46 UTC by Jesse Glick
Modified: 2007-12-03 16:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-05-14 22:46:36 UTC
Currently displayed only under Important Files.

Tricky because we may not be able to affect display of XML files in other places
except by wrapping all of Source Packages in a filter node hierarchy, which is a
bit undesirable due to the added memory requirements.
Comment 1 Jaroslav Tulach 2007-12-02 21:05:59 UTC
I have the patch ready. It needs changes in xml/core as well, as the xml module does not honor the contract defined by 
org.openide.loaders.XMLDataObject that allows to assign different node to each public ID.


Comment 2 Jaroslav Tulach 2007-12-02 22:06:59 UTC
#103946: Providing a node for layer.xml and modifying xml/core to honor the 'node delegate' contract defined by 
org.openide.loaders.XMLDataObject 

IDE:-------------------------------------------------
IDE: [2.12.07 23:06] Committing started
cvs server: scheduling file `openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectNodeTest.java' for 
addition
cvs server: scheduling file `xml/core/test/unit/src/org/netbeans/modules/xml/core/XMLDataObjectNodeTest.java' for 
addition
cvs server: use 'cvs commit' to add these files permanently
cvs server: scheduling file `layerObject32.gif' for addition
cvs server: scheduling file `layerObject.gif' for addition
cvs server: use 'cvs commit' to add these files permanently
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/layers/LayerNode.java;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/layers/LayerNode.java,v  
<--  LayerNode.java
new revision: 1.25; previous revision: 1.24
done
RCS 
file: /shared/data/ccvs/repository/xml/core/test/unit/src/org/netbeans/modules/xml/core/XMLDataObjectNodeTest.java,v
done
Checking in xml/core/test/unit/src/org/netbeans/modules/xml/core/XMLDataObjectNodeTest.java;
/shared/data/ccvs/repository/xml/core/test/unit/src/org/netbeans/modules/xml/core/XMLDataObjectNodeTest.java,v  <--  
XMLDataObjectNodeTest.java
initial revision: 1.1
done
RCS 
file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject.gif,v
done
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject.gif;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject.gif,v  
<--  layerObject.gif
initial revision: 1.1
done
RCS 
file: /shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject32.gif,v
done
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject32.gif;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layerObject32.gif,v  
<--  layerObject32.gif
initial revision: 1.1
done
Checking in apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml;
/shared/data/ccvs/repository/apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/layer.xml,v  
<--  layer.xml
new revision: 1.60; previous revision: 1.59
done
Checking in apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/ui/ModuleLogicalViewTest.java;
/shared/data/ccvs/repository/apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/ui/ModuleLogicalViewTest.java,v  
<--  ModuleLogicalViewTest.java
new revision: 1.18; previous revision: 1.17
done
Checking in xml/core/src/org/netbeans/modules/xml/core/XMLDataObject.java;
/shared/data/ccvs/repository/xml/core/src/org/netbeans/modules/xml/core/XMLDataObject.java,v  <--  XMLDataObject.java
new revision: 1.42; previous revision: 1.41
done
RCS file: /shared/data/ccvs/repository/openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectNodeTest.java,v
done
Checking in openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectNodeTest.java;
/shared/data/ccvs/repository/openide/loaders/test/unit/src/org/openide/loaders/XMLDataObjectNodeTest.java,v  <--  
XMLDataObjectNodeTest.java
initial revision: 1.1
done
IDE: [2.12.07 23:06] Committing finished
Comment 3 Jesse Glick 2007-12-03 15:38:11 UTC
Is there any particular reason why we could not simply define a MIME resolver for e.g. "text/x-netbeans-layer+xml"
according to the DTD and make a trivial DataObject type for layers? This is, after all, what we recommend, do in all
other circumstances that I am aware of, and even provide a template for in apisupport! I don't follow why we are using
this strange old trick with the DataNode cookie, which seems like a relict from an otherwise unused set of
XMLDataObject-related APIs. I would suggest that we deprecate Environment.Provider, not try to find new uses for it.
Comment 4 Jaroslav Tulach 2007-12-03 15:51:33 UTC
I do not think you can deprecate it. Lookup at xml/lookups and it seems to be used pretty much.

Re. apisupport template - I was just thinking why we do not support Env.Prov based node in our wizards today. It is 
established and well working API (except the problem with xml/core which ignored it in 6.0) and is generally more 
efficient than introducing new loader.

However if you do not like my changes in apisupport, feel free to revert them. Just keep the test in openide/loaders 
and code in xml/core, imho.
Comment 5 Jesse Glick 2007-12-03 16:22:08 UTC
According to

http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/build/generated/layers.txt

except for the usage you just introduced, all usages of xml/lookups seem to be for settings registration (in our old
pre-Preferences style), not for user-level files. All other user files that I know of have a proper MIME type and a loader.

Definitely we should not add a wizard to generate code using a technique no one uses for that purpose, when there is
already a wizard that uses the normal technique, and the normal technique is more powerful (since arbitrary MIME
resolution algorithms beyond lookup by DTD are possible). This would be very confusing.

A new loader adds a bit of overhead today. pnejedly claims this will be fixed soon.

Of course the feature of the recognition of layer files is appreciated, no matter how it is implemented. I would not
want to revert it. If I have time to change it to use the normal style I probably will.