iinegve / muCommander

muCommander fork
3 stars 5 forks source link

Avoid Any Compile Time Dependencies on Apple Java Extensions #29

Open IvanMamontov opened 10 years ago

IvanMamontov commented 10 years ago

muCommander uses classes from package com.apple.eawt. directly. See the following classes:

com.mucommander.ui.macosx.EAWTHandler
com.mucommander.ui.main.MainFrame

I propose to use reflection:

public static void setWindowCanFullScreen(Window window) {
    try {
        Class util = Class.forName("com.apple.eawt.FullScreenUtilities");
        Class params[] = new Class[]{Window.class, Boolean.TYPE};
        Method method = util.getMethod("setWindowCanFullScreen", params);
        method.invoke(null, window, true);
    } catch (ClassNotFoundException e1) {
    } catch (Exception e) {
    }
}

The purpose of using reflection is to avoid any compile time dependencies on Apple Java Extensions.

pierluc-codes commented 9 years ago

Or you can add the orange-extensions to dependencies.

iinegve commented 9 years ago

I'm not sure I understand what is "orange-extensions". Could you clarify it, please?

pierluc-codes commented 9 years ago

https://ymasory.github.io/OrangeExtensions/