Package editor.util
Class EditorUtilities
- java.lang.Object
-
- editor.util.EditorUtilities
-
public class EditorUtilities extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
CONTROL_KEY_MASK
static String
CONTROL_KEY_NAME
Platform dependent keystroke info
-
Constructor Summary
Constructors Constructor Description EditorUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Process
browse(String strURL)
static String
buildFunctionIntellisenseString(boolean bFeatureLiteralCompletion, IFunctionType functionType)
static void
centerWindowInFrame(Component window, Window frame)
static boolean
containsFocus(Component c)
static void
convertRectangleToScreen(Rectangle rectangle, Component component)
static Image
createSystemColorImage(Image i)
static void
displayError(String strMsg)
static void
displayError(Throwable e)
static void
displayInformation(String strMsg)
static void
displayMessageBox(String strMsg, int iType, boolean bWrapText)
static void
displayWarning(String strMsg)
static void
doBackgroundOp(Runnable run)
static void
doWaitOperation(Runnable op)
static List<String>
filterStrings(Collection<? extends CharSequence> collection, String filter)
static <T> T
findAncestor(Component start, Class<T> aClass)
Finds the first widget above the passed in widget of the given classstatic <T> T
findAtOrAbove(Component start, Class<T> aClass)
Finds the first widget at or above the passed in widget of the given classstatic <T> List<T>
findDecendents(Component configUI, Class<T> aClass)
static <T> List<T>
findDecendents(Component configUI, Class<T> aClass, Predicate<Container> recurseToChildren)
static Icon
findIcon(ClassType classType)
static Icon
findIcon(IType type)
static Icon
findIcon(Path fileOrDir)
static void
fixSwingFocusBugWhenPopupCloses(Component c)
static boolean
focusContains(Component c)
static Frame
frameForComponent(Component comp)
static Window
getActiveWindow()
static Clipboard
getClipboard()
static Component
getFocus()
static Window
getFocusedWindow()
static String
getFontFamilyOrDefault(String name, String defaultFont)
static Rectangle
getPrimaryMonitorScreenRect()
static Window
getWindow()
static Point
getXYForDialogRelativeToStudioFrame(int width, int height)
static void
handleUncaughtException(String s, Throwable e)
static void
handleUncaughtException(Throwable e)
static String
hex(Color color)
static void
hideToolTip(JComponent c)
static void
invokeInDispatchThread(Runnable task)
static void
invokeNowOrLater(Runnable task)
static boolean
isInFocusLineage(Component c)
static boolean
isRunnable(IType type)
static ImageIcon
loadIcon(String strRes)
static void
removePopupBorder(Container c)
static JRootPane
rootPaneForComponent(Component comp)
static void
settleBackgroundOps()
Pumps through all current events in the background operation queue.static void
settleEventQueue()
static Component
showWaitCursor(boolean bWait)
static void
showWaitCursor(boolean bWait, Component c)
static Window
windowForComponent(Component comp)
static String
wrapText(String strText)
static String
wrapText(String strText, int iLineLen)
-
-
-
Field Detail
-
CONTROL_KEY_NAME
public static final String CONTROL_KEY_NAME
Platform dependent keystroke info
-
CONTROL_KEY_MASK
public static final int CONTROL_KEY_MASK
-
-
Method Detail
-
doBackgroundOp
public static void doBackgroundOp(Runnable run)
-
settleBackgroundOps
public static void settleBackgroundOps()
Pumps through all current events in the background operation queue. Note that this is *NOT* a settle. Any operations added after this method is invoked will not be executed.
-
removePopupBorder
public static void removePopupBorder(Container c)
-
getPrimaryMonitorScreenRect
public static Rectangle getPrimaryMonitorScreenRect()
-
handleUncaughtException
public static void handleUncaughtException(Throwable e)
-
settleEventQueue
public static void settleEventQueue()
-
getClipboard
public static Clipboard getClipboard()
-
buildFunctionIntellisenseString
public static String buildFunctionIntellisenseString(boolean bFeatureLiteralCompletion, IFunctionType functionType)
-
getWindow
public static Window getWindow()
-
displayInformation
public static void displayInformation(String strMsg)
-
displayError
public static void displayError(Throwable e)
-
displayError
public static void displayError(String strMsg)
-
displayWarning
public static void displayWarning(String strMsg)
-
displayMessageBox
public static void displayMessageBox(String strMsg, int iType, boolean bWrapText)
-
convertRectangleToScreen
public static void convertRectangleToScreen(Rectangle rectangle, Component component)
-
filterStrings
public static List<String> filterStrings(Collection<? extends CharSequence> collection, String filter)
-
hideToolTip
public static void hideToolTip(JComponent c)
-
invokeInDispatchThread
public static void invokeInDispatchThread(Runnable task)
-
invokeNowOrLater
public static void invokeNowOrLater(Runnable task)
-
browse
public static Process browse(String strURL) throws IOException
- Throws:
IOException
-
findAncestor
public static <T> T findAncestor(Component start, Class<T> aClass)
Finds the first widget above the passed in widget of the given class
-
findAtOrAbove
public static <T> T findAtOrAbove(Component start, Class<T> aClass)
Finds the first widget at or above the passed in widget of the given class
-
findDecendents
public static <T> List<T> findDecendents(Component configUI, Class<T> aClass, Predicate<Container> recurseToChildren)
-
isRunnable
public static boolean isRunnable(IType type)
-
fixSwingFocusBugWhenPopupCloses
public static void fixSwingFocusBugWhenPopupCloses(Component c)
-
showWaitCursor
public static Component showWaitCursor(boolean bWait)
-
showWaitCursor
public static void showWaitCursor(boolean bWait, Component c)
-
doWaitOperation
public static void doWaitOperation(Runnable op)
-
getFocus
public static Component getFocus()
-
getFocusedWindow
public static Window getFocusedWindow()
-
getActiveWindow
public static Window getActiveWindow()
-
containsFocus
public static boolean containsFocus(Component c)
-
focusContains
public static boolean focusContains(Component c)
-
isInFocusLineage
public static boolean isInFocusLineage(Component c)
-
getXYForDialogRelativeToStudioFrame
public static Point getXYForDialogRelativeToStudioFrame(int width, int height)
-
-