public class MyApplication extends AbstractMDIApplication { public MyApplication { super("MyApplication"); this.setPluginsDeactivationPolicy(PluginsDeactivationPolicy.DEACTIVATION_IMMEDIATE); } }will not work because the application has no configuration management.
public class MyApplication extends AbstractMDIApplication { private Preferences pref = null; public MyApplication { super("MyApplication"); conf = AppliConfiguration.getInstance(); Preferences pref = Preferences.userRoot(); this.initConfiguration(pref, null); this.setPluginsDeactivationPolicy(PluginsDeactivationPolicy.DEACTIVATION_IMMEDIATE); } }will work because the application has configuration management.
public class MyApplication extends AbstractMDIApplication { private Preferences pref = null; public MyApplication { super("MyApplication"); Preferences pref = Preferences.userRoot(); this.initConfiguration(pref, null); this.setPluginsDeactivationPolicy(PluginsDeactivationPolicy.DEACTIVATION_IMMEDIATE); } }will also work because the application has configuration management, even if no application configuration is defined.
pref = Preferences.userRoot(); this.initConfiguration(pref, null); this.setPluginsDeactivationPolicy(PluginsDeactivationPolicy.DEACTIVATION_IMMEDIATE); this.registerPlugins();
public class ConfigSampleMDI extends AbstractMDIApplication { private Preferences pref = null; public ConfigSampleMDI() { super("ActionsTutorialMDI"); ImageIcon splash = new ImageIcon(this.getClass().getResource("splash.png")); SplashScreen splashdialog = new SplashScreen(splash, "0.1", "Build xxxx", true); pluginsDir = new File(System.getProperty("user.dir"), "plugins"); // plugins directory // initialize configuration pref = Preferences.userRoot(); this.initConfiguration(pref, null); this.setPluginsDeactivationPolicy(PluginsDeactivationPolicy.DEACTIVATION_IMMEDIATE); // register plugins in the plugins directory (same as main application jar directory) this.registerPlugins(); // create the menus with the Application menu factory mfactory = new SecondMenuFactory(); mfactory.setProgressInterface(splashdialog); super.preparePanels(4, true, true, mfactory); // set the size of the Application window this.setSize(500, 500); splashdialog.dispose(); splashdialog = null; } public static void main(String[] args) { ConfigSampleMDI mdi = new ConfigSampleMDI(); mdi.setVisible(true); } }
Copyright 2006-2023 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences