Changeset 9360 in josm
- Timestamp:
- 2016-01-09T20:37:51+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Check.java
r8863 r9360 82 82 check = new QuadStateCheckBox(locale_text, initialState, 83 83 allowedStates.toArray(new QuadStateCheckBox.State[allowedStates.size()])); 84 check.setPropertyText(key); 85 check.setState(check.getState()); // to update the tooltip text 84 86 85 87 p.add(check, GBC.eol().fill(GBC.HORIZONTAL)); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r9231 r9360 321 321 } 322 322 323 p.add(new JLabel(tr("{0}:", locale_text)), GBC.std().insets(0, 0, 10, 0)); 323 final JLabel label = new JLabel(tr("{0}:", locale_text)); 324 label.setToolTipText(getKeyTooltipText()); 325 p.add(label, GBC.std().insets(0, 0, 10, 0)); 324 326 addToPanelAnchor(p, default_, presetInitiallyMatches); 327 component.setToolTipText(getKeyTooltipText()); 325 328 326 329 return true; -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java
r8863 r9360 136 136 public abstract Collection<String> getValues(); 137 137 138 protected String getKeyTooltipText() { 139 return tr("This corresponds to the key ''{0}''", key); 140 } 141 138 142 @Override 139 143 protected Boolean matches(Map<String, String> tags) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r8863 r9360 167 167 value = pnl; 168 168 } 169 p.add(new JLabel(locale_text+':'), GBC.std().insets(0, 0, 10, 0)); 169 final JLabel label = new JLabel(locale_text + ':'); 170 label.setToolTipText(getKeyTooltipText()); 171 p.add(label, GBC.std().insets(0, 0, 10, 0)); 170 172 p.add(value, GBC.eol().fill(GBC.HORIZONTAL)); 173 value.setToolTipText(getKeyTooltipText()); 171 174 return true; 172 175 } -
trunk/src/org/openstreetmap/josm/gui/widgets/QuadStateCheckBox.java
r9059 r9360 95 95 96 96 /** 97 * Sets a text describing this property in the tooltip text 98 * @param propertyText a description for the modelled property 99 */ 100 public final void setPropertyText(final String propertyText) { 101 model.setPropertyText(propertyText); 102 } 103 104 /** 97 105 * Set the new state. 98 106 * @param state The new state … … 121 129 private final class QuadStateDecorator implements ButtonModel { 122 130 private final ButtonModel other; 131 private String propertyText = null; 123 132 124 133 private QuadStateDecorator(ButtonModel other) { … … 131 140 other.setPressed(false); 132 141 other.setSelected(false); 133 setToolTipText(tr("false: the property is explicitly switched off")); 142 setToolTipText(propertyText == null 143 ? tr("false: the property is explicitly switched off") 144 : tr("false: the property ''{0}'' is explicitly switched off", propertyText)); 134 145 } else if (state == State.SELECTED) { 135 146 other.setArmed(false); 136 147 other.setPressed(false); 137 148 other.setSelected(true); 138 setToolTipText(tr("true: the property is explicitly switched on")); 149 setToolTipText(propertyText == null 150 ? tr("true: the property is explicitly switched on") 151 : tr("true: the property ''{0}'' is explicitly switched on", propertyText)); 139 152 } else if (state == State.PARTIAL) { 140 153 other.setArmed(true); 141 154 other.setPressed(true); 142 155 other.setSelected(true); 143 setToolTipText(tr("partial: different selected objects have different values, do not change")); 156 setToolTipText(propertyText == null 157 ? tr("partial: different selected objects have different values, do not change") 158 : tr("partial: different selected objects have different values for ''{0}'', do not change", propertyText)); 144 159 } else { 145 160 other.setArmed(true); 146 161 other.setPressed(true); 147 162 other.setSelected(false); 148 setToolTipText(tr("unset: do not set this property on the selected objects")); 149 } 163 setToolTipText(propertyText == null 164 ? tr("unset: do not set this property on the selected objects") 165 : tr("unset: do not set the property ''{0}'' on the selected objects", propertyText)); 166 } 167 } 168 169 protected void setPropertyText(String propertyText) { 170 this.propertyText = propertyText; 150 171 } 151 172
Note:
See TracChangeset
for help on using the changeset viewer.