-
Notifications
You must be signed in to change notification settings - Fork 4
Coping with long items in Roles combobox
Role, used for Lambda functions has name and ARN. ARN is pretty long and look like following:
arn:aws:iam::01234567891:role/lambda_basic_execution
Together with name it make combobox items very long:
lambda_basic_execution (arn:aws:iam::01234567891:role/lambda_basic_execution)
And the JComboBox gets large width: image
There are few options how this can be implemented more nice.
- Replace the combobox with a textbox or label with a current value and open a popup dialog to change it.
- Extend BasicComboBoxUI and customize its PopUp: workaround in the bug.
- Enlarge the popup size when it is invoked: example.
- Show only short name in the combobox items and display longer text in a tooltip for individual item: example
- Something else?
An option with a dialog is most reliable, but outstanding the current approach - I would keep it as the lest preferable.
An option with extended BasicComboBoxUI did not work well in my case.
An option with the enlarged popup in some reason did not work either. I could enlarge a width of the popup, but not the width of its containing list.
An option I chose for now - displaying tooltips for individual items within the combobox and set the tooltip on the combobox itself. There is an issue, that a tooltip for an item is drawn within the popup boundaries and it is cut, when it's wider. I consider it as a reasonable solution for now.