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.
Suggest to change the display name of filesystem root nodes to only display the last folder (as opposed to the full path), to minimize the horizontal width of the explorer window. Specifically on windows, the width of the by default mounted filesystem, residing typically in "C:\Documents and Settings\username\.netbeans\version\sampledir" makes the explorer unnecessarily show horizontal scrollbar and as a sideeffect weird behavior when expanding nodes. The full path of the filesystem is not an information that the user needs to see all the time.
I don't think its good idea to shorten display name of filesystems for last folder name: 1/ For NB source code that means that almost all filesystems in Repository will be presented as "src". 2/ I can do it just for filesystems in org.openide.filesystems. MountNode.CapNode.getDisplayName() shorten for fixed length ?
Indeed, there are always cases where this would not work. Ultimately, the question is if we are doing the IDE for ourselves (and thus it matters most if mounting of NetBeans sources works ideally) or doing IDE for Java developers, where most of theme would not hit this issue. Can there be some solution that would work for both? Perhaps show last two folders? Or have an advanced option hidden somewhere whether to show the entire path in the filesystem name, that people mounting large number of filesystems ending with the same folder name (very small percentage of target userbase I would say) would use? Doing it only for filesystems in org.openide.filesystem works, this is what this issue is about here. Separate issue should be filed for other filesystems as needed.
3/ What about last folder: my_very_long_last_folder_for_testing_purposes.... Suggestion: use fixed size name (maybe 30 last chars) preceding with .. (e.g. ..rg\netbeans\api\registry\src) and not implement in FileSystem subclass but rahter in Node or Look (its method getDisplayName)responsible for presentation.
Why not, when mounting a filesystem, calculate the display name it would have - the last directory name. Then compare it with the names of other mounted filesystems. If it matches one, prepend the next level directory name and try again, looping until you have a unique name (I guess you have to solve the case of the same thing mounted twice also?) If I know our build system guys, it wouldn't be surprising at all if new projects in NetBeans very soon start being in directories called "src/", in which case it would be a problem not just for us anymore.
I don't like Tim's method of shortening because it seems to me unnecessarily over complicated, time consuming and strange looking (not descriptive enough - src, registry/src, api/registry/src). Moreover FS implementations shouldn't care about horizontal scrollbars in explorer at all or should be documented that displayName can't exceed defined lenght. Anyway I think it should be shortened in RootFolderNode (or its filter MountNode.CapNode) at one central place? Else it will be copy-pasted into every FS impl. I'm ready to fix it according to suggestion in my last comment. But I would like to know if there is agreement about it ?
I'd be for trying it out - I think this is something we'll need to see and play with.
Created attachment 12602 [details] simple patch for trying out
This patch doesn't care about localization of DISPLAY_NAME_PREFIX but it could be good enough for testing.
There is no response. Shall I fix it according to patch ?
As I said before, I'd be for trying it out - I think this is something we'll need to see and play with. So let's try it - plenty of time to roll it back if it really doesn't work well.
OK. Will be fixed, but probably now is too late for release 3.6 cause its after UI freeze and therfore version will be changed to promo-D. I think its more RFE than defect.
IMHO we can leave it as is since this UI will rarely if ever be shown in D - might be a special way to turn on the All Files tab but not normally in the Window menu.