public static boolean checkBrowser() { AppList appList = MimeTypesList.getAppList(); String bpath = appList.getBrowserExec(); if (bpath != null) if (new File(bpath).isFile()) return true; JFileChooser chooser = new JFileChooser(); chooser.setFileHidingEnabled(false); chooser.setDialogTitle(Local.getString("Select the web-browser executable")); chooser.setAcceptAllFileFilterUsed(true); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); /*java.io.File lastSel = (java.io.File) Context.get("LAST_SELECTED_RESOURCE_FILE"); if (lastSel != null) chooser.setCurrentDirectory(lastSel);*/ if (chooser.showOpenDialog(App.getFrame()) != JFileChooser.APPROVE_OPTION) return false; appList.setBrowserExec(chooser.getSelectedFile().getPath()); CurrentStorage.get().storeMimeTypesList(); return true; }
static { CurrentStorage.get().openMimeTypesList(); _root = _doc.getRootElement(); }