Package editor.util

Class EditorUtilities


  • public class EditorUtilities
    extends java.lang.Object
    • Field Detail

      • ICON_TABLE

        static final java.util.HashMap<java.lang.String,​javax.swing.ImageIcon> ICON_TABLE
      • BACKGROUND_QUEUE_NAME

        private static final java.lang.String BACKGROUND_QUEUE_NAME
        See Also:
        Constant Field Values
      • CONTAINS_FOCUS

        static java.util.Map<java.awt.Component,​java.lang.Boolean> CONTAINS_FOCUS
      • FOCUS_CONTAINS

        static java.util.Map<java.awt.Component,​java.lang.Boolean> FOCUS_CONTAINS
      • CONTROL_KEY_NAME

        public static final java.lang.String CONTROL_KEY_NAME
        Platform dependent keystroke info
      • CONTROL_KEY_MASK

        public static final int CONTROL_KEY_MASK
    • Constructor Detail

      • EditorUtilities

        public EditorUtilities()
    • Method Detail

      • doBackgroundOp

        public static void doBackgroundOp​(java.lang.Runnable run)
      • getBackgroundQueue

        private static TaskQueue getBackgroundQueue()
      • 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​(java.awt.Container c)
      • centerWindowInFrame

        public static void centerWindowInFrame​(java.awt.Component window,
                                               java.awt.Window frame)
      • getPrimaryMonitorScreenRect

        public static java.awt.Rectangle getPrimaryMonitorScreenRect()
      • loadIcon

        public static javax.swing.ImageIcon loadIcon​(java.lang.String strRes)
      • findIcon

        public static javax.swing.Icon findIcon​(java.nio.file.Path fileOrDir)
      • findIcon

        public static javax.swing.Icon findIcon​(IType type)
      • findIcon

        public static javax.swing.Icon findIcon​(ClassType classType)
      • handleUncaughtException

        public static void handleUncaughtException​(java.lang.Throwable e)
      • handleUncaughtException

        public static void handleUncaughtException​(java.lang.String s,
                                                   java.lang.Throwable e)
      • settleEventQueue

        public static void settleEventQueue()
      • getClipboard

        public static java.awt.datatransfer.Clipboard getClipboard()
      • frameForComponent

        public static java.awt.Frame frameForComponent​(java.awt.Component comp)
      • windowForComponent

        public static java.awt.Window windowForComponent​(java.awt.Component comp)
      • buildFunctionIntellisenseString

        public static java.lang.String buildFunctionIntellisenseString​(boolean bFeatureLiteralCompletion,
                                                                       IFunctionType functionType)
      • getWindow

        public static java.awt.Window getWindow()
      • createSystemColorImage

        public static java.awt.Image createSystemColorImage​(java.awt.Image i)
      • displayInformation

        public static void displayInformation​(java.lang.String strMsg)
      • displayError

        public static void displayError​(java.lang.Throwable e)
      • displayError

        public static void displayError​(java.lang.String strMsg)
      • displayWarning

        public static void displayWarning​(java.lang.String strMsg)
      • displayMessageBox

        public static void displayMessageBox​(java.lang.String strMsg,
                                             int iType,
                                             boolean bWrapText)
      • wrapText

        public static java.lang.String wrapText​(java.lang.String strText)
      • wrapText

        public static java.lang.String wrapText​(java.lang.String strText,
                                                int iLineLen)
      • convertRectangleToScreen

        public static void convertRectangleToScreen​(java.awt.Rectangle rectangle,
                                                    java.awt.Component component)
      • filterStrings

        public static java.util.List<java.lang.String> filterStrings​(java.util.Collection<? extends java.lang.CharSequence> collection,
                                                                     java.lang.String filter)
      • camelCasePrefix

        private static java.lang.String camelCasePrefix​(java.lang.String strPrefix)
      • getRelativeTypeName

        private static java.lang.String getRelativeTypeName​(java.lang.String strType)
      • hideToolTip

        public static void hideToolTip​(javax.swing.JComponent c)
      • rootPaneForComponent

        public static javax.swing.JRootPane rootPaneForComponent​(java.awt.Component comp)
      • invokeInDispatchThread

        public static void invokeInDispatchThread​(java.lang.Runnable task)
      • invokeNowOrLater

        public static void invokeNowOrLater​(java.lang.Runnable task)
      • browse

        public static java.lang.Process browse​(java.lang.String strURL)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • findAncestor

        public static <T> T findAncestor​(java.awt.Component start,
                                         java.lang.Class<T> aClass)
        Finds the first widget above the passed in widget of the given class
      • findAtOrAbove

        public static <T> T findAtOrAbove​(java.awt.Component start,
                                          java.lang.Class<T> aClass)
        Finds the first widget at or above the passed in widget of the given class
      • findDecendents

        public static <T> java.util.List<T> findDecendents​(java.awt.Component configUI,
                                                           java.lang.Class<T> aClass)
      • _findDecendents

        private static <T> void _findDecendents​(java.util.ArrayList<T> comps,
                                                java.awt.Component component,
                                                java.lang.Class<T> aClass,
                                                java.util.function.Predicate<java.awt.Container> recurseToChildren)
      • findDecendents

        public static <T> java.util.List<T> findDecendents​(java.awt.Component configUI,
                                                           java.lang.Class<T> aClass,
                                                           java.util.function.Predicate<java.awt.Container> recurseToChildren)
      • isRunnable

        public static boolean isRunnable​(IType type)
      • fixSwingFocusBugWhenPopupCloses

        public static void fixSwingFocusBugWhenPopupCloses​(java.awt.Component c)
      • showWaitCursor

        public static java.awt.Component showWaitCursor​(boolean bWait)
      • showWaitCursor

        public static void showWaitCursor​(boolean bWait,
                                          java.awt.Component c)
      • doWaitOperation

        public static void doWaitOperation​(java.lang.Runnable op)
      • getFocus

        public static java.awt.Component getFocus()
      • getFocusedWindow

        public static java.awt.Window getFocusedWindow()
      • getActiveWindow

        public static java.awt.Window getActiveWindow()
      • containsFocus

        public static boolean containsFocus​(java.awt.Component c)
      • focusContains

        public static boolean focusContains​(java.awt.Component c)
      • addFocusListener

        private static void addFocusListener()
      • isInFocusLineage

        public static boolean isInFocusLineage​(java.awt.Component c)
      • getXYForDialogRelativeToStudioFrame

        public static java.awt.Point getXYForDialogRelativeToStudioFrame​(int width,
                                                                         int height)
      • hex

        public static java.lang.String hex​(java.awt.Color color)
      • getFontFamilyOrDefault

        public static java.lang.String getFontFamilyOrDefault​(java.lang.String name,
                                                              java.lang.String defaultFont)