de.danielnaber.languagetool.gui
Class Tools

Object
  extended by Tools

public class Tools
extends Object

GUI-related tools.

Author:
Daniel Naber

Field Summary
static String WINDOW_ICON_FILE
           
 
Method Summary
static String getContext(int fromPos, int toPos, String text)
          Get the default context (40 characters) of the given text range, highlighting the range with HTML.
static String getContext(int fromPos, int toPos, String fileContents, int contextSize)
          Get the context (contextSize characters) of the given text range, highlighting the range with HTML code.
static String getContext(int fromPos, int toPos, String fileContents, int contextSize, String markerStart, String markerEnd)
          Get the context (contextSize characters) of the given text range, highlighting the range with the given marker strings, not escaping HTML.
static String getContext(int fromPos, int toPos, String text, int contextSize, String markerStart, String markerEnd, boolean escapeHTML)
          Get the context (contextSize characters) of the given text range, highlighting the range with the given marker strings.
static String makeTexti18n(ResourceBundle messages, String key, Object[] messageArguments)
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WINDOW_ICON_FILE

public static final String WINDOW_ICON_FILE
See Also:
Constant Field Values
Method Detail

makeTexti18n

public static String makeTexti18n(ResourceBundle messages,
                                  String key,
                                  Object[] messageArguments)

getContext

public static String getContext(int fromPos,
                                int toPos,
                                String text)
Get the default context (40 characters) of the given text range, highlighting the range with HTML.


getContext

public static String getContext(int fromPos,
                                int toPos,
                                String fileContents,
                                int contextSize)
Get the context (contextSize characters) of the given text range, highlighting the range with HTML code.


getContext

public static final String getContext(int fromPos,
                                      int toPos,
                                      String fileContents,
                                      int contextSize,
                                      String markerStart,
                                      String markerEnd)
Get the context (contextSize characters) of the given text range, highlighting the range with the given marker strings, not escaping HTML.


getContext

public static final String getContext(int fromPos,
                                      int toPos,
                                      String text,
                                      int contextSize,
                                      String markerStart,
                                      String markerEnd,
                                      boolean escapeHTML)
Get the context (contextSize characters) of the given text range, highlighting the range with the given marker strings.

Parameters:
fromPos - the start position of the error in characters
endPos - the end position of the error in characters
text - the text from which the context should be taken
contextSize - the size of the context in characters
markerStart - the string used to mark the beginning of the error
markerEnd - the string used to mark the end of the error
escapeHTML - whether HTML/XML characters should be escaped


Copyright © 2005-2007 Daniel Naber