Changeset 6830 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java
- Timestamp:
- 2014-02-10T00:51:53+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java
r6617 r6830 14 14 15 15 /** 16 * A subclass of {@link JPasswordField} to implement a workaround to 16 * A subclass of {@link JPasswordField} to implement a workaround to 17 17 * <a href="https://bugs.openjdk.java.net/browse/JDK-6322854">JDK bug 6322854</a>. 18 18 * This class can be deleted after Oracle decides to fix this bug... 19 * 19 * 20 20 * @since 5752 21 21 * @see <a href="http://josm.openstreetmap.de/ticket/8404">http://josm.openstreetmap.de/ticket/8404</a> … … 35 35 /** 36 36 * Constructs a new <code>JosmPasswordField</code> that uses the 37 * given text storage model and the given number of columns. 37 * given text storage model and the given number of columns. 38 38 * This is the constructor through which the other constructors feed. 39 39 * The echo character is set to '*', but may be changed by the current … … 43 43 * @param doc the text storage to use 44 44 * @param txt the text to be displayed, <code>null</code> if none 45 * @param columns the number of columns to use to calculate 46 * the preferred width >= 0; if columns is set to zero, the45 * @param columns the number of columns to use to calculate 46 * the preferred width >= 0; if columns is set to zero, the 47 47 * preferred width will be whatever naturally results from 48 48 * the component implementation … … 58 58 * is set to <code>null</code>. 59 59 * 60 * @param columns the number of columns >= 061 */ 60 * @param columns the number of columns >= 0 61 */ 62 62 public JosmPasswordField(int columns) { 63 63 super(columns); … … 71 71 * 72 72 * @param text the text to be displayed, <code>null</code> if none 73 * @param columns the number of columns >= 073 * @param columns the number of columns >= 0 74 74 */ 75 75 public JosmPasswordField(String text, int columns) { … … 89 89 workaroundJdkBug6322854(this); 90 90 } 91 91 92 92 /** 93 93 * Implements a workaround to <a href="https://bugs.openjdk.java.net/browse/JDK-6322854">JDK bug 6322854</a>. … … 97 97 if (text != null) { 98 98 text.getActionMap().put("paste", new Action() { 99 99 100 100 private final Action pasteAction = TransferHandler.getPasteAction(); 101 101 102 102 @Override 103 103 public void actionPerformed(ActionEvent e) { … … 110 110 } 111 111 } 112 112 113 113 @Override 114 114 public void setEnabled(boolean b) { 115 115 pasteAction.setEnabled(b); 116 116 } 117 117 118 118 @Override 119 119 public void removePropertyChangeListener(PropertyChangeListener listener) { 120 120 pasteAction.removePropertyChangeListener(listener); 121 121 } 122 122 123 123 @Override 124 124 public void putValue(String key, Object value) { 125 125 pasteAction.putValue(key, value); 126 126 } 127 127 128 128 @Override 129 129 public boolean isEnabled() { 130 130 return pasteAction.isEnabled(); 131 131 } 132 132 133 133 @Override 134 134 public Object getValue(String key) { 135 135 return pasteAction.getValue(key); 136 136 } 137 137 138 138 @Override 139 139 public void addPropertyChangeListener(PropertyChangeListener listener) {
Note:
See TracChangeset
for help on using the changeset viewer.