Changeset 9360 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/QuadStateCheckBox.java
- Timestamp:
- 2016-01-09T20:37:51+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.