Class UIManager

java.lang.Object
vaadinx.swing.UIManager
All Implemented Interfaces:
Serializable

public class UIManager extends Object implements Serializable
Port of UIManager. Path 2 (external) of the icon-rendering plan: a hand-picked lookup table maps the OptionPane.* icon keys to VaadinIcon glyphs via VaadinIconAdapter, so dialog-heavy migrated code that pulls icons by key (e.g. JOptionPane.showMessageDialog(parent, msg, "title", PLAIN_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"))) reaches the same Vaadin glyph the JOptionPane static-factory path picks internally.

L&F machinery is permanently out of scope per R_match_swing_errors sub-bucket (b); UIDefaults, LookAndFeel install/lookup, and the addPropertyChangeListener surface aren't ported. The other typed-getter family (getColor(Object), getFont(Object), ...) compiles for import-swap but stubs through EHelper.onUnimplemented(String, String, Object...) so call sites surface in migration logs rather than fail to compile.

Unknown icon keys log via EHelper.onUnimplemented(String, String, Object...) and return null, matching the JDK contract that UIManager.getIcon may return null for un-installed keys.

The supported key set today is the four OptionPane.* messageType icons. Adding more keys is purely additive — wire a new entry in ICON_KEYS when a future component needs the L&F-key shape (e.g. FileChooser.directoryIcon, Tree.openIcon). Doing so preemptively violates R_infra_not_surface.

See Also:
  • Constructor Details

    • UIManager

      public UIManager()
      Public no-arg ctor, mirroring JDK shape. UIManager is used statically; no instance state.
  • Method Details

    • getIcon

      public static Icon getIcon(Object key)
    • getIcon

      public static Icon getIcon(Object key, Locale locale)
    • get

      public static Object get(Object key)
    • get

      public static Object get(Object key, Locale locale)
    • getString

      public static String getString(Object key)
    • getString

      public static String getString(Object key, Locale locale)
    • getInt

      public static int getInt(Object key)
    • getInt

      public static int getInt(Object key, Locale locale)
    • getBoolean

      public static boolean getBoolean(Object key)
    • getBoolean

      public static boolean getBoolean(Object key, Locale locale)
    • getColor

      public static Color getColor(Object key)
      Answers from LookAndFeelDefaults' Metal table for the colour keys it covers, and keeps the WARN for the rest.

      The returned instance is a ColorUIResource, which is load-bearing rather than incidental: passing it straight back into setBackground is how a migrated app says "reset me to the default", and the marker is what makes that render as the theme's colour instead of as a pinned literal (D_theme_is_lookandfeel).

    • getColor

      public static Color getColor(Object key, Locale locale)
    • getFont

      public static Font getFont(Object key)
    • getFont

      public static Font getFont(Object key, Locale locale)
    • getInsets

      public static Insets getInsets(Object key)
    • getInsets

      public static Insets getInsets(Object key, Locale locale)
    • getDimension

      public static Dimension getDimension(Object key)
    • getDimension

      public static Dimension getDimension(Object key, Locale locale)
    • getBorder

      public static Border getBorder(Object key)
    • getBorder

      public static Border getBorder(Object key, Locale locale)
    • put

      public static Object put(Object key, Object value)
    • getLookAndFeel

      public static String getLookAndFeel()
    • setLookAndFeel

      public static void setLookAndFeel(String className)
    • getSystemLookAndFeelClassName

      public static String getSystemLookAndFeelClassName()
    • getCrossPlatformLookAndFeelClassName

      public static String getCrossPlatformLookAndFeelClassName()