@Override
    public void actionPerformed() {

        ExtFileChooserDialog d = new ExtFileChooserDialog(0, _GUI._.ExportAllMenusAdvancedAction_actionPerformed(), null, null);
        d.setFileFilter(new FileFilter() {

            @Override
            public String getDescription() {

                return _GUI._.lit_directory();
            }

            @Override
            public boolean accept(File f) {
                return f.isDirectory();
            }
        });

        d.setFileSelectionMode(FileChooserSelectionMode.DIRECTORIES_ONLY);
        d.setMultiSelection(false);

        d.setStorageID("menus");
        d.setType(FileChooserType.SAVE_DIALOG);
        try {
            Dialog.getInstance().showDialog(d);

            File saveTo = d.getSelectedFile();
            File file = null;
            int i = 0;
            while (file == null || file.exists()) {

                file = new File(saveTo, "JDownloader Menustructure " + i);

                i++;
            }
            file.mkdirs();
            MenuManagerDownloadTabBottomBar.getInstance().exportTo(file);
            MenuManagerDownloadTableContext.getInstance().exportTo(file);
            MenuManagerLinkgrabberTabBottombar.getInstance().exportTo(file);
            MenuManagerLinkgrabberTableContext.getInstance().exportTo(file);
            MenuManagerMainToolbar.getInstance().exportTo(file);
            MenuManagerTrayIcon.getInstance().exportTo(file);
            MenuManagerMainmenu.getInstance().exportTo(file);
            CrossSystem.openFile(file);

        } catch (DialogClosedException e1) {
            e1.printStackTrace();
        } catch (DialogCanceledException e1) {
            e1.printStackTrace();
        } catch (UnsupportedEncodingException e1) {
            Dialog.getInstance().showExceptionDialog(_GUI._.lit_error_occured(), e1.getMessage(), e1);
        } catch (IOException e1) {
            Dialog.getInstance().showExceptionDialog(_GUI._.lit_error_occured(), e1.getMessage(), e1);
        }
    }
예제 #2
0
  @Override
  public boolean onDoubleClick(MouseEvent e, AbstractNode value) {
    if (CrossSystem.isOpenFileSupported() && value != null) {

      final File ret = LinkTreeUtils.getDownloadDirectory(value);
      if (ret != null && ret.exists() && ret.isDirectory()) {
        CrossSystem.openFile(ret);
      }
      return true;
    }
    return false;
  }