/** * Call the LookAndFeelFactory.installJideExtension using a specific class loader. This is used for GUI context * switch when going between two class loaders. * * @param newLoader ClassLoader * @param force if true, we will install the extension even when the current loader and new class loader are the * same. */ public static void installJideExtension(ClassLoader newLoader, boolean force) { if (currentLoader == newLoader && !force) { return; } try { Class lafFactory = newLoader.loadClass("com.jidesoft.plaf.LookAndFeelFactory"); Method installJideExtension = lafFactory.getDeclaredMethod("installJideExtension", new Class[]{int.class}); int style = LookAndFeelFactory.getDefaultStyle(); UIManager.put(LookAndFeelFactory.JIDE_EXTENSION_INSTALLED, null); // force population installJideExtension.invoke(null, style); } catch (Exception e) { // ignore } currentLoader = newLoader; UIManager.put("ClassLoader", newLoader); }
installJideExtension(_style == -1 ? getDefaultStyle() : _style);