コード例 #1
0
  @NbBundle.Messages("AddPluginsPanel.validate.empty=Plugin name is empty.")
  public void runVagrantPluginInstall() {
    try {
      String plugin = getPlugin();
      if (StringUtils.isEmpty(plugin)) {
        showDialog();
        VagrantUtils.showWarnigDialog(Bundle.AddPluginsPanel_validate_empty());
        return;
      }

      Vagrant vagrant = Vagrant.getDefault();
      Future<Integer> result =
          vagrant.plugin(Vagrant.PLUGIN.INSTALL, Collections.singletonList(plugin));
      try {
        result.get();
      } catch (InterruptedException ex) {
        Exceptions.printStackTrace(ex);
      } catch (ExecutionException ex) {
        Exceptions.printStackTrace(ex);
      }
      installedPlugins.add(plugin);
      setPluginsTable();
    } catch (InvalidVagrantExecutableException ex) {
      VagrantUtils.showWarnigDialog(ex.getMessage());
    }
  }
コード例 #2
0
 private void setInstalledPlugins() {
   try {
     Vagrant vagrant = Vagrant.getDefault();
     List<String> pluginList = vagrant.getPluginList();
     installedPlugins.clear();
     for (String plugin : pluginList) {
       installedPlugins.add(plugin.replaceAll("\\(.+\\)", "").trim()); // NOI18N
     }
   } catch (InvalidVagrantExecutableException ex) {
     VagrantUtils.showWarnigDialog(ex.getMessage());
   }
 }