How to open user system "select program to open with" for given file?
Hi,
I'm trying to make file management application in Java.
I already know how to open file in system preferred application. It's quite easy.
The other issue I thinking about now is that I need to implement "Open With" functionality (like in Ubuntu: you right press on the file -> select "Open With" -> "Other" and system's default application selection window starts.
I tried to manage that with some Java default classes, but I didn't found one.
So, I'm working on solution, based on Runtime.getRuntime().exec("something");
I already know what commands i should write in Mac and Windows to open "application selection" for file:
1) Windows: RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <file.ext>
2) Mac: open <file.ext>
How to do same on linux (Gnome/KDE)? I still not found easy solution for that.
Or maybe I am digging in wrong direction? If so - prease correct me.
P.S. I tried Desktop.getDesktop() and Java Desktop Integration Components (JDIC), but it seems, that both of them don't have a function for functionality i need.
Thank you for your replies.
Re: How to open user system "select program to open with" for given file?
Before anybody here wastes their time, this has already been posted here.
Re: How to open user system "select program to open with" for given file?
Thanks ProgramThis - I suggest the OP refers to the replies to the same question in the other forum :D
It is better to have an approximate answer to the right question than an exact answer to the wrong one...
J. Tukey
Re: How to open user system "select program to open with" for given file?
Quote:
Originally Posted by
ProgramThis
Yeah, i posted it in several forums. Different people goes to different forums, so this approach helps to get attention from bigger audience.
I don't see any problems in it - if I will get any solution anythere I will definitely post it to other, so others will be able to find it easier.
Re: How to open user system "select program to open with" for given file?
Quote:
Yeah, i posted it in several forums. Different people goes to different forums, so this approach helps to get attention from bigger audience.
I don't see any problems in it -
The problem is the people in each forum who are giving their time and expertise for free are likely to duplicate answers written by others and hence waste their valuable time. And given that you are asking for free help the helpers time is way more valuable then yours.
Quote:
if I will get any solution anythere I will definitely post it to other, so others will be able to find it easier.
The thing you should do is post a link to the other sites that you have posted the question in and then if anybody wants to answer the question they can check to see if it has already been answered before wasting their own time.
Cross posting is frowned upon by every forum I've been involved with. The only time you should do it is if you don't get an answer to your question in a reasonable time (and by that I mean within a day or two and not within an hour).
Re: How to open user system "select program to open with" for given file?
Quote:
Originally Posted by
asarturas
I don't see any problems in it
As keang says, it annoys the people you're asking to help, so you run the risk of them putting you on their 'ignore' list, or the moderators may just ban you from the forum.
Experience is a poor teacher: it gives its tests before it teaches its lessons...
Anonymous