Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
private static void loadPlugins() {
pluginManager = ObjectFactory.newInstance().createManager();
final File pluginsDir = new File(System.getProperty("pluginFolder"));
final File[] plugins = pluginsDir.listFiles();
try {
final PluginLocation[] locations = new PluginLocation[plugins.length];
for (int i = 0; i < plugins.length; i++) {
locations[i] = StandardPluginLocation.create(plugins[i]);
}
pluginManager.publishPlugins(locations);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
final PluginManager plm = Application.pluginManager;
final PluginDescriptor corePlugin = plm.getRegistry()
.getPluginDescriptor("de.bestandsliste.core");
final ExtensionPoint point = plm.getRegistry()
.getExtensionPoint(corePlugin.getId(), "Exporter");
for (Iterator<Extension> it = point
.getConnectedExtensions().iterator(); it.hasNext();) {
final Extension ext = it.next();
// System.out.println(ext.getParameter("name").valueAsString());
// System.out.println(ext.getParameter("description").valueAsString());
final PluginDescriptor descr = ext
.getDeclaringPluginDescriptor();
try {
plm.activatePlugin(descr.getId());
final ClassLoader classLoader = plm
.getPluginClassLoader(descr);
final Class pluginCls = classLoader.loadClass(ext
.getParameter("class").valueAsString());
final Exporter exporter = (Exporter) pluginCls
.newInstance();
exporter.export(rootFrame, location);
} catch (Exception exc) {
// TODO Auto-generated catch block
exc.printStackTrace();
}
}