A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://plugins.jetbrains.com/docs/intellij/ui-faq.html below:

User Interface FAQ | IntelliJ Platform Plugin SDK

User Interface FAQ

Use UI Inspector to locate the underlying Swing component implementation or to inspect an existing UI at runtime.

Useful Classes Colors

Always use JBColor instead of plain java.awt.Color (highlighted via inspection Plugin DevKit | Code | Use Darcula aware JBColor). Custom colors must be retrieved via JBColor.namedColor() set by the current Theme. See Exposing Theme Metadata on how to expose corresponding metadata.

If it's needed to retrieve a color from one place and use it in another, do not just retrieve once and use the retrieved value. Instead, use JBColor.lazy() and pass in a lambda expression to retrieve the color. This lambda expression needs to be fast and safe enough, as it will be called every time the color is retrieved, for example, for painting. Following this approach ensures that the color will be properly updated if it's changed at the source, for example, due to a theme or scheme change.

Generic UI colors (e.g., for drawing borders) can be accessed via UIUtil and JBUI. A number of hardcoded colors is defined in JBColor, Gray, and LightColors

ColorUtil allows tuning existing colors.

Text

Use NaturalComparator for "natural" sorting of items.

StringUtil contains a number of useful methods for manipulating text for UI usage:

See Internationalization for information about internationalizing plugins.

See NlsMessages to produce localized messages.

"Recently Used" Entries

To store and retrieve values for Recently Used entries (e.g., filter values), use RecentsManager.

Current Theme: Dark or Bright?

To determine the current Theme's style, use JBColor.isBright().

Borders and Insets

Always create borders and insets via factory methods from JBUI.Borders and JBUI.Insets, which create DPI-aware instances. Using standard DPI-agnostic instances (reported by inspection and ) can result in UI layout problems.

If you use DPI-aware insets in an empty border (JBUI.Borders.empty()), then the insets will be updated automatically, for example, if scaling is changed because the action was performed or for any other reason. If you use the insets elsewhere, you need to manually call JBInsets.update() in your component's updateUI() method to update the insets accordingly.

Icons Customizing Existing Icons

Plugins may need to override icons for existing elements, for example, for XML/JSON configuration files related its functionality.

Use FileIconProvider registered in com.intellij.fileIconProvider extension point to provide custom icons for Virtual Files.

For PSI elements, implement IconProvider and register in com.intellij.iconProvider extension point.

Progress Placeholder

LoadingDecorator provides "loading" placeholder panel.

Manipulating Icons

Use IconUtil to scale/colorize/darken/desaturate existing icons as needed.

Combining Icons

Use RowIcon to combine icons horizontally ($modifier$ $element$).

To stack icons, use LayeredIcon. IconWithOverlay additionally allows controlling the shape of the overlay icon.

If a topic is not covered in the above sections, let us know via the Was this page helpful? feedback form below or other channels.

Be specific about the topics and reasons for adding them and leave your email in case we need more details. Thanks for your feedback!

08 May 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4