Class ComboMultiSelect.ComboMultiSelectListCellRenderer
- java.lang.Object
-
- org.openstreetmap.josm.gui.widgets.JosmListCellRenderer<PresetListEntry>
-
- org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect.ComboMultiSelectListCellRenderer
-
- All Implemented Interfaces:
ListCellRenderer<PresetListEntry>
- Enclosing class:
- ComboMultiSelect
static class ComboMultiSelect.ComboMultiSelectListCellRenderer extends JosmListCellRenderer<PresetListEntry>
A list cell renderer that paints a short text in the current value pane and and a longer text in the dropdown list.
-
-
Constructor Summary
Constructors Constructor Description ComboMultiSelectListCellRenderer(Component component, ListCellRenderer<? super PresetListEntry> renderer, int width, String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JLabel
getListCellRendererComponent(JList<? extends PresetListEntry> list, PresetListEntry value, int index, boolean isSelected, boolean cellHasFocus)
void
setWidth(int width)
Sets the width to format the dropdown list to Note: This is not the width of the list, but the width to which we format any multi-line label in the list.
-
-
-
Constructor Detail
-
ComboMultiSelectListCellRenderer
ComboMultiSelectListCellRenderer(Component component, ListCellRenderer<? super PresetListEntry> renderer, int width, String key)
-
-
Method Detail
-
setWidth
public void setWidth(int width)
Sets the width to format the dropdown list to Note: This is not the width of the list, but the width to which we format any multi-line label in the list. We cannot use the list's width because at the time the combobox measures its items, it is not guaranteed that the list is already sized, the combobox may not even be layed out yet. Set this tocombobox.getWidth()
- Parameters:
width
- the width
-
getListCellRendererComponent
public JLabel getListCellRendererComponent(JList<? extends PresetListEntry> list, PresetListEntry value, int index, boolean isSelected, boolean cellHasFocus)
- Specified by:
getListCellRendererComponent
in interfaceListCellRenderer<PresetListEntry>
- Overrides:
getListCellRendererComponent
in classJosmListCellRenderer<PresetListEntry>
-
-