Class FlatUIDefaultsInspector


  • public class FlatUIDefaultsInspector
    extends java.lang.Object
    A simple UI defaults inspector that shows a window with all UI defaults used in current look and feel.

    To use it in an application install it with:

     FlatUIDefaultsInspector.install( "ctrl shift alt Y" );
     
    This can be done e.g. in the main() method and allows enabling (and disabling) the UI defaults inspector with the given keystroke.
    • Field Detail

      • inspectorFrame

        private static javax.swing.JFrame inspectorFrame
      • lafListener

        private final java.beans.PropertyChangeListener lafListener
      • lafDefaultsListener

        private final java.beans.PropertyChangeListener lafDefaultsListener
      • refreshPending

        private boolean refreshPending
      • derivedColorKeys

        private java.util.Properties derivedColorKeys
      • panel

        private javax.swing.JPanel panel
      • filterPanel

        private javax.swing.JPanel filterPanel
      • filterLabel

        private javax.swing.JLabel filterLabel
      • valueTypeLabel

        private javax.swing.JLabel valueTypeLabel
      • valueTypeField

        private javax.swing.JComboBox<java.lang.String> valueTypeField
      • scrollPane

        private javax.swing.JScrollPane scrollPane
      • table

        private javax.swing.JTable table
      • tablePopupMenu

        private javax.swing.JPopupMenu tablePopupMenu
      • copyKeyMenuItem

        private javax.swing.JMenuItem copyKeyMenuItem
      • copyValueMenuItem

        private javax.swing.JMenuItem copyValueMenuItem
      • copyKeyAndValueMenuItem

        private javax.swing.JMenuItem copyKeyAndValueMenuItem
    • Constructor Detail

      • FlatUIDefaultsInspector

        private FlatUIDefaultsInspector()
    • Method Detail

      • install

        public static void install​(java.lang.String activationKeys)
        Installs a key listener into the application that allows enabling and disabling the UI inspector with the given keystroke (e.g. "ctrl shift alt Y").
        Parameters:
        activationKeys - a keystroke (e.g. "ctrl shift alt Y")
      • show

        public static void show()
      • hide

        public static void hide()
      • createInspectorPanel

        public static javax.swing.JComponent createInspectorPanel()
        Creates a UI defaults inspector panel that can be embedded into any window.
      • createFrame

        private javax.swing.JFrame createFrame()
      • delegateKey

        private void delegateKey​(int keyCode,
                                 java.lang.String actionKey)
      • ensureOnScreen

        private static void ensureOnScreen​(javax.swing.JFrame frame)
      • lafChanged

        private void lafChanged​(java.beans.PropertyChangeEvent e)
      • lafDefaultsChanged

        private void lafDefaultsChanged​(java.beans.PropertyChangeEvent e)
      • refresh

        private void refresh()
      • resolveDerivedColor

        private java.awt.Color resolveDerivedColor​(javax.swing.UIDefaults defaults,
                                                   java.lang.String key,
                                                   java.awt.Color color,
                                                   java.awt.Color[] pBaseColor)
      • loadDerivedColorKeys

        private java.util.Properties loadDerivedColorKeys()
      • updateWindowTitle

        private static void updateWindowTitle​(javax.swing.JFrame frame)
      • saveWindowBounds

        private void saveWindowBounds​(javax.swing.JFrame frame)
      • getPrefs

        private java.util.prefs.Preferences getPrefs()
      • filterChanged

        private void filterChanged()
      • typeOfValue

        private java.lang.String typeOfValue​(java.lang.Object value)
      • tableMousePressed

        private void tableMousePressed​(java.awt.event.MouseEvent e)
      • copyKey

        private void copyKey()
      • copyValue

        private void copyValue()
      • copyKeyAndValue

        private void copyKeyAndValue()
      • copyToClipboard

        private void copyToClipboard​(int column)
      • initComponents

        private void initComponents()