- Timestamp:
- 2014-09-02T02:57:38+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r7482 r7485 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Image; 6 7 import java.awt.Window; 7 8 import java.awt.event.KeyEvent; … … 48 49 Class<?> eawtOpenFilesHandler = Class.forName("com.apple.eawt.OpenFilesHandler"); 49 50 Class<?> eawtPreferencesHandler = Class.forName("com.apple.eawt.PreferencesHandler"); 50 Object appli cation= eawtApplication.getConstructor((Class[])null).newInstance((Object[])null);51 Object appli = eawtApplication.getConstructor((Class[])null).newInstance((Object[])null); 51 52 Object proxy = Proxy.newProxyInstance(PlatformHookOsx.class.getClassLoader(), new Class<?>[] { 52 53 eawtQuitHandler, eawtAboutHandler, eawtOpenFilesHandler, eawtPreferencesHandler}, ivhandler); 53 eawtApplication.getDeclaredMethod("setQuitHandler", eawtQuitHandler).invoke(appli cation, proxy);54 eawtApplication.getDeclaredMethod("setAboutHandler", eawtAboutHandler).invoke(appli cation, proxy);55 eawtApplication.getDeclaredMethod("setOpenFileHandler", eawtOpenFilesHandler).invoke(appli cation, proxy);56 eawtApplication.getDeclaredMethod("setPreferencesHandler", eawtPreferencesHandler).invoke(appli cation, proxy);54 eawtApplication.getDeclaredMethod("setQuitHandler", eawtQuitHandler).invoke(appli, proxy); 55 eawtApplication.getDeclaredMethod("setAboutHandler", eawtAboutHandler).invoke(appli, proxy); 56 eawtApplication.getDeclaredMethod("setOpenFileHandler", eawtOpenFilesHandler).invoke(appli, proxy); 57 eawtApplication.getDeclaredMethod("setPreferencesHandler", eawtPreferencesHandler).invoke(appli, proxy); 57 58 // this method has been deprecated, but without replacement ATM 58 eawtApplication.getDeclaredMethod("setEnabledPreferencesMenu", boolean.class).invoke(application, Boolean.TRUE); 59 eawtApplication.getDeclaredMethod("setEnabledPreferencesMenu", boolean.class).invoke(appli, Boolean.TRUE); 60 // setup the dock icon. It is automatically set with application bundle and Web start but we need 61 // to do it manually if run with `java -jar`` 62 eawtApplication.getDeclaredMethod("setDockIconImage", Image.class).invoke(appli, ImageProvider.get("logo").getImage()); 59 63 // enable full screen 60 64 enableOSXFullscreen((Window) Main.parent);
Note:
See TracChangeset
for help on using the changeset viewer.