Package esmska.utils
Class MiscUtils
- java.lang.Object
-
- esmska.utils.MiscUtils
-
public class MiscUtils extends java.lang.ObjectVarious helper methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMiscUtils.Direction
-
Constructor Summary
Constructors Constructor Description MiscUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringescapeHtml(java.lang.String input)Escape text using html entities.static booleanisCropped(javax.swing.JComponent component)Tell whether some JComponent is cropped (not displayed fully).static booleanneedsResize(javax.swing.JComponent container, MiscUtils.Direction direction)Tell whether some container wants to be resized in a directionstatic java.lang.StringremoveAccents(java.lang.String text)remove diacritical marks from textstatic java.lang.StringstripHtml(java.lang.String input)Strip html tags from text.
-
-
-
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- containerdirection- 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
-
-