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.
Both the size and last modified properties are fundamental in platform applications in concern with exploring filesystems. FileObject has two methods getSize() and lastModified() so the values are ready at hand, but are currently not being shown in the DataNode's propertySheet. Could we please add these properties.
Created attachment 7151 [details] Code patch to implement additional properties
The patch as attached has a number of problems, but the idea seems reasonable to me, and would be trivial to implement. The question is more whether these attributes are useful enough for most users that they deserve a space in the property sheet for every file - possibly consuming space and introducing scrollbars making it harder to see more important properties, or being visually distracting. Possibly the answer depends on usage in an IDE vs. another type of application. Maybe could be on another tab? Suggest it go to nbui. Note: the Template property is on every file in the main property sheet, which seems dumb; only actually needed on nodes under Templates in the Options window!
Changed owner David S. -> David K.
Jano, what HIE think about this? Reassign back to me.
The idea of showing the attributes is good. I think it might be useful in some situations. The only problem I see here is the well know 1:n DataObject:FileObject mapping. What should we show for bundle nodes, form nodes, class (java+class) nodes?
For multiple file mappings: the combined size, and the latest last modified date, would be ideal. But it would be fine simply to only include these properties for DataNodes that are only mapped to one file.
IMHO only the primary file need be shown. For *.class files, no one cares what the size + last modified is, and for *.form files, oh well. Those are the only common use cases. I would be happy to make a fresh patch if there is any interest.
Yes, there is definite interest here. We would like to even extend the use of the date/size property as a method to base sorting of files in the Explorer.
Have patch.
1.102 core/www/plans/plan.xml 1.7 openide/loaders/manifest.mf 1.3 openide/loaders/api/apichanges.xml 1.5 openide/loaders/src/org/openide/loaders/Bundle.properties 1.11 openide/loaders/src/org/openide/loaders/DataFolder.java 1.5 openide/loaders/src/org/openide/loaders/DataNode.java 1.4 openide/loaders/src/org/openide/loaders/FolderComparator.java 1.5 openide/loaders/src/org/openide/loaders/FolderList.java 1.3 openide/loaders/src/org/openide/loaders/SortModeEditor.java
Details: 1. Adds a prop "All Files" listing the files in the object (usually just one, except for compiled Java sources etc.), usually by absolute path name. 2. Adds a prop "File Size" (in bytes). 3. Adds a prop "Modification Time" (date and day). 4. Suppresses the prop "Template" except for files actually in the "Templates" folder in Options. 5. Adds folder sorting modes "By Modification Time" (newer to older, but folders still first and alphabetical) and "By File Size" (bigger to smaller, again only for files). 6. These new sorting modes are dynamic - e.g. if you append a bunch of stuff to a file and save it, it may be moved up in the list.
cool feature. Verified in 20030920200
I notice you're using StringArrayEditor for the "all files" editor. It might be nicer to use another editor - specifically, if you provide an array of files, I could make the custom editor for read only files able to display the last modified date, etc. along with the file names in a table. Since at least for the C/C++ IDE's, some users in a usability study didn't believe their code had really been compiled, this would allow some way of verifying the up-to-dateness of, for example, a compiled file hidden by a DataObject.
Re. File[] - won't work in general; entries might not be files on disk. Re. displaying modification time for secondary files, e.g. *.class: IMHO this is obscure enough that it does not merit a GUI in the IDE. If you feel so uncomfortable that you are compelled to double-check that a compilation worked, (1) the compilation GUI is poor and should be fixed some other way, (2) you can always display such information in a native file browser. The last-mod of the primary file, conversely, could be useful on a day-to-day basis, since it says when the file was last edited. Use nbui if you disagree of course.
Adding note to What's New section of relnotes. Removing RELNOTE keyword since this won't need to be tracked afterwards
This issue had *3 votes* before move to platform component