Class Tools

java.lang.Object
org.languagetool.gui.Tools

public final class Tools extends Object
GUI-related tools.
Author:
Daniel Naber
  • Method Details

    • shortenComment

      public static String shortenComment(String comment)
      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

      public static String getLabel(String label)
      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

      public static char getMnemonic(String label)
      Returns mnemonic of a UI element.
      Parameters:
      label - String Label of the UI element
      Returns:
      Mnemonic of the UI element, or in case of no mnemonic set.
    • centerDialog

      public static void centerDialog(JDialog dialog)
      Set dialog location to the center of the screen
      Parameters:
      dialog - the dialog which will be centered
      Since:
      2.6
    • configureFromRules

      public static void configureFromRules(org.languagetool.JLanguageTool langTool, Configuration config)
      Since:
      3.3