Last change
on this file since 18221 was 18221, checked in by Don-vip, 3 years ago |
fix #21319 - Refactoring of class hierarchy around JosmComboBox / AutoCompComboBox (patch by marcello):
- Code reuse: JosmComboBox now uses a JosmTextField as editor
- Code reuse: AutoCompComboBox now uses AutoCompTextField as editor
- JosmComboBox uses more of the original L&F
- JosmComboBox lists now expand all the way to the bottom or the top of the screen
- Variable height items in combobox lists now work, see #19321
- Autocomplete uses different algorithm, fix #21290
- editable="false" comboboxes in Presets now work, fix #6157 see #11024 see #18714
- The user may toggle LTR-RTL script in JosmTextField (menu and ctrl+space)
- LTR-RTL automatically toggles according to key in AddTag and EditTag dialogs, fix #16163
|
File size:
934 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.tagging.presets.items;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import javax.swing.JLabel;
|
---|
7 | import javax.swing.JPanel;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport;
|
---|
10 | import org.openstreetmap.josm.tools.GBC;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Used to group optional attributes.
|
---|
14 | * @since 8863
|
---|
15 | */
|
---|
16 | public class Optional extends TextItem {
|
---|
17 |
|
---|
18 | // TODO: Draw a box around optional stuff
|
---|
19 | @Override
|
---|
20 | public boolean addToPanel(JPanel p, TaggingPresetItemGuiSupport support) {
|
---|
21 | JLabel label = new JLabel(locale_text);
|
---|
22 | label.applyComponentOrientation(support.getDefaultComponentOrientation());
|
---|
23 | initializeLocaleText(tr("Optional Attributes:"));
|
---|
24 | p.add(new JLabel(" "), GBC.eol()); // space
|
---|
25 | p.add(label, GBC.eol());
|
---|
26 | p.add(new JLabel(" "), GBC.eol()); // space
|
---|
27 | return false;
|
---|
28 | }
|
---|
29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.