Changeset 4918 in josm for trunk/src/org/openstreetmap/josm/command/PseudoCommand.java
- Timestamp:
- 2012-02-11T18:56:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/PseudoCommand.java
r3479 r4918 3 3 4 4 import java.util.Collection; 5 import javax.swing.Icon; 6 import javax.swing.JLabel; 5 7 6 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 14 16 /** 15 17 * Provide a description that can be presented in a list or tree view. 18 * @deprecated This abstract method is deprecated. 19 * On 2012-03-01, this abstract method will be removed. 20 * At the same moment, the methods {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()} 21 * will be made abstract. 22 * For a smooth transition, replace {@link #getDescription()} by implementations of 23 * {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()} as early as possible. 24 * {@link #getDescription()} is no longer abstract and can therefore be removed. 16 25 */ 17 abstract public Object getDescription(); 26 @Deprecated 27 public Object getDescription() { 28 return null; 29 } 30 31 /** 32 * Provides a description text representing this command. 33 */ 34 public String getDescriptionText() { 35 Object o = getDescription(); 36 if (o instanceof JLabel) { 37 return ((JLabel) o).getText(); 38 } else { 39 return o.toString(); 40 } 41 } 42 43 /** 44 * Provides a descriptive icon of this command. 45 */ 46 public Icon getDescriptionIcon() { 47 Object o = getDescription(); 48 if (o instanceof JLabel) { 49 return ((JLabel) o).getIcon(); 50 } else { 51 return null; 52 } 53 } 18 54 19 55 /**
Note:
See TracChangeset
for help on using the changeset viewer.