diff --git a/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java b/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
index 5d23549..5501c96 100644
|
a
|
b
|
|
| 1 | 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others |
| 2 | 2 | package org.openstreetmap.josm.gui.tagging; |
| 3 | 3 | |
| | 4 | import java.awt.Color; |
| 4 | 5 | import static org.openstreetmap.josm.tools.I18n.tr; |
| 5 | 6 | import static org.openstreetmap.josm.tools.I18n.trc; |
| 6 | 7 | import static org.openstreetmap.josm.tools.I18n.trn; |
| 7 | 8 | |
| 8 | 9 | import java.awt.Component; |
| 9 | 10 | import java.awt.Dimension; |
| | 11 | import java.awt.Font; |
| 10 | 12 | import java.awt.GridBagLayout; |
| 11 | 13 | import java.awt.Image; |
| 12 | 14 | import java.awt.Insets; |
| … |
… |
public class TaggingPreset extends AbstractAction implements MapView.LayerChange
|
| 212 | 214 | res.append(value); |
| 213 | 215 | } |
| 214 | 216 | res.append("</b>"); |
| 215 | | if (short_description != null) { |
| | 217 | if (short_description != null && !short_description.startsWith("img:")) { |
| 216 | 218 | // wrap in table to restrict the text width |
| 217 | | res.append("<br><table><td width='232'>(").append(short_description).append(")</td></table>"); |
| | 219 | res.append("<div style=\"width:300px; padding:0 0 5px 5ppx\">").append(short_description).append("</div>"); |
| 218 | 220 | } |
| 219 | 221 | return res.toString(); |
| 220 | 222 | } |
| 221 | 223 | |
| | 224 | public ImageIcon getIcon() { |
| | 225 | if (short_description != null && short_description.startsWith("img:")) { |
| | 226 | return ImageProvider.getIfAvailable(short_description.substring("img:".length())); |
| | 227 | } else { |
| | 228 | return null; |
| | 229 | } |
| | 230 | } |
| | 231 | |
| 222 | 232 | public PresetListEntry(String value) { |
| 223 | 233 | this.value = value; |
| 224 | 234 | this.display_value = value; |
| … |
… |
public class TaggingPreset extends AbstractAction implements MapView.LayerChange
|
| 575 | 585 | protected ListCellRenderer getListCellRenderer() { |
| 576 | 586 | return new ListCellRenderer() { |
| 577 | 587 | |
| 578 | | HtmlPanel lbl = new HtmlPanel(); |
| | 588 | JLabel lbl = new JLabel(); |
| 579 | 589 | JComponent dummy = new JComponent() { |
| 580 | 590 | }; |
| 581 | 591 | |
| … |
… |
public class TaggingPreset extends AbstractAction implements MapView.LayerChange
|
| 594 | 604 | } |
| 595 | 605 | |
| 596 | 606 | PresetListEntry item = (PresetListEntry) value; |
| 597 | | String s = item.getListDisplay(); |
| 598 | | lbl.setText(s); |
| | 607 | lbl.setOpaque(true); |
| | 608 | lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN)); |
| | 609 | lbl.setText("<html>" + item.getListDisplay() + "</html>"); |
| | 610 | lbl.setIcon(item.getIcon()); |
| 599 | 611 | lbl.setEnabled(list.isEnabled()); |
| 600 | 612 | // We do not want the editor to have the maximum height of all |
| 601 | 613 | // entries. Return a dummy with bogus height. |