Package org.languagetool.gui
Class Tools
java.lang.Object
org.languagetool.gui.Tools
GUI-related tools.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidcenterDialog(JDialog dialog) Set dialog location to the center of the screenstatic voidconfigureFromRules(JLanguageTool lt, Configuration config) static Stringstatic Stringstatic StringgetExampleSentences(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) 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, 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
-