Exemplo n.º 1
0
 public void startAllPlugins() {
   PCGenMessageHandler dispatcher = msgHandlerMgr.getPostbox();
   for (InteractivePlugin plugin : pluginMap.keySet()) {
     if (pluginMap.get(plugin)) {
       plugin.start(dispatcher);
       msgHandlerMgr.addMember(plugin);
     }
   }
 }
Exemplo n.º 2
0
  @Override
  public void loadPlugin(Class<?> clazz) throws Exception {
    InteractivePlugin pl = (InteractivePlugin) clazz.newInstance();

    String logName = getLogName(clazz, pl);
    String plName = pl.getPluginName();

    boolean load = PCGenSettings.GMGEN_OPTIONS_CONTEXT.getBoolean(logName + ".Load", true);

    if ((logName == null) || (plName == null)) {
      Logging.log(
          Logging.WARNING, "Plugin " + clazz.getCanonicalName() + " needs" + " 'name' property.");
    } else {
      infoList.add(new PluginInfo(logName, plName));
      pluginMap.put(pl, load);
    }
  }
Exemplo n.º 3
0
 @Override
 public int compare(InteractivePlugin arg0, InteractivePlugin arg1) {
   return Integer.valueOf(arg0.getPriority()).compareTo(Integer.valueOf(arg1.getPriority()));
 }