Package org.languagetool.gui
Class Tools
java.lang.Object
org.languagetool.gui.Tools
GUI-related tools.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void
static void
centerDialog
(JDialog dialog) Set dialog location to the center of the screenstatic void
configureFromRules
(org.languagetool.JLanguageTool langTool, Configuration config) private static String
encodeUrl
(org.languagetool.rules.Rule rule) private static String
private static String
getExampleSentences
(org.languagetool.rules.Rule rule, ResourceBundle messages) static String
Returns translation of the UI element without the control character&
.static char
getMnemonic
(String label) Returns mnemonic of a UI element.(package private) static File
openDirectoryDialog
(Frame frame, File initialDir) Show a directory chooser dialog, starting with a specified directory(package private) static File
openFileDialog
(Frame frame, FileFilter fileFilter) Show a file chooser dialog and return the file selected by the user ornull
.(package private) static File
openFileDialog
(Frame frame, FileFilter fileFilter, File initialDir) Show a file chooser dialog in a specified directoryprivate static File
openFileDialog
(Frame frame, FileFilter fileFilter, File initialDir, int mode) (package private) static void
Launches the default browser to display a URL.(package private) static void
Launches the default browser to display a URL.static String
shortenComment
(String comment) LibO shortens menu items with more than ~100 characters by dropping text in the middle.(package private) static void
Show the exception (with stacktrace) in a dialog and print it to STDERR.(package private) static void
Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR.(package private) static void
showErrorMessage
(Exception e, Component parent) Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR.(package private) static void
showRuleInfoDialog
(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
Show a directory chooser dialog, starting with a specified directory- Parameters:
frame
- Owner frameinitialDir
- The initial directory- Returns:
- the selected file
- Since:
- 3.0
-
openFileDialog
-
showError
Show the exception (with stacktrace) in a dialog and print it to STDERR. -
showErrorMessage
Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR. -
showErrorMessage
Show the exception (message without stacktrace) in a dialog and print the stacktrace to STDERR. -
shortenComment
LibO shortens menu items with more than ~100 characters by dropping text in the middle. That isn't really sensible, so we shorten the text here in order to preserve the important parts. -
getLabel
Returns translation of the UI element without the control character&
. To have&
in the UI, use&&
.- Parameters:
label
- Label to convert.- Returns:
- String UI element string without mnemonics.
-
getMnemonic
Returns mnemonic of a UI element.- Parameters:
label
- String Label of the UI element- Returns:
- Mnemonic of the UI element, or
-