Class Tools
java.lang.Object
org.languagetool.gui.Tools
GUI-related tools.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidstatic voidcenterDialog(JDialog dialog) Set dialog location to the center of the screenstatic voidconfigureFromRules(org.languagetool.JLanguageTool langTool, Configuration config) private static StringencodeUrl(org.languagetool.rules.Rule rule) private static Stringprivate static StringgetExampleSentences(org.languagetool.rules.Rule rule, ResourceBundle messages) static StringReturns translation of the UI element without the control character&.static chargetMnemonic(String label) Returns mnemonic of a UI element.(package private) static FileopenDirectoryDialog(Frame frame, File initialDir) Show a directory chooser dialog, starting with a specified directory(package private) static FileopenFileDialog(Frame frame, FileFilter fileFilter) Show a file chooser dialog and return the file selected by the user ornull.(package private) static FileopenFileDialog(Frame frame, FileFilter fileFilter, File initialDir) Show a file chooser dialog in a specified directoryprivate static FileopenFileDialog(Frame frame, FileFilter fileFilter, File initialDir, int mode) (package private) static voidLaunches the default browser to display a URL.(package private) static voidLaunches the default browser to display a URL.static StringshortenComment(String comment) LibO shortens menu items with more than ~100 characters by dropping text in the middle.(package private) static voidShow the exception (with stacktrace) in a dialog and print it to STDERR.(package private) static voidShow the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR.(package private) static voidshowErrorMessage(Exception e, Component parent) Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR.(package private) static voidshowRuleInfoDialog(Component parent, String title, String message, org.languagetool.rules.Rule rule, URL matchUrl, ResourceBundle messages, String lang)
-
Constructor Details
-
Tools
private Tools()
-
-
Method Details
-
openFileDialog
Show a file chooser dialog and return the file selected by the user ornull. -
openFileDialog
Show a file chooser dialog in a specified directory- Parameters:
frame- Owner framefileFilter- The pattern of files to choose frominitialDir- The initial directory- Returns:
- the selected file
- Since:
- 2.6
-
openDirectoryDialog
-
openFileDialog
-
showError
Show the exception (with stacktrace) in a dialog and print it to STDERR. -
showErrorMessage
-
showErrorMessage
Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR. -
shortenComment
-
getLabel
-
getMnemonic
Returns mnemonic of a UI element.- Parameters:
label- String Label of the UI element- Returns:
- Mnemonic of the UI element, or
-