esmska.utils
Class MiscUtils

java.lang.Object
  extended by esmska.utils.MiscUtils

public class MiscUtils
extends java.lang.Object

Various helper methods.


Nested Class Summary
static class MiscUtils.Direction
           
 
Constructor Summary
MiscUtils()
           
 
Method Summary
static java.lang.String escapeHtml(java.lang.String input)
          Escape text using html entities.
static boolean isCropped(javax.swing.JComponent component)
          Tell whether some JComponent is cropped (not displayed fully).
static boolean needsResize(javax.swing.JComponent container, MiscUtils.Direction direction)
          Tell whether some container wants to be resized in a direction
static java.lang.String removeAccents(java.lang.String text)
          remove diacritical marks from text
static java.lang.String stripHtml(java.lang.String input)
          Strip html tags from text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiscUtils

public MiscUtils()
Method Detail

escapeHtml

public static java.lang.String escapeHtml(java.lang.String input)
Escape text using html entities. Fixes bug in OpenJDK where scaron entity is not replaced by 'š' and euro by '€'.

See Also:
StringEscapeUtils.escapeHtml(String)

stripHtml

public static java.lang.String stripHtml(java.lang.String input)
Strip html tags from text.

Parameters:
input - input text
Returns:
text with all html tags removed. Entities encoded by html codes are unescaped back to standard characters.

isCropped

public static boolean isCropped(javax.swing.JComponent component)
Tell whether some JComponent is cropped (not displayed fully).

Parameters:
component - component
Returns:
true if it is cropped, false otherwise

needsResize

public static boolean needsResize(javax.swing.JComponent container,
                                  MiscUtils.Direction direction)
Tell whether some container wants to be resized in a direction

Parameters:
container - container
direction - direction, BOTH when null
Returns:
true if the container wants to be resized, false otherwise

removeAccents

public static java.lang.String removeAccents(java.lang.String text)
remove diacritical marks from text