-
Notifications
You must be signed in to change notification settings - Fork 908
Add NetBeansProjects dir to Favorites tab #8798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- projects dir is now registered as favorite - fixed bug: when a custom project dir location is specified by setting 'netbeans.projects.dir', the dir is now automatically created, instead of falling back to the default dir, which gave the impression that the property isn't working
</folder> | ||
|
||
<folder name="Favorites"> | ||
<file name="NetBeansProjects.shadow"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: i couldn't figure out how to put the display name of "NetBeansProjects" into the bundle. It did change the name within the layer tree, but didn't change within the Favorites tab. I believe "Home" is also not localized unless I overlooked something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lines -
netbeans/platform/favorites/src/org/netbeans/modules/favorites/FavoritesNode.java
Line 499 in d10bf81
String name = ds.getName(); |
netbeans/platform/favorites/src/org/netbeans/modules/favorites/FavoritesNode.java
Line 515 in d10bf81
String name = ds.getName(); |
changed to
String name = super.getDisplayName();
should do this. Pros and cons, although matching the value of
DIR_NetBeansProjects=NetBeansProjects |
would be desirable for platform apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would have to check if renaming nodes still works, because favorites renames the virtual top level nodes instead of the files. Not sure what will happen when it uses the display name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, worth making sure. As it changes the name of the shadow (symlink) then hopefully. Forgot to check when playing with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and it would rename the virtual file without the display name.
the current Home
node registration is:
netbeans/platform/favorites/src/org/netbeans/modules/favorites/resources/layer.xml
Lines 24 to 31 in 3860d48
<folder name="Favorites"> | |
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.favorites.Bundle"/> | |
<file name="Home.shadow"> | |
<attr name="originalFile" methodvalue="org.netbeans.modules.favorites.FavoritesNode.getHome"/> | |
<attr name="originalFileSystem" stringvalue="org.netbeans.modules.masterfs.MasterFileSystem"/> | |
<attr name="position" intvalue="100"/> | |
</file> | |
</folder> |
renaming Home
using NB 27 works, but if we would render the display name (e.g HOME42
), it would no longer make the update visible and it will keep showing HOME42
.
Changing the impl might be a bit too risky for the scope of this PR - who knows what relied on this. I suppose platform applications could remove the item via their layer somehow?
I think this is a good change, and probably OK, as long as it's configurable for platform applications. Mixed feelings about whether Favorites nodes needs to support localization / branding first. And a somewhat tangential question - should we show Favorites rather than Services in the default window setup? |
Yep, as mentioned somewhere else I think we should open it by default in the same tab group as Projects/Files/Favorites. But its probably something to discuss first on the dev list first? Might be even good to open Favorites with the first file if we can figure out how to do that. |
netbeans.projects.dir
, the dir is now automatically created, instead of falling back to the default dir, which gave the impression that the property isn't working