public interface SBComboBoxRendererAdapter<T>
Strategy interface for rendering items in a custom ComboBox.
The ComboBox creator provides an implementation of SBComboBoxRendererAdapter at creation time to define how items are displayed in both the popup (list view) and the selected (collapsed) view.
Typical use cases:
Provide an implementation (e.g., via lambda or anonymous class) to the ComboBox when constructing it. This allows flexible rendering logic for any item type.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public java.lang.String |
getDescription(T t)Returns an optional description for this item. |
|
public java.lang.String |
getDisplayText(T t)Returns the main text label for this item. |
|
public javax.swing.Icon |
getIcon(T t)Returns an optional icon associated with this item. |
|
public java.lang.String |
getPlaceholderText() |
|
public boolean |
isEnabled(T t) |
|
public boolean |
isProFeature(T t)Determines whether this item is a pro-only feature that requires a valid license. |
|
public boolean |
shouldShowDescriptionInPopup(T t)Determines whether this item should display its description in the dropdown popup list. |
Returns an optional description for this item.
The description is typically shown only in the popup list view, providing more context about the option.
null if not applicableReturns the main text label for this item.
This value is always shown in the ComboBox when the item is selected.
nullReturns an optional icon associated with this item.
If present, the ComboBox renderer can display it alongside the text.
null if no icon should be shownDetermines whether this item is a pro-only feature that requires a valid license.
This can be used to display a pro icon or disable the item if no valid license is present.
true if this item requires a pro license, false otherwiseDetermines whether this item should display its description in the dropdown popup list.
This can be useful if only certain items require additional context when the user is browsing options.
true if description should be shown in the list, false otherwise