예제 #1
0
 // {{{ handleMessage() method
 @Override
 public void handleMessage(EBMessage message) {
   if (message.getSource() == PluginManager.getInstance()) {
     chooseButton.path = jEdit.getProperty(PluginManager.PROPERTY_PLUGINSET, "");
     if (chooseButton.path.length() > 0) {
       loadPluginSet(chooseButton.path);
       pluginModel.restoreSelection(new HashSet<String>(), new HashSet<String>());
       chooseButton.updateUI();
     }
   }
 } // }}}
예제 #2
0
  /**
   * loads a pluginSet xml file and updates the model to reflect certain checked selections
   *
   * @since jEdit 4.3pre10
   * @author Alan Ezust
   */
  boolean loadPluginSet(String path) {
    pluginSet.clear();
    pluginModel.restoreSelection(new HashSet<String>(), new HashSet<String>());

    VFS vfs = VFSManager.getVFSForPath(path);
    Object session = vfs.createVFSSession(path, InstallPanel.this);
    try {
      InputStream is = vfs._createInputStream(session, path, false, InstallPanel.this);
      XMLUtilities.parseXML(is, new StringMapHandler());
    } catch (Exception e) {
      Log.log(Log.WARNING, this, "Loading Pluginset failed:" + e.getMessage());
      return false;
    }
    pluginModel.update();
    return true;
  } // }}}