Add open containing folder and open in tab actions.#7081
Add open containing folder and open in tab actions.#7081mbien wants to merge 1 commit intoapache:masterfrom
Conversation
03eaec4 to
0a0839e
Compare
|
removed milestone |
0a0839e to
0b2a4e5
Compare
|
As the title says "open containing folder" this is my suggestion to add it like this. |
|
I originally had this in mind but I am still trying to find a place for another action: "Open Folder in NetBeans" To deconflict this we would have to call it "Open Containing Folder in System" which is quite long. So I picked "Open Parent in System" which is concise and still manages to describe exactly what it does. The other option is to use sub-menus, the problem there is that this would be 3 layers in some situations, which I would like to avoid if possible. |
|
Open Folder in NetBeans could also called "Open Folder as Project" or smth like that. It has a different context, but I'm fine with it then. |
|
Open Folder in NetBeans (which can also open jars, who knows what else it can open) would not be the same as open project |
|
I know I already implemented this as a 3rd party plugin, but to make it clear I call it "Open Folder as Project". Because it will be shown in the project tabs. It has not all functions that a project has, but this makes it more clear IMHO. I know via CLI you can open Folder in NetBeans, which will open a folder within a new TopComponent. Is this what you mean and want to do? Anyway, it is out of scope for this ticket and we can discuss the other stuff in another PR or via discussion. At the end, I'm fine with it, the wording in some cases in NetBeans is in my opinion not often as clear as I already told it but it is better than nothing. |
0b2a4e5 to
0390b02
Compare
|
refreshed this PR as POC. Its now 4 actions. This is too much for the context menus atm (esp for the project menu), so we would have to identify items which belong together and move them around a bit if we want to expand the functionality. |
|
rebasing to get a devbuild since i forgot how this worked edit: added screenshot |
0390b02 to
6ae0061
Compare
|
I can see some benefit to rationalizing here, but the code as-is wouldn't allow replacement of the existing macOS Show in Finder action. That needs I'm not sure what the object of the Open in Tabs action is? I have a feeling it might be better implemented in a different way, but I'm trying to understand the workflow where you want to use this? |
I don't really know what the special case is. OSes maintain a set of default applications for file types and paths. Opening a path on cinnamon will open it with nemo (which is a fork of nautilus), on windows it will open the file explorer - I assumed it would open the finder on mac? (my last mac was a while ago, I don't remember those details anymore) The main difference is in the open vs browse action, e.g should html be opened in a system text editor or the browser. So I don't know the difference between What OSes can also do is to open files in file browsers and pre-select them on open. Both impls don't do that atm as far as i see. ( I can add an
it is currently only exposed indirectly via drop to editor (and CLI). It even works with jars or other things which can be opened. The open-project window doesn't let you to that either. I found that to be useful to open an extra folder for a few tasks, but getting there always needed extra steps. (open parent folder than drag to editor). Students might find that useful too if they have to work with compact-java files or similar things. I discovered it accidentally while starting NB via script and setting some paths. edit: this is also a super classic NB feature since long ago NB required to mount things you wanted to see in the IDE |
The existing macOS action, and my replacement, do exactly this. This is not Ideally this would select in system across all OS. I chose
As in #9246 and above, and with no macOS check.
Yes, it's useful. You can also use |
But I haven't tested on more mainstream linux distros like ubuntu yet.
plus
Well the nice thing about it is that it is in the Favorites context menu too. I think it fits well into the category of open actions, one opens the path using a OS tool, the other using NB. I wouldn't bother to navigate to a folder first via project open just to open it in a view. Open parent folder in system + drag would be still faster even though it feels like a hack. |
6ae0061 to
f6535c6
Compare
|
renamed "Open Parent in System" to "Locate in System" + the action will now use |
|
If you want to pursue this change here instead, then please include the removal of the macOS action and the new shortcut. These actions might need to work with a set of
Not that I can tell from testing this already. And it doesn't look like it's in the Wayland support either. Calling an external process might be the only way to achieve this. Workarounds listed elsewhere include
I'm partly concerned about bypassing the existing open support, and I also think that it makes sense for folders and archives to have an Can we split the two changes for now? |
|
Further to the dbus option, this sort of external call seems to work, but might be more trouble than it's worth! 😄 Would still need |
Mine is, it just doesn't work properly! 😄 That's what I mean about working with
Agreed! We're coming at the same things from different angles here. I was looking to address the need to remove the reflection usage in applemenu while not losing any functionality there (or having an almost duplicate action to hide). |
extracted AbstractOpenInAction as common superclass for - (old) OpenInSystemAction - (new) OpenParentInSystemAction - (new) Open(Parent)InTabAction OpenParentInSystem will try to use the browseFileDirectory() feature if supported by the JDK. - removed mac specific open in finder impl Co-authored-by: Neil C Smith <neilcsmith@apache.org>
f6535c6 to
3338a32
Compare
| final Class<?> fmClz = Class.forName("com.apple.eio.FileManager"); //NOI18N | ||
| final Method m = fmClz.getDeclaredMethod("revealInFinder", File.class); //NOI18N | ||
| m.invoke(null, file); | ||
| } catch (ClassNotFoundException e) { |
There was a problem hiding this comment.
note to self: try to remove --add-exports=java.desktop/com.apple.eio=ALL-UNNAMED

like open-in-system but opens the parent + open-in-tab actions
extracted AbstractOpenInAction as common superclass for
(the expertly drawn red line marks a cut in the screenshot since the menu is longer)