Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.util
Class StringUtil

java.lang.Object
  extended by oracle.javatools.util.StringUtil

public final class StringUtil
extends java.lang.Object

String utilities.


Field Summary
static int FILEPATH_MAX_DISPLAY_LENGTH
           
 
Method Summary
static java.lang.String[] getTokenArray(java.lang.String string, java.lang.String delimiters)
           
static java.lang.String removeMnemonic(java.lang.String text, char mnemonic)
          Removes the given mnemonic if present in the given text in between parenthesis.
static java.lang.String stripMnemonic(java.lang.String string)
           
static java.lang.String textWithoutMnemonic(javax.swing.Action action)
          Returns the text of the given action, removing any mnemonic attached to the end of such text, if present in the given text in between parenthesis.
static java.lang.String truncateFileNameForMessage(java.lang.String path)
          Truncate a file path for a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILEPATH_MAX_DISPLAY_LENGTH

public static final int FILEPATH_MAX_DISPLAY_LENGTH
See Also:
Constant Field Values
Method Detail

truncateFileNameForMessage

public static java.lang.String truncateFileNameForMessage(java.lang.String path)
Truncate a file path for a message. The file path is truncated from the middle, and whenever possible, partially truncated directory names are avoided.

Parameters:
path - a file path
Returns:
if the filePath is less than a specific size (80 characters), the original string. If more than 80 characters, the string is truncated in a way that preserves the start and end of the path.

getTokenArray

public static java.lang.String[] getTokenArray(java.lang.String string,
                                               java.lang.String delimiters)

stripMnemonic

public static java.lang.String stripMnemonic(java.lang.String string)

textWithoutMnemonic

public static java.lang.String textWithoutMnemonic(javax.swing.Action action)
Returns the text of the given action, removing any mnemonic attached to the end of such text, if present in the given text in between parenthesis.

For example, if text of the action is "Hello(H)", this method will return "Hello".

Parameters:
action - the given action.
Returns:
the text of the given action, without any mnemonics at the end.

removeMnemonic

public static java.lang.String removeMnemonic(java.lang.String text,
                                              char mnemonic)
Removes the given mnemonic if present in the given text in between parenthesis.

Parameters:
text - the text that may contain the mnemonic.
mnemonic - the mnemonic to remove.
Returns:
the the text with the mnemonic removed (if it had it in the first place.)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.