Added setter for native provider

This makes it possible to support situations where the extraction of a DLL at runtime is not possible
This commit is contained in:
Ingo Kegel
2021-03-23 16:47:08 +01:00
parent f8ee8b27fb
commit 9a876e747a

View File

@@ -247,16 +247,19 @@ public class FlatNativeWindowBorder
/*
Class<?> cls = Class.forName( "com.formdev.flatlaf.natives.jna.windows.FlatWindowsNativeWindowBorder" );
Method m = cls.getMethod( "getInstance" );
nativeProvider = (Provider) m.invoke( null );
setNativeProvider( (Provider) m.invoke( null ) );
*/
nativeProvider = FlatWindowsNativeWindowBorder.getInstance();
supported = (nativeProvider != null);
setNativeProvider( FlatWindowsNativeWindowBorder.getInstance() );
} catch( Exception ex ) {
// ignore
}
}
public static void setNativeProvider( Provider nativeProvider ) {
FlatNativeWindowBorder.nativeProvider = nativeProvider;
supported = nativeProvider != null;
}
//---- interface Provider -------------------------------------------------
public interface Provider