/** * Returns a copy of the given configuration. * @param configuration the object to copy. * @since 2.6 */ Configuration copy(Configuration configuration) { Configuration copy = new Configuration(); copy.restoreState(configuration); return copy; }
/** * Show a file chooser dialog and return the file selected by the user or * <code>null</code>. */ static File openFileDialog(Frame frame, FileFilter fileFilter) { return openFileDialog(frame, fileFilter, null); }
@Override public void actionPerformed(ActionEvent e) { Tools.openURL("http://wiki.languagetool.org/finding-errors-using-n-gram-data"); } });
private void configureFromGUI(JLanguageTool langTool, Language lang) throws IOException { Configuration config = new Configuration(lang); if (internalServer && config.getUseGUIConfig()) { ServerTools.print("Using options configured in the GUI"); org.languagetool.gui.Tools.configureFromRules(langTool, config); } }
@Override public String toString() { int children = this.getChildCount(); int selected = 0; for (int i = 0; i < children; i++) { RuleNode child = (RuleNode) this.getChildAt(i); if (child.isEnabled()) { selected++; } } return String.format("%s (%d/%d)", category.getName(), selected, children); }
AboutDialog newFragment = new AboutDialog(); newFragment.show(getFragmentManager(), "dialog");
@Override public void insertUpdate(DocumentEvent e) { changedUpdate(e); }
@Override public void insertUpdate(DocumentEvent e) { changedUpdate(e); }
@Override public void insertUpdate(DocumentEvent e) { changedUpdate(e); }
/** * @throws IOException * @since 4.4 * Set LT is switched Off or On * save configuration */ public void setSwitchedOff(boolean switchOff, Language lang) throws IOException { this.switchOff = switchOff; saveConfiguration(lang); }
/** * Show the exception (message without stacktrace) in a dialog and print the * stacktrace to STDERR. */ static void showErrorMessage(Exception e) { showErrorMessage(e, null); }
@Override public void treeWillCollapse(TreeExpansionEvent e) throws ExpandVetoException { treeWillExpand(e); } }
public void actionPerformed(ActionEvent e) { numParaField.setEnabled(false); config.setNumParasToCheck(-1); } });
@Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { handlePopupEvent(e); } } };
/** * Show a file chooser dialog in a specified directory * @param frame Owner frame * @param fileFilter The pattern of files to choose from * @param initialDir The initial directory * @return the selected file * @since 2.6 */ static File openFileDialog(Frame frame, FileFilter fileFilter, File initialDir) { return openFileDialog(frame, fileFilter, initialDir, JFileChooser.FILES_ONLY); }
@Override public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { Tools.openURL(e.getURL()); } } });
@Override public void removeUpdate(DocumentEvent e) { changedUpdate(e); }
@Override public void removeUpdate(DocumentEvent e) { changedUpdate(e); }
@Override public void removeUpdate(DocumentEvent e) { changedUpdate(e); }
/** * Show a directory chooser dialog, starting with a specified directory * @param frame Owner frame * @param initialDir The initial directory * @return the selected file * @since 3.0 */ static File openDirectoryDialog(Frame frame, File initialDir) { return openFileDialog(frame, null, initialDir, JFileChooser.DIRECTORIES_ONLY); }