Ticket #4429: textfield.patch

File textfield.patch, 51.0 KB (added by anonymous, 12 years ago)

Patch for context menu

  • src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

     
    5858import javax.swing.JScrollPane;
    5959import javax.swing.JSeparator;
    6060import javax.swing.JTable;
    61 import javax.swing.JTextField;
     61//import javax.swing.JTextField;
    6262import javax.swing.JToolBar;
    6363import javax.swing.KeyStroke;
    6464import javax.swing.ListCellRenderer;
     
    9191import org.openstreetmap.josm.tools.LanguageInfo;
    9292import org.openstreetmap.josm.tools.Utils;
    9393import org.xml.sax.SAXException;
     94import org.openstreetmap.josm.gui.MyTextField;
    9495
    9596public abstract class SourceEditor extends JPanel {
    9697
     
    679680
    680681    protected class EditSourceEntryDialog extends ExtendedDialog {
    681682
    682         private JTextField tfTitle;
    683         private JTextField tfURL;
     683        private MyTextField tfTitle;
     684        private MyTextField tfURL;
    684685        private JCheckBox cbActive;
    685686
    686687        public EditSourceEntryDialog(Component parent, String title, SourceEntry e) {
     
    690691
    691692            JPanel p = new JPanel(new GridBagLayout());
    692693
    693             tfTitle = new JTextField(60);
     694            tfTitle = new MyTextField(60);
    694695            p.add(new JLabel(tr("Name (optional):")), GBC.std().insets(15, 0, 5, 5));
    695696            p.add(tfTitle, GBC.eol().insets(0, 0, 5, 5));
    696697
    697             tfURL = new JTextField(60);
     698            tfURL = new MyTextField(60);
    698699            p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0));
    699700            p.add(tfURL, GBC.std().insets(0, 0, 5, 5));
    700701            JButton fileChooser = new JButton(new LaunchFileChooserAction());
     
    13241325    }
    13251326
    13261327    class FileOrUrlCellEditor extends JPanel implements TableCellEditor {
    1327         private JTextField tfFileName;
     1328        private MyTextField tfFileName;
    13281329        private CopyOnWriteArrayList<CellEditorListener> listeners;
    13291330        private String value;
    13301331        private boolean isFile;
     
    13401341            gc.fill = GridBagConstraints.BOTH;
    13411342            gc.weightx = 1.0;
    13421343            gc.weighty = 1.0;
    1343             add(tfFileName = new JTextField(), gc);
     1344            add(tfFileName = new MyTextField(), gc);
    13441345
    13451346            gc.gridx = 1;
    13461347            gc.gridy = 0;
  • src/org/openstreetmap/josm/gui/MapStatus.java

     
    3333import javax.swing.JPanel;
    3434import javax.swing.JProgressBar;
    3535import javax.swing.JScrollPane;
    36 import javax.swing.JTextField;
     36//import javax.swing.JTextField;
    3737import javax.swing.Popup;
    3838import javax.swing.PopupFactory;
    3939import javax.swing.UIManager;
     
    4949import org.openstreetmap.josm.gui.util.GuiHelper;
    5050import org.openstreetmap.josm.tools.GBC;
    5151import org.openstreetmap.josm.tools.ImageProvider;
     52import org.openstreetmap.josm.gui.MyTextField;
    5253
    5354/**
    5455 * A component that manages some status information display about the map.
     
    150151
    151152    final ImageLabel lonText = new ImageLabel("lon", tr("The geographic longitude at the mouse pointer."), 11);
    152153    final ImageLabel nameText = new ImageLabel("name", tr("The name of the object at the mouse pointer."), 20);
    153     final JTextField helpText = new JTextField();
     154    final MyTextField helpText = new MyTextField();
    154155    final ImageLabel latText = new ImageLabel("lat", tr("The geographic latitude at the mouse pointer."), 11);
    155156    final ImageLabel angleText = new ImageLabel("angle", tr("The angle between the previous and the current way segment."), 6);
    156157    final ImageLabel headingText = new ImageLabel("heading", tr("The (compass) heading of the line segment being drawn."), 6);
  • src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java

     
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.widgets;
    33
    4 import javax.swing.JTextField;
     4//import javax.swing.JTextField;
    55import javax.swing.text.JTextComponent;
    66
     7import org.openstreetmap.josm.gui.MyTextField;
    78import org.openstreetmap.josm.tools.Utils;
    89
    910/**
     
    1213 * @param <T> The ID validator class
    1314 * @since 5765
    1415 */
    15 public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JTextField {
     16public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends MyTextField {
    1617
    1718    protected final T validator;
    1819
  • src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java

     
    1111import javax.swing.Action;
    1212import javax.swing.JMenu;
    1313import javax.swing.JMenuItem;
    14 import javax.swing.JTextField;
     14//import javax.swing.JTextField;
    1515import javax.swing.KeyStroke;
    1616import javax.swing.text.Document;
    1717
     
    1919import org.openstreetmap.josm.actions.JosmAction;
    2020import org.openstreetmap.josm.tools.Pair;
    2121import org.openstreetmap.josm.tools.Shortcut;
     22import org.openstreetmap.josm.gui.MyTextField;
    2223
    2324/**
    2425 * A JTextField that disabled all JOSM shortcuts composed of a single key without modifier (except F1 to F12),
     
    2627 * This allows to include text fields in toggle dialogs (needed for relation filter).
    2728 * @since 5696
    2829 */
    29 public class DisableShortcutsOnFocusGainedTextField extends JTextField implements FocusListener {
     30public class DisableShortcutsOnFocusGainedTextField extends MyTextField implements FocusListener {
    3031
    3132    /**
    3233     * Constructs a new <code>TextField</code>.  A default model is created,
  • src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java

     
    1010import java.beans.PropertyChangeListener;
    1111
    1212import javax.swing.BorderFactory;
    13 import javax.swing.JTextField;
     13//import javax.swing.JTextField;
    1414import javax.swing.UIManager;
    1515import javax.swing.border.Border;
    1616import javax.swing.event.DocumentEvent;
     
    1919
    2020import org.openstreetmap.josm.tools.CheckParameterUtil;
    2121import org.openstreetmap.josm.tools.Utils;
     22import org.openstreetmap.josm.gui.MyTextField;
    2223
    2324/**
    2425 * This is an abstract class for a validator on a text component.
     
    109110            tc.getDocument().addDocumentListener(this);
    110111        }
    111112        if (addActionListener) {
    112             if (tc instanceof JTextField) {
    113                 JTextField tf = (JTextField)tc;
     113            if (tc instanceof MyTextField) {
     114                MyTextField tf = (MyTextField)tc;
    114115                tf.addActionListener(this);
    115116            }
    116117        }
  • src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java

     
    1818import javax.swing.JLabel;
    1919import javax.swing.JPanel;
    2020import javax.swing.JPopupMenu;
    21 import javax.swing.JTextField;
     21//import javax.swing.JTextField;
    2222import javax.swing.event.DocumentEvent;
    2323import javax.swing.event.DocumentListener;
    2424import javax.swing.text.JTextComponent;
     
    3131import org.openstreetmap.josm.tools.ImageProvider;
    3232import org.openstreetmap.josm.tools.OsmUrlToBounds;
    3333import org.openstreetmap.josm.tools.Utils;
     34import org.openstreetmap.josm.gui.MyTextField;
    3435
    3536/**
    3637 *
     
    3839 */
    3940public class BoundingBoxSelectionPanel extends JPanel {
    4041
    41     private JTextField[] tfLatLon = null;
    42     private final JTextField tfOsmUrl = new JTextField();
     42    private MyTextField[] tfLatLon = null;
     43    private final MyTextField tfOsmUrl = new MyTextField();
    4344
    4445    protected void buildInputFields() {
    45         tfLatLon = new JTextField[4];
     46        tfLatLon = new MyTextField[4];
    4647        for(int i=0; i< 4; i++) {
    47             tfLatLon[i] = new JTextField(11);
    48             tfLatLon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
     48            tfLatLon[i] = new MyTextField(11);
     49            tfLatLon[i].setMinimumSize(new Dimension(100,new MyTextField().getMinimumSize().height));
    4950            SelectAllOnFocusGainedDecorator.decorate(tfLatLon[i]);
    5051        }
    5152        LatitudeValidator.decorate(tfLatLon[0]);
  • src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

     
    3232import javax.swing.JLabel;
    3333import javax.swing.JPanel;
    3434import javax.swing.JSpinner;
    35 import javax.swing.JTextField;
     35//import javax.swing.JTextField;
    3636import javax.swing.KeyStroke;
    3737import javax.swing.SpinnerNumberModel;
    3838import javax.swing.event.ChangeEvent;
     
    4949import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    5050import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    5151import org.openstreetmap.josm.tools.ImageProvider;
     52import org.openstreetmap.josm.gui.MyTextField;
    5253
    5354/**
    5455 * TileSelectionBBoxChooser allows to select a bounding box (i.e. for downloading) based
     
    209210    static private class TileGridInputPanel extends JPanel implements PropertyChangeListener{
    210211        static public final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds";
    211212
    212         private JTextField tfMaxY;
    213         private JTextField tfMinY;
    214         private JTextField tfMaxX;
    215         private JTextField tfMinX;
     213        private MyTextField tfMaxY;
     214        private MyTextField tfMinY;
     215        private MyTextField tfMaxX;
     216        private MyTextField tfMinX;
    216217        private TileCoordinateValidator valMaxY;
    217218        private TileCoordinateValidator valMinY;
    218219        private TileCoordinateValidator valMaxX;
     
    266267
    267268            gc.gridx = 1;
    268269            gc.weightx = 0.5;
    269             pnl.add(tfMinX = new JTextField(), gc);
     270            pnl.add(tfMinX = new MyTextField(), gc);
    270271            valMinX = new TileCoordinateValidator(tfMinX);
    271272            SelectAllOnFocusGainedDecorator.decorate(tfMinX);
    272273            tfMinX.addActionListener(tileBoundsBuilder);
     
    274275
    275276            gc.gridx = 2;
    276277            gc.weightx = 0.5;
    277             pnl.add(tfMaxX = new JTextField(), gc);
     278            pnl.add(tfMaxX = new MyTextField(), gc);
    278279            valMaxX = new TileCoordinateValidator(tfMaxX);
    279280            SelectAllOnFocusGainedDecorator.decorate(tfMaxX);
    280281            tfMaxX.addActionListener(tileBoundsBuilder);
     
    287288
    288289            gc.gridx = 1;
    289290            gc.weightx = 0.5;
    290             pnl.add(tfMinY = new JTextField(), gc);
     291            pnl.add(tfMinY = new MyTextField(), gc);
    291292            valMinY = new TileCoordinateValidator(tfMinY);
    292293            SelectAllOnFocusGainedDecorator.decorate(tfMinY);
    293294            tfMinY.addActionListener(tileBoundsBuilder);
     
    295296
    296297            gc.gridx = 2;
    297298            gc.weightx = 0.5;
    298             pnl.add(tfMaxY = new JTextField(), gc);
     299            pnl.add(tfMaxY = new MyTextField(), gc);
    299300            valMaxY = new TileCoordinateValidator(tfMaxY);
    300301            SelectAllOnFocusGainedDecorator.decorate(tfMaxY);
    301302            tfMaxY.addActionListener(tileBoundsBuilder);
     
    427428
    428429        static public final String TILE_BOUNDS_PROP = TileAddressInputPanel.class.getName() + ".tileBounds";
    429430
    430         private JTextField tfTileAddress;
     431        private MyTextField tfTileAddress;
    431432        private TileAddressValidator valTileAddress;
    432433
    433434        protected JPanel buildTextPanel() {
     
    451452
    452453            gc.weightx = 1.0;
    453454            gc.gridx = 1;
    454             pnl.add(tfTileAddress = new JTextField(), gc);
     455            pnl.add(tfTileAddress = new MyTextField(), gc);
    455456            valTileAddress = new TileAddressValidator(tfTileAddress);
    456457            SelectAllOnFocusGainedDecorator.decorate(tfTileAddress);
    457458
  • src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java

     
    77
    88import javax.swing.AbstractCellEditor;
    99import javax.swing.JTable;
    10 import javax.swing.JTextField;
     10//import javax.swing.JTextField;
    1111import javax.swing.table.TableCellEditor;
    1212
    1313import org.openstreetmap.josm.data.osm.RelationMember;
     14import org.openstreetmap.josm.gui.MyTextField;
    1415
     16
    1517/**
    1618 * {@link TableCellEditor} for the role column in a table for {@link RelationMember}s.
    1719 *
    1820 */
    1921public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{
    2022
    21     private final JTextField editor;
     23    private final MyTextField editor;
    2224
    2325    public RelationMemberTableCellEditor() {
    24         editor = new JTextField();
     26        editor = new MyTextField();
    2527        editor.addFocusListener(
    2628                new FocusAdapter() {
    2729                    @Override
  • src/org/openstreetmap/josm/gui/download/PlaceSelection.java

     
    6060import org.xml.sax.InputSource;
    6161import org.xml.sax.SAXException;
    6262import org.xml.sax.helpers.DefaultHandler;
     63import org.openstreetmap.josm.gui.MyTextField;
    6364
    6465public class PlaceSelection implements DownloadSelection {
    6566    private static final String HISTORY_KEY = "download.places.history";
  • src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

     
    2121import javax.swing.JLabel;
    2222import javax.swing.JOptionPane;
    2323import javax.swing.JPanel;
    24 import javax.swing.JTextField;
     24//import javax.swing.JTextField;
    2525import javax.swing.KeyStroke;
    2626import javax.swing.border.EtchedBorder;
    2727import javax.swing.plaf.basic.BasicComboBoxEditor;
     
    3535import org.openstreetmap.josm.gui.widgets.OsmIdTextField;
    3636import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
    3737import org.openstreetmap.josm.tools.Utils;
     38import org.openstreetmap.josm.gui.MyTextField;
    3839
    3940/**
    4041 * Dialog prompt to user to let him choose OSM primitives to download by specifying their type and IDs
     
    8182       
    8283        cbId.setEditor(new BasicComboBoxEditor() {
    8384            @Override
    84             protected JTextField createEditorComponent() {
     85            protected MyTextField createEditorComponent() {
    8586                return tfId;
    8687            }
    8788        });
  • src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

     
    2323import javax.swing.JPanel;
    2424import javax.swing.JPopupMenu;
    2525import javax.swing.JTextArea;
    26 import javax.swing.JTextField;
     26//import javax.swing.JTextField;
    2727import javax.swing.UIManager;
    2828import javax.swing.border.Border;
    2929import javax.swing.event.DocumentEvent;
     
    3737import org.openstreetmap.josm.tools.ImageProvider;
    3838import org.openstreetmap.josm.tools.OsmUrlToBounds;
    3939import org.openstreetmap.josm.tools.Utils;
     40import org.openstreetmap.josm.gui.MyTextField;
    4041
    4142/**
    4243 * Bounding box selector.
     
    4849 */
    4950public class BoundingBoxSelection implements DownloadSelection {
    5051
    51     private JTextField[] latlon = null;
     52    private MyTextField[] latlon = null;
    5253    private final JTextArea tfOsmUrl = new JTextArea();
    5354    private final JTextArea showUrl = new JTextArea();
    5455    private DownloadDialog parent;
     
    6263    }
    6364
    6465    protected void buildDownloadAreaInputFields() {
    65         latlon = new JTextField[4];
     66        latlon = new MyTextField[4];
    6667        for(int i=0; i< 4; i++) {
    67             latlon[i] = new JTextField(11);
    68             latlon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
     68            latlon[i] = new MyTextField(11);
     69            latlon[i].setMinimumSize(new Dimension(100,new MyTextField().getMinimumSize().height));
    6970            latlon[i].addFocusListener(new SelectAllOnFocusHandler(latlon[i]));
    7071        }
    7172        LatValueChecker latChecker = new LatValueChecker(latlon[0]);
     
    190191        latlon[1].setText(area.getMin().lonToString(CoordinateFormat.DECIMAL_DEGREES));
    191192        latlon[2].setText(area.getMax().latToString(CoordinateFormat.DECIMAL_DEGREES));
    192193        latlon[3].setText(area.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES));
    193         for (JTextField tf: latlon) {
     194        for (MyTextField tf: latlon) {
    194195            resetErrorMessage(tf);
    195196        }
    196197    }
     
    202203
    203204    private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
    204205
    205     protected void setErrorMessage(JTextField tf, String msg) {
     206    protected void setErrorMessage(MyTextField tf, String msg) {
    206207        tf.setBorder(errorBorder);
    207208        tf.setToolTipText(msg);
    208209    }
    209210
    210     protected void resetErrorMessage(JTextField tf) {
     211    protected void resetErrorMessage(MyTextField tf) {
    211212        tf.setBorder(UIManager.getBorder("TextField.border"));
    212213        tf.setToolTipText("");
    213214    }
    214215
    215216    class LatValueChecker extends FocusAdapter implements ActionListener{
    216         private JTextField tfLatValue;
     217        private MyTextField tfLatValue;
    217218
    218         public LatValueChecker(JTextField tfLatValue) {
     219        public LatValueChecker(MyTextField tfLatValue) {
    219220            this.tfLatValue = tfLatValue;
    220221        }
    221222
     
    245246    }
    246247
    247248    class LonValueChecker extends FocusAdapter implements ActionListener {
    248         private JTextField tfLonValue;
     249        private MyTextField tfLonValue;
    249250
    250         public LonValueChecker(JTextField tfLonValue) {
     251        public LonValueChecker(MyTextField tfLonValue) {
    251252            this.tfLonValue = tfLonValue;
    252253        }
    253254
  • src/org/openstreetmap/josm/gui/MainApplet.java

     
    2222import javax.swing.JOptionPane;
    2323import javax.swing.JPanel;
    2424import javax.swing.JPasswordField;
    25 import javax.swing.JTextField;
     25//import javax.swing.JTextField;
    2626
    2727import org.openstreetmap.josm.Main;
    2828import org.openstreetmap.josm.actions.JosmAction;
     
    3232import org.openstreetmap.josm.tools.GBC;
    3333import org.openstreetmap.josm.tools.I18n;
    3434import org.openstreetmap.josm.tools.Shortcut;
     35import org.openstreetmap.josm.gui.MyTextField;
    3536
    3637public class MainApplet extends JApplet {
    3738
     
    112113                JPanel p = new JPanel(new GridBagLayout());
    113114                p.add(new JLabel(tr(e.realm)), GBC.eol().fill(GBC.HORIZONTAL));
    114115                p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0));
    115                 JTextField user = new JTextField(username == null ? "" : username);
     116                MyTextField user = new MyTextField(username == null ? "" : username);
    116117                p.add(user, GBC.eol().fill(GBC.HORIZONTAL));
    117118                p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0));
    118119                JPasswordField pass = new JosmPasswordField(password == null ? "" : password);
  • src/org/openstreetmap/josm/gui/MyTextField.java

     
     1package org.openstreetmap.josm.gui;
     2
     3import java.awt.*;
     4import java.awt.event.*;
     5
     6import javax.swing.*;
     7import javax.swing.event.*;
     8import javax.swing.text.*;
     9import javax.swing.undo.*;
     10
     11public class MyTextField extends JTextField {
     12    private JPopupMenu contextMenu;
     13    private UndoManager undoManager;
     14
     15    public MyTextField(Document doc, String text, int columns){
     16        super(doc, text, columns);
     17        init();
     18    }
     19
     20    public MyTextField(String text, int columns){
     21        super(text, columns);
     22        init();
     23    }
     24
     25    public MyTextField(String text){
     26        super(text);
     27        init();
     28    }
     29
     30    public MyTextField(int columns){
     31        super(columns);
     32        init();
     33    }
     34   
     35    public MyTextField() {
     36        super();
     37        init();
     38    }
     39
     40    private void init(){
     41        undoManager = new UndoManager();
     42        contextMenu = new JPopupMenu();
     43        UndoAction undoAction = new UndoAction();
     44        addToContextMenu("Paste",      DefaultEditorKit.pasteAction);
     45        contextMenu.addSeparator();
     46        contextMenu.add(new JMenuItem(undoAction));
     47        getDocument().addUndoableEditListener(undoAction);
     48        contextMenu.addSeparator();
     49        addToContextMenu("Cut",        DefaultEditorKit.cutAction);
     50        addToContextMenu("Copy",       DefaultEditorKit.copyAction);
     51        addToContextMenu("Delete",     DefaultEditorKit.deleteNextCharAction);
     52        contextMenu.addSeparator();
     53        addToContextMenu("Select All", DefaultEditorKit.selectAllAction);
     54
     55        addMouseListener(new MouseAdapter() {
     56            public void mousePressed(MouseEvent e) {
     57                if (e.getButton() == MouseEvent.BUTTON3) {
     58                    contextMenu.show(MyTextField.this, e.getX(), e.getY());
     59                }
     60            }
     61        });
     62    }
     63
     64    private void addToContextMenu(String label, String actionName) {
     65        Action action = getActionMap().get(actionName);
     66        if (action != null) {
     67            JMenuItem mi = new JMenuItem(action);
     68            mi.setText(label);
     69            contextMenu.add(mi);
     70        }
     71    }
     72
     73
     74    class UndoAction extends AbstractAction implements UndoableEditListener {
     75        public UndoAction() {
     76            super("Undo");
     77            setEnabled(false);
     78        }
     79         
     80        public void undoableEditHappened(UndoableEditEvent e) {
     81            undoManager.addEdit(e.getEdit());
     82            setEnabled(undoManager.canUndo());
     83        }
     84
     85        public void actionPerformed(ActionEvent e) {
     86            try {
     87                undoManager.undo();
     88            } catch (CannotUndoException ex) {
     89            }
     90            setEnabled(undoManager.canUndo());
     91        }
     92    }   
     93
     94/*
     95   public static void main(String[] args) {
     96        JFrame frame = new JFrame();
     97        JTextField tf = new MyTextField();
     98        frame.getContentPane().add(tf);
     99        frame.pack();
     100        frame.setLocation(200, 200);
     101        frame.setVisible(true);
     102    }
     103*/
     104}
  • src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java

     
    3030import javax.swing.JList;
    3131import javax.swing.JPanel;
    3232import javax.swing.JScrollPane;
    33 import javax.swing.JTextField;
     33//import javax.swing.JTextField;
    3434import javax.swing.event.DocumentEvent;
    3535import javax.swing.event.DocumentListener;
    3636
     
    4949import org.openstreetmap.josm.gui.tagging.TaggingPreset.PresetType;
    5050import org.openstreetmap.josm.gui.tagging.TaggingPreset.Role;
    5151import org.openstreetmap.josm.gui.tagging.TaggingPreset.Roles;
     52import org.openstreetmap.josm.gui.MyTextField;
    5253
     54
    5355public class TaggingPresetSearchDialog extends ExtendedDialog implements SelectionChangedListener {
    5456
    5557    private static final int CLASSIFICATION_IN_FAVORITES = 300;
     
    191193        return instance;
    192194    }
    193195
    194     private JTextField edSearchText;
     196    private MyTextField edSearchText;
    195197    private JList lsResult;
    196198    private JCheckBox ckOnlyApplicable;
    197199    private JCheckBox ckSearchInTags;
     
    238240        JPanel content = new JPanel();
    239241        content.setLayout(new BorderLayout());
    240242
    241         edSearchText = new JTextField();
     243        edSearchText = new MyTextField();
    242244        edSearchText.getDocument().addDocumentListener(new DocumentListener() {
    243245
    244246            @Override
  • src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java

     
    1010
    1111import javax.swing.ComboBoxEditor;
    1212import javax.swing.JTable;
    13 import javax.swing.JTextField;
     13//import javax.swing.JTextField;
    1414import javax.swing.event.CellEditorListener;
    1515import javax.swing.table.TableCellEditor;
    1616import javax.swing.text.AttributeSet;
     
    2121
    2222import org.openstreetmap.josm.Main;
    2323import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
     24import org.openstreetmap.josm.gui.MyTextField;
    2425
     26
    2527/**
    2628 * AutoCompletingTextField is an text field with autocompletion behaviour. It
    2729 * can be used as table cell editor in {@link JTable}s.
     
    3133 *
    3234 *
    3335 */
    34 public class AutoCompletingTextField extends JTextField implements ComboBoxEditor, TableCellEditor {
     36public class AutoCompletingTextField extends MyTextField implements ComboBoxEditor, TableCellEditor {
    3537
    3638    private Integer maxChars;
    3739   
  • src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

     
    4545import javax.swing.JOptionPane;
    4646import javax.swing.JPanel;
    4747import javax.swing.JScrollPane;
    48 import javax.swing.JTextField;
     48//import javax.swing.JTextField;
    4949import javax.swing.JToggleButton;
    5050import javax.swing.ListCellRenderer;
    5151import javax.swing.ListModel;
     
    9191import org.openstreetmap.josm.tools.template_engine.TemplateEntry;
    9292import org.openstreetmap.josm.tools.template_engine.TemplateParser;
    9393import org.xml.sax.SAXException;
     94import org.openstreetmap.josm.gui.MyTextField;
    9495
     96
    9597/**
    9698 * This class read encapsulate one tagging preset. A class method can
    9799 * read in all predefined presets, either shipped with JOSM or that are
     
    521523        private static String getValue(Component comp) {
    522524            if (comp instanceof JosmComboBox) {
    523525                return ((JosmComboBox) comp).getEditor().getItem().toString();
    524             } else if (comp instanceof JTextField) {
    525                 return ((JTextField) comp).getText();
     526            } else if (comp instanceof MyTextField) {
     527                return ((MyTextField) comp).getText();
    526528            } else if (comp instanceof JPanel) {
    527529                return getValue(((JPanel)comp).getComponent(0));
    528530            } else {
  • src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

     
    2525import javax.swing.JPanel;
    2626import javax.swing.JSeparator;
    2727import javax.swing.JTabbedPane;
    28 import javax.swing.JTextField;
     28//import javax.swing.JTextField;
    2929import javax.swing.UIManager;
    3030import javax.swing.event.ChangeEvent;
    3131import javax.swing.event.ChangeListener;
    3232import javax.swing.event.DocumentEvent;
    3333import javax.swing.event.DocumentListener;
    3434
     35import org.openstreetmap.josm.gui.MyTextField;
     36
    3537import org.openstreetmap.josm.Main;
    3638import org.openstreetmap.josm.data.coor.CoordinateFormat;
    3739import org.openstreetmap.josm.data.coor.EastNorth;
     
    4648    private static final Color BG_COLOR_ERROR = new Color(255,224,224);
    4749
    4850    public JTabbedPane tabs;
    49     private JTextField tfLatLon, tfEastNorth;
     51    private MyTextField tfLatLon, tfEastNorth;
    5052    private LatLon latLonCoordinates;
    5153    private EastNorth eastNorthCoordinates;
    5254
     
    7678        pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    7779
    7880        pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0));
    79         tfLatLon = new JTextField(24);
     81        tfLatLon = new MyTextField(24);
    8082        pnl.add(tfLatLon, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
    8183
    8284        pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5));
     
    128130        pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    129131
    130132        pnl.add(new JLabel(tr("Projected coordinates:")), GBC.std().insets(0,10,5,0));
    131         tfEastNorth = new JTextField(24);
     133        tfEastNorth = new MyTextField(24);
    132134
    133135        pnl.add(tfEastNorth, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
    134136
     
    207209        return eastNorthCoordinates;
    208210    }
    209211
    210     protected void setErrorFeedback(JTextField tf, String message) {
     212    protected void setErrorFeedback(MyTextField tf, String message) {
    211213        tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
    212214        tf.setToolTipText(message);
    213215        tf.setBackground(BG_COLOR_ERROR);
    214216    }
    215217
    216     protected void clearErrorFeedback(JTextField tf, String message) {
     218    protected void clearErrorFeedback(MyTextField tf, String message) {
    217219        tf.setBorder(UIManager.getBorder("TextField.border"));
    218220        tf.setToolTipText(message);
    219221        tf.setBackground(UIManager.getColor("TextField.background"));
     
    328330    static class TextFieldFocusHandler implements FocusListener {
    329331        public void focusGained(FocusEvent e) {
    330332            Component c = e.getComponent();
    331             if (c instanceof JTextField) {
    332                 JTextField tf = (JTextField)c;
     333            if (c instanceof MyTextField) {
     334                MyTextField tf = (MyTextField)c;
    333335                tf.selectAll();
    334336            }
    335337        }
  • src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java

     
    1515import javax.swing.BorderFactory;
    1616import javax.swing.JLabel;
    1717import javax.swing.JPanel;
    18 import javax.swing.JTextField;
     18//import javax.swing.JTextField;
    1919import javax.swing.event.DocumentEvent;
    2020import javax.swing.event.DocumentListener;
    2121import javax.swing.event.HyperlinkEvent;
     
    2626import org.openstreetmap.josm.io.OsmApi;
    2727import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
    2828import org.openstreetmap.josm.tools.ImageProvider;
     29import org.openstreetmap.josm.gui.MyTextField;
    2930
    3031
    3132public class UrlBasedQueryPanel extends JPanel {
    3233
    33     private JTextField tfUrl;
     34    private MyTextField tfUrl;
    3435    private JLabel lblValid;
    3536
    3637    protected JPanel buildURLPanel() {
     
    4445        gc.gridx = 1;
    4546        gc.weightx = 1.0;
    4647        gc.fill = GridBagConstraints.HORIZONTAL;
    47         pnl.add(tfUrl = new JTextField(), gc);
     48        pnl.add(tfUrl = new MyTextField(), gc);
    4849        tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator());
    4950        tfUrl.addFocusListener(
    5051                new FocusAdapter() {
  • src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

     
    2424import javax.swing.JPanel;
    2525import javax.swing.JRadioButton;
    2626import javax.swing.JScrollPane;
    27 import javax.swing.JTextField;
     27//import javax.swing.JTextField;
    2828import javax.swing.text.JTextComponent;
    2929
    3030import org.openstreetmap.josm.Main;
     
    3838import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    3939import org.openstreetmap.josm.io.ChangesetQuery;
    4040import org.openstreetmap.josm.tools.CheckParameterUtil;
     41import org.openstreetmap.josm.gui.MyTextField;
    4142
     43
    4244/**
    4345 * This panel allows to specify a changeset query
    4446 *
     
    374376        private JRadioButton rbRestrictToMyself;
    375377        private JRadioButton rbRestrictToUid;
    376378        private JRadioButton rbRestrictToUserName;
    377         private JTextField tfUid;
     379        private MyTextField tfUid;
    378380        private UidInputFieldValidator valUid;
    379         private JTextField tfUserName;
     381        private MyTextField tfUserName;
    380382        private UserNameInputValidator valUserName;
    381383        private JMultilineLabel lblRestrictedToMyself;
    382384
     
    389391            pnl.add(new JLabel(tr("User ID:")), gc);
    390392
    391393            gc.gridx = 1;
    392             pnl.add(tfUid = new JTextField(10),gc);
     394            pnl.add(tfUid = new MyTextField(10),gc);
    393395            SelectAllOnFocusGainedDecorator.decorate(tfUid);
    394396            valUid = UidInputFieldValidator.decorate(tfUid);
    395397
     
    409411            pnl.add(new JLabel(tr("User name:")), gc);
    410412
    411413            gc.gridx = 1;
    412             pnl.add(tfUserName = new JTextField(10),gc);
     414            pnl.add(tfUserName = new MyTextField(10),gc);
    413415            SelectAllOnFocusGainedDecorator.decorate(tfUserName);
    414416            valUserName = UserNameInputValidator.decorate(tfUserName);
    415417
     
    634636
    635637        private JRadioButton rbClosedAfter;
    636638        private JRadioButton rbClosedAfterAndCreatedBefore;
    637         private JTextField tfClosedAfterDate1;
     639        private MyTextField tfClosedAfterDate1;
    638640        private DateValidator valClosedAfterDate1;
    639         private JTextField tfClosedAfterTime1;
     641        private MyTextField tfClosedAfterTime1;
    640642        private TimeValidator valClosedAfterTime1;
    641         private JTextField tfClosedAfterDate2;
     643        private MyTextField tfClosedAfterDate2;
    642644        private DateValidator valClosedAfterDate2;
    643         private JTextField tfClosedAfterTime2;
     645        private MyTextField tfClosedAfterTime2;
    644646        private TimeValidator valClosedAfterTime2;
    645         private JTextField tfCreatedBeforeDate;
     647        private MyTextField tfCreatedBeforeDate;
    646648        private DateValidator valCreatedBeforeDate;
    647         private JTextField tfCreatedBeforeTime;
     649        private MyTextField tfCreatedBeforeTime;
    648650        private TimeValidator valCreatedBeforeTime;
    649651
    650652        protected JPanel buildClosedAfterInputPanel() {
     
    657659
    658660            gc.gridx = 1;
    659661            gc.weightx = 0.7;
    660             pnl.add(tfClosedAfterDate1 = new JTextField(),gc);
     662            pnl.add(tfClosedAfterDate1 = new MyTextField(),gc);
    661663            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1);
    662664            valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1);
    663665            tfClosedAfterDate1.setToolTipText(valClosedAfterDate1.getStandardTooltipTextAsHtml());
     
    668670
    669671            gc.gridx = 3;
    670672            gc.weightx = 0.3;
    671             pnl.add(tfClosedAfterTime1 = new JTextField(),gc);
     673            pnl.add(tfClosedAfterTime1 = new MyTextField(),gc);
    672674            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1);
    673675            valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1);
    674676            tfClosedAfterTime1.setToolTipText(valClosedAfterTime1.getStandardTooltipTextAsHtml());
     
    691693
    692694            gc.gridx = 2;
    693695            gc.weightx = 0.7;
    694             pnl.add(tfClosedAfterDate2 = new JTextField(),gc);
     696            pnl.add(tfClosedAfterDate2 = new MyTextField(),gc);
    695697            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2);
    696698            valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2);
    697699            tfClosedAfterDate2.setToolTipText(valClosedAfterDate2.getStandardTooltipTextAsHtml());
     
    701703
    702704            gc.gridx = 4;
    703705            gc.weightx = 0.3;
    704             pnl.add(tfClosedAfterTime2 = new JTextField(),gc);
     706            pnl.add(tfClosedAfterTime2 = new MyTextField(),gc);
    705707            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2);
    706708            valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2);
    707709            tfClosedAfterTime2.setToolTipText(valClosedAfterTime2.getStandardTooltipTextAsHtml());
     
    721723
    722724            gc.gridx = 2;
    723725            gc.weightx = 0.7;
    724             pnl.add(tfCreatedBeforeDate = new JTextField(),gc);
     726            pnl.add(tfCreatedBeforeDate = new MyTextField(),gc);
    725727            SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate);
    726728            valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate);
    727729            tfCreatedBeforeDate.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml());
     
    732734
    733735            gc.gridx = 4;
    734736            gc.weightx = 0.3;
    735             pnl.add(tfCreatedBeforeTime = new JTextField(),gc);
     737            pnl.add(tfCreatedBeforeTime = new MyTextField(),gc);
    736738            SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime);
    737739            valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime);
    738740            tfCreatedBeforeTime.setToolTipText(valCreatedBeforeDate.getStandardTooltipTextAsHtml());
  • src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

     
    2626import javax.swing.JOptionPane;
    2727import javax.swing.JPanel;
    2828import javax.swing.JTextArea;
    29 import javax.swing.JTextField;
     29//import javax.swing.JTextField;
    3030import javax.swing.JToolBar;
    3131
    3232import org.openstreetmap.josm.Main;
     
    4040import org.openstreetmap.josm.gui.help.HelpUtil;
    4141import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4242import org.openstreetmap.josm.tools.ImageProvider;
     43import org.openstreetmap.josm.gui.MyTextField;
    4344
     45
    4446/**
    4547 * This panel displays the properties of the currently selected changeset in the
    4648 * {@link ChangesetCacheManager}.
     
    4850 */
    4951public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener{
    5052
    51     private JTextField tfID;
     53    private MyTextField tfID;
    5254    private JTextArea taComment;
    53     private JTextField tfOpen;
    54     private JTextField tfUser;
    55     private JTextField tfCreatedOn;
    56     private JTextField tfClosedOn;
     55    private MyTextField tfOpen;
     56    private MyTextField tfUser;
     57    private MyTextField tfCreatedOn;
     58    private MyTextField tfClosedOn;
    5759    private DonwloadChangesetContentAction actDownloadChangesetContent;
    5860    private UpdateChangesetAction actUpdateChangesets;
    5961    private RemoveFromCacheAction actRemoveFromCache;
     
    117119        gc.fill = GridBagConstraints.HORIZONTAL;
    118120        gc.weightx = 0.0;
    119121        gc.gridx = 1;
    120         pnl.add(tfID = new JTextField(10), gc);
     122        pnl.add(tfID = new MyTextField(10), gc);
    121123        tfID.setEditable(false);
    122124
    123125        //-- comment
     
    144146
    145147        gc.fill = GridBagConstraints.HORIZONTAL;
    146148        gc.gridx = 1;
    147         pnl.add(tfOpen= new JTextField(10), gc);
     149        pnl.add(tfOpen= new MyTextField(10), gc);
    148150        tfOpen.setEditable(false);
    149151
    150152        //-- Created by:
     
    157159        gc.fill = GridBagConstraints.HORIZONTAL;
    158160        gc.weightx = 1.0;
    159161        gc.gridx = 1;
    160         pnl.add(tfUser= new JTextField(""), gc);
     162        pnl.add(tfUser= new MyTextField(""), gc);
    161163        tfUser.setEditable(false);
    162164
    163165        //-- Created On:
     
    169171
    170172        gc.fill = GridBagConstraints.HORIZONTAL;
    171173        gc.gridx = 1;
    172         pnl.add(tfCreatedOn= new JTextField(20), gc);
     174        pnl.add(tfCreatedOn= new MyTextField(20), gc);
    173175        tfCreatedOn.setEditable(false);
    174176
    175177        //-- Closed On:
     
    181183
    182184        gc.fill = GridBagConstraints.HORIZONTAL;
    183185        gc.gridx = 1;
    184         pnl.add(tfClosedOn= new JTextField(20), gc);
     186        pnl.add(tfClosedOn= new MyTextField(20), gc);
    185187        tfClosedOn.setEditable(false);
    186188
    187189        return pnl;
  • src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

     
    3434import javax.swing.JPopupMenu;
    3535import javax.swing.JSlider;
    3636import javax.swing.JTable;
    37 import javax.swing.JTextField;
     37//import javax.swing.JTextField;
    3838import javax.swing.JViewport;
    3939import javax.swing.KeyStroke;
    4040import javax.swing.ListSelectionModel;
     
    7171import org.openstreetmap.josm.tools.MultikeyShortcutAction;
    7272import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
    7373import org.openstreetmap.josm.tools.Shortcut;
     74import org.openstreetmap.josm.gui.MyTextField;
    7475
    7576/**
    7677 * This is a toggle dialog which displays the list of layers. Actions allow to
     
    193194        layerList.getColumnModel().getColumn(1).setPreferredWidth(16);
    194195        layerList.getColumnModel().getColumn(1).setResizable(false);
    195196        layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer());
    196         layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JTextField()));
     197        layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new MyTextField()));
    197198        for (KeyStroke ks : new KeyStroke[] {
    198199                KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
    199200                KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
     
    10081009    }
    10091010
    10101011    private static class LayerNameCellEditor extends DefaultCellEditor {
    1011         public LayerNameCellEditor(JTextField tf) {
     1012        public LayerNameCellEditor(MyTextField tf) {
    10121013            super(tf);
    10131014        }
    10141015
    10151016        @Override
    10161017        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    1017             JTextField tf = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
     1018            MyTextField tf = (MyTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
    10181019            tf.setText(value == null ? "" : ((Layer) value).getName());
    10191020            return tf;
    10201021        }
  • src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

     
    2626import javax.swing.JPanel;
    2727import javax.swing.JPopupMenu;
    2828import javax.swing.JScrollPane;
    29 import javax.swing.JTextField;
     29//import javax.swing.JTextField;
    3030import javax.swing.KeyStroke;
    3131import javax.swing.ListSelectionModel;
    3232import javax.swing.SwingUtilities;
     
    7575import org.openstreetmap.josm.tools.Predicate;
    7676import org.openstreetmap.josm.tools.Shortcut;
    7777import org.openstreetmap.josm.tools.Utils;
     78import org.openstreetmap.josm.gui.MyTextField;
    7879
    7980/**
    8081 * A dialog showing all known relations, with buttons to add, edit, and
     
    9596    private final JPopupMenu popupMenu = new JPopupMenu();
    9697    private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
    9798
    98     private final JTextField filter;
     99    private final MyTextField filter;
    99100   
    100101    // Actions
    101102    /** the edit action */
     
    259260        }
    260261    }
    261262
    262     private JTextField  setupFilter() {
    263         final JTextField f = new DisableShortcutsOnFocusGainedTextField();
     263    private MyTextField  setupFilter() {
     264        final MyTextField f = new DisableShortcutsOnFocusGainedTextField();
    264265        f.setToolTipText(tr("Relation list filter"));
    265266        f.getDocument().addDocumentListener(new DocumentListener() {
    266267
  • src/org/openstreetmap/josm/actions/RenameLayerAction.java

     
    1313import javax.swing.JCheckBox;
    1414import javax.swing.JDialog;
    1515import javax.swing.JOptionPane;
    16 import javax.swing.JTextField;
     16//import javax.swing.JTextField;
    1717
    1818import org.openstreetmap.josm.Main;
    1919import org.openstreetmap.josm.gui.layer.Layer;
    2020import org.openstreetmap.josm.tools.ImageProvider;
     21import org.openstreetmap.josm.gui.MyTextField;
    2122
    2223/**
    2324 * Action to rename an specific layer. Provides the option to rename the
     
    4344
    4445    public void actionPerformed(ActionEvent e) {
    4546        Box panel = Box.createVerticalBox();
    46         final JTextField name = new JTextField(layer.getName());
     47        final MyTextField name = new MyTextField(layer.getName());
    4748        panel.add(name);
    4849        JCheckBox filerename = new JCheckBox(tr("Also rename the file"));
    4950        if (Main.applet) {
  • src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

     
    1919
    2020import javax.swing.JLabel;
    2121import javax.swing.JPanel;
    22 import javax.swing.JTextField;
     22//import javax.swing.JTextField;
    2323
    2424import org.openstreetmap.josm.Main;
    2525import org.openstreetmap.josm.actions.mapmode.MapMode;
     
    3030import org.openstreetmap.josm.gui.layer.ImageryLayer;
    3131import org.openstreetmap.josm.tools.GBC;
    3232import org.openstreetmap.josm.tools.ImageProvider;
     33import org.openstreetmap.josm.gui.MyTextField;
    3334
    3435
    3536public class ImageryAdjustAction extends MapMode implements MouseListener, MouseMotionListener, AWTEventListener{
     
    148149    }
    149150
    150151    class ImageryOffsetDialog extends ExtendedDialog implements FocusListener {
    151         public final JTextField tOffset = new JTextField();
    152         JTextField tBookmarkName = new JTextField();
     152        public final MyTextField tOffset = new MyTextField();
     153        MyTextField tBookmarkName = new MyTextField();
    153154        private boolean ignoreListener;
    154155        public ImageryOffsetDialog() {
    155156            super(Main.parent,
  • src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java

     
    1616import javax.swing.JOptionPane;
    1717import javax.swing.JPanel;
    1818import javax.swing.JRadioButton;
    19 import javax.swing.JTextField;
     19//import javax.swing.JTextField;
    2020
    2121import org.openstreetmap.josm.Main;
    2222import org.openstreetmap.josm.data.imagery.ImageryInfo;
     
    2626import org.openstreetmap.josm.tools.Shortcut;
    2727import org.openstreetmap.josm.tools.UrlLabel;
    2828import org.openstreetmap.josm.tools.Utils;
     29import org.openstreetmap.josm.gui.MyTextField;
    2930
    3031public class Map_Rectifier_WMSmenuAction extends JosmAction {
    3132    /**
     
    110111        JPanel panel = new JPanel(new GridBagLayout());
    111112        panel.add(new JLabel(tr("Supported Rectifier Services:")), GBC.eol());
    112113
    113         JTextField tfWmsUrl = new JTextField(30);
     114        MyTextField tfWmsUrl = new MyTextField(30);
    114115
    115116        String clip = Utils.getClipboardContent();
    116117        clip = clip == null ? "" : clip.trim();
  • src/org/openstreetmap/josm/actions/search/SearchAction.java

     
    2929import javax.swing.JOptionPane;
    3030import javax.swing.JPanel;
    3131import javax.swing.JRadioButton;
    32 import javax.swing.JTextField;
     32//import javax.swing.JTextField;
    3333import javax.swing.text.BadLocationException;
    3434
    3535import org.openstreetmap.josm.Main;
     
    5050import org.openstreetmap.josm.tools.Property;
    5151import org.openstreetmap.josm.tools.Shortcut;
    5252import org.openstreetmap.josm.tools.Utils;
     53import org.openstreetmap.josm.gui.MyTextField;
    5354
     55
    5456public class SearchAction extends JosmAction implements ParameterizedAction {
    5557
    5658    public static final int DEFAULT_SEARCH_HISTORY_SIZE = 15;
     
    194196                    @Override
    195197                    public void mouseClicked(MouseEvent e) {
    196198                        try {
    197                             JTextField tf = (JTextField) hcb.getEditor().getEditorComponent();
     199                            MyTextField tf = (MyTextField) hcb.getEditor().getEditorComponent();
    198200                            tf.getDocument().insertString(tf.getCaretPosition(), " " + insertText, null);
    199201                        } catch (BadLocationException ex) {
    200202                            throw new RuntimeException(ex.getMessage(), ex);
  • src/org/openstreetmap/josm/actions/JumpToAction.java

     
    1313import javax.swing.JLabel;
    1414import javax.swing.JOptionPane;
    1515import javax.swing.JPanel;
    16 import javax.swing.JTextField;
     16//import javax.swing.JTextField;
    1717import javax.swing.event.DocumentEvent;
    1818import javax.swing.event.DocumentListener;
    1919
     
    2424import org.openstreetmap.josm.tools.GBC;
    2525import org.openstreetmap.josm.tools.OsmUrlToBounds;
    2626import org.openstreetmap.josm.tools.Shortcut;
     27import org.openstreetmap.josm.gui.MyTextField;
    2728
    2829public class JumpToAction extends JosmAction implements MouseListener {
    2930    public JumpToAction() {
     
    3334        Main.toolbar.register(this);
    3435    }
    3536
    36     private JTextField url = new JTextField();
    37     private JTextField lat = new JTextField();
    38     private JTextField lon = new JTextField();
    39     private JTextField zm = new JTextField();
     37    private MyTextField url = new MyTextField();
     38    private MyTextField lat = new MyTextField();
     39    private MyTextField lon = new MyTextField();
     40    private MyTextField zm = new MyTextField();
    4041
    4142    private double zoomFactor = 0;
    4243    public void showJumpToDialog() {