-
Notifications
You must be signed in to change notification settings - Fork 146
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
Allow opening a file or directory by dropping a file icon on Redcar.app #62
Comments
I'm currently hacking on this and have come quite a way: involved a lot of tedious pointer juggling in CocoaUIEnhancer.java but looks like I'm currently bumping into some problems with getting the runtime to invoke NSApplication app delegate's application:openFile:. For some reason, this method just doesn't seem to be invoked when I add/replace these methods during runtime to SWTApplicationDelegate (which is set as NSApplication's delegate). I've also updated the plist properties to accept the correct UTI types, but when trying to drop a textfile, it just doesn't invoke the callback. When trying to invoke other methods e.g. applicationShouldTerminate when quiting the app, my custom callbacks do get invoked. I suspect this might have to do with either deprecated java support and/or having to use https://developer.apple.com/library/mac/documentation/Java/Reference/1.5.0/appledoc/api/com/apple/eawt/ApplicationAdapter.html and friends. I'll give it a try again later this week if my schedule permits it. |
Awesome start! I haven't looked too much into invoking the SWTApplicationDelegate methods, but I can take a look. Do you have a branch you can link to the issue? |
Sure: https://github.com/redcar/redcar/tree/app_dnd_listener Let me know if you need a quick run through of what I've done. In editing CocoaUIEnhancer, I've tried to stick with the code that was already there, but it's that code that I believe can be improved in many ways. In my opinion, the original author used reflection in cases where it's not nice to do so, e.g. invocations that can easily be done without reflection. And imo should be done without reflection to get as much compiler assistance as possible. Maybe it'd be a good idea to consider some good old fashioned refactoring after we get this working :) |
Cool. +1 for refactoring. :) |
No description provided.
The text was updated successfully, but these errors were encountered: