Changeset 5886 in josm


Ignore:
Timestamp:
2013-04-19T22:21:57+02:00 (11 years ago)
Author:
Don-vip
Message:

see #4429 - Right click menu "undo, cut, copy, paste, delete, select all" for each text component (originally based on patch by NooN)

Location:
trunk/src/org/openstreetmap/josm
Files:
4 added
81 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AboutAction.java

    r5849 r5886  
    1515import javax.swing.JScrollPane;
    1616import javax.swing.JTabbedPane;
    17 import javax.swing.JTextArea;
    1817
    1918import org.openstreetmap.josm.Main;
    2019import org.openstreetmap.josm.data.Version;
    2120import org.openstreetmap.josm.gui.util.GuiHelper;
     21import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2222import org.openstreetmap.josm.plugins.PluginHandler;
    2323import org.openstreetmap.josm.tools.BugReportExceptionHandler;
     
    3838public class AboutAction extends JosmAction {
    3939
     40    /**
     41     * Constructs a new {@code AboutAction}.
     42     */
    4043    public AboutAction() {
    4144        super(tr("About"), "about", tr("Display the about screen."),
     
    4952        Version version = Version.getInstance();
    5053
    51         JTextArea readme = new JTextArea();
     54        JosmTextArea readme = new JosmTextArea();
    5255        readme.setEditable(false);
    5356        readme.setText(Version.loadResourceFile(Main.class.getResource("/README")));
    5457        readme.setCaretPosition(0);
    5558
    56         JTextArea revision = new JTextArea();
     59        JosmTextArea revision = new JosmTextArea();
    5760        revision.setEditable(false);
    5861        revision.setText(version.getReleaseAttributes());
    5962        revision.setCaretPosition(0);
    6063
    61         JTextArea contribution = new JTextArea();
     64        JosmTextArea contribution = new JosmTextArea();
    6265        contribution.setEditable(false);
    6366        contribution.setText(Version.loadResourceFile(Main.class.getResource("/CONTRIBUTION")));
    6467        contribution.setCaretPosition(0);
    6568
    66         JTextArea license = new JTextArea();
     69        JosmTextArea license = new JosmTextArea();
    6770        license.setEditable(false);
    6871        license.setText(Version.loadResourceFile(Main.class.getResource("/LICENSE")));
     
    103106    }
    104107
    105     private JScrollPane createScrollPane(JTextArea area) {
     108    private JScrollPane createScrollPane(JosmTextArea area) {
    106109        area.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    107110        area.setOpaque(false);
  • trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java

    r5765 r5886  
    1919import javax.swing.JPanel;
    2020import javax.swing.JScrollPane;
    21 import javax.swing.JTextArea;
    2221import javax.swing.SwingUtilities;
    2322
     
    3231import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    3332import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     33import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    3434import org.openstreetmap.josm.tools.GBC;
    3535import org.openstreetmap.josm.tools.Shortcut;
     
    4343public class DownloadPrimitiveAction extends JosmAction {
    4444
     45    /**
     46     * Constructs a new {@code DownloadPrimitiveAction}.
     47     */
    4548    public DownloadPrimitiveAction() {
    4649        super(tr("Download object..."), "downloadprimitive", tr("Download OSM object by ID."),
     
    144147            p.add(missing, GBC.eol());
    145148        }
    146         JTextArea txt = new JTextArea();
     149        JosmTextArea txt = new JosmTextArea();
    147150        txt.setFont(new Font("Monospaced", txt.getFont().getStyle(), txt.getFont().getSize()));
    148151        txt.setEditable(false);
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r5808 r5886  
    2020import javax.swing.JLabel;
    2121import javax.swing.JPanel;
    22 import javax.swing.JTextField;
    2322
    2423import org.openstreetmap.josm.Main;
     
    3130import org.openstreetmap.josm.tools.GBC;
    3231import org.openstreetmap.josm.tools.ImageProvider;
     32import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3333
    3434
     
    149149
    150150    class ImageryOffsetDialog extends ExtendedDialog implements FocusListener {
    151         public final JTextField tOffset = new JTextField();
    152         JTextField tBookmarkName = new JTextField();
     151        public final JosmTextField tOffset = new JosmTextField();
     152        JosmTextField tBookmarkName = new JosmTextField();
    153153        private boolean ignoreListener;
    154154        public ImageryOffsetDialog() {
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r5780 r5886  
    1414import javax.swing.JOptionPane;
    1515import javax.swing.JPanel;
    16 import javax.swing.JTextField;
    1716import javax.swing.event.DocumentEvent;
    1817import javax.swing.event.DocumentListener;
     
    2524import org.openstreetmap.josm.tools.OsmUrlToBounds;
    2625import org.openstreetmap.josm.tools.Shortcut;
     26import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2727
    2828public class JumpToAction extends JosmAction implements MouseListener {
     29    /**
     30     * Constructs a new {@code JumpToAction}.
     31     */
    2932    public JumpToAction() {
    3033        super(tr("Jump To Position"), null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
     
    3437    }
    3538
    36     private JTextField url = new JTextField();
    37     private JTextField lat = new JTextField();
    38     private JTextField lon = new JTextField();
    39     private JTextField zm = new JTextField();
     39    private JosmTextField url = new JosmTextField();
     40    private JosmTextField lat = new JosmTextField();
     41    private JosmTextField lon = new JosmTextField();
     42    private JosmTextField zm = new JosmTextField();
    4043
    4144    private double zoomFactor = 0;
  • trunk/src/org/openstreetmap/josm/actions/Map_Rectifier_WMSmenuAction.java

    r5567 r5886  
    1717import javax.swing.JPanel;
    1818import javax.swing.JRadioButton;
    19 import javax.swing.JTextField;
    2019
    2120import org.openstreetmap.josm.Main;
     
    2726import org.openstreetmap.josm.tools.UrlLabel;
    2827import org.openstreetmap.josm.tools.Utils;
     28import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2929
    3030public class Map_Rectifier_WMSmenuAction extends JosmAction {
     
    111111        panel.add(new JLabel(tr("Supported Rectifier Services:")), GBC.eol());
    112112
    113         JTextField tfWmsUrl = new JTextField(30);
     113        JosmTextField tfWmsUrl = new JosmTextField(30);
    114114
    115115        String clip = Utils.getClipboardContent();
  • trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java

    r4570 r5886  
    1414import javax.swing.JDialog;
    1515import javax.swing.JOptionPane;
    16 import javax.swing.JTextField;
    1716
    1817import org.openstreetmap.josm.Main;
    1918import org.openstreetmap.josm.gui.layer.Layer;
    2019import org.openstreetmap.josm.tools.ImageProvider;
     20import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2121
    2222/**
     
    4444    public void actionPerformed(ActionEvent e) {
    4545        Box panel = Box.createVerticalBox();
    46         final JTextField name = new JTextField(layer.getName());
     46        final JosmTextField name = new JosmTextField(layer.getName());
    4747        panel.add(name);
    4848        JCheckBox filerename = new JCheckBox(tr("Also rename the file"));
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r5873 r5886  
    1919
    2020import javax.swing.JScrollPane;
    21 import javax.swing.JTextArea;
    2221
    2322import org.openstreetmap.josm.Main;
     
    2726import org.openstreetmap.josm.data.osm.DatasetConsistencyTest;
    2827import org.openstreetmap.josm.gui.ExtendedDialog;
     28import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2929import org.openstreetmap.josm.plugins.PluginHandler;
    3030import org.openstreetmap.josm.tools.BugReportExceptionHandler;
     
    138138        }
    139139
    140         JTextArea ta = new JTextArea(text.toString());
     140        JosmTextArea ta = new JosmTextArea(text.toString());
    141141        ta.setWrapStyleWord(true);
    142142        ta.setLineWrap(true);
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r5813 r5886  
    3030import javax.swing.JPanel;
    3131import javax.swing.JRadioButton;
    32 import javax.swing.JTextField;
    3332import javax.swing.text.BadLocationException;
    3433
     
    5150import org.openstreetmap.josm.tools.Shortcut;
    5251import org.openstreetmap.josm.tools.Utils;
     52import org.openstreetmap.josm.gui.widgets.JosmTextField;
     53
    5354
    5455public class SearchAction extends JosmAction implements ParameterizedAction {
     
    195196                    public void mouseClicked(MouseEvent e) {
    196197                        try {
    197                             JTextField tf = (JTextField) hcb.getEditor().getEditorComponent();
     198                            JosmTextField tf = (JosmTextField) hcb.getEditor().getEditorComponent();
    198199                            tf.getDocument().insertString(tf.getCaretPosition(), " " + insertText, null);
    199200                        } catch (BadLocationException ex) {
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r5883 r5886  
    1616
    1717import javax.swing.JComponent;
    18 import javax.swing.JEditorPane;
    1918import javax.swing.JPanel;
    2019import javax.swing.JScrollPane;
     
    2625import org.openstreetmap.josm.Main;
    2726import org.openstreetmap.josm.data.Version;
     27import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    2828import org.openstreetmap.josm.io.CacheCustomContent;
    2929import org.openstreetmap.josm.tools.LanguageInfo;
     
    3939            + "</style>\n";
    4040
    41     public static class LinkGeneral extends JEditorPane implements HyperlinkListener {
     41    public static class LinkGeneral extends JosmEditorPane implements HyperlinkListener {
     42       
     43        /**
     44         * Constructs a new {@code LinkGeneral} with the given HTML text
     45         * @param text The text to display
     46         */
    4247        public LinkGeneral(String text) {
    4348            setContentType("text/html");
  • trunk/src/org/openstreetmap/josm/gui/HelpAwareOptionPane.java

    r5266 r5886  
    1717import org.openstreetmap.josm.gui.help.HelpBrowser;
    1818import org.openstreetmap.josm.gui.help.HelpUtil;
     19import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    1920import org.openstreetmap.josm.tools.ImageProvider;
    2021import org.openstreetmap.josm.tools.InputMapUtils;
     
    158159
    159160        if (msg instanceof String) {
    160             JEditorPane pane = new JEditorPane();
    161             pane.setContentType("text/html");
    162             pane.setText((String) msg);
     161            JosmEditorPane pane = new JosmEditorPane("text/html", (String) msg);
    163162            pane.setEditable(false);
    164163            pane.setOpaque(false);
  • trunk/src/org/openstreetmap/josm/gui/MainApplet.java

    r5865 r5886  
    2222import javax.swing.JOptionPane;
    2323import javax.swing.JPanel;
    24 import javax.swing.JPasswordField;
    25 import javax.swing.JTextField;
    2624
    2725import org.openstreetmap.josm.Main;
     
    3028import org.openstreetmap.josm.gui.MainApplication.Option;
    3129import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
     30import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3231import org.openstreetmap.josm.tools.GBC;
    3332import org.openstreetmap.josm.tools.I18n;
     
    114113                p.add(new JLabel(tr(e.realm)), GBC.eol().fill(GBC.HORIZONTAL));
    115114                p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,20,0));
    116                 JTextField user = new JTextField(username == null ? "" : username);
     115                JosmTextField user = new JosmTextField(username == null ? "" : username);
    117116                p.add(user, GBC.eol().fill(GBC.HORIZONTAL));
    118117                p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,20,0));
    119                 JPasswordField pass = new JosmPasswordField(password == null ? "" : password);
     118                JosmPasswordField pass = new JosmPasswordField(password == null ? "" : password);
    120119                p.add(pass, GBC.eol().fill(GBC.HORIZONTAL));
    121120                JOptionPane.showMessageDialog(null, p);
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r5534 r5886  
    3434import javax.swing.JProgressBar;
    3535import javax.swing.JScrollPane;
    36 import javax.swing.JTextField;
    3736import javax.swing.Popup;
    3837import javax.swing.PopupFactory;
     
    5049import org.openstreetmap.josm.tools.GBC;
    5150import org.openstreetmap.josm.tools.ImageProvider;
     51import org.openstreetmap.josm.gui.widgets.JosmTextField;
    5252
    5353/**
     
    151151    final ImageLabel lonText = new ImageLabel("lon", tr("The geographic longitude at the mouse pointer."), 11);
    152152    final ImageLabel nameText = new ImageLabel("name", tr("The name of the object at the mouse pointer."), 20);
    153     final JTextField helpText = new JTextField();
     153    final JosmTextField helpText = new JosmTextField();
    154154    final ImageLabel latText = new ImageLabel("lat", tr("The geographic latitude at the mouse pointer."), 11);
    155155    final ImageLabel angleText = new ImageLabel("angle", tr("The angle between the previous and the current way segment."), 6);
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r5534 r5886  
    2020import javax.swing.JProgressBar;
    2121import javax.swing.JScrollPane;
    22 import javax.swing.JTextArea;
    2322import javax.swing.UIManager;
    2423
    2524import org.openstreetmap.josm.Main;
    2625import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
     26import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2727import org.openstreetmap.josm.tools.GBC;
    2828import org.openstreetmap.josm.tools.ImageProvider;
     
    3838    private JButton btnInBackground;
    3939    /** the text area and the scroll pane for the log */
    40     private JTextArea taLog = new JTextArea(5,50);
     40    private JosmTextArea taLog = new JosmTextArea(5,50);
    4141    private  JScrollPane spLog;
    4242
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java

    r4879 r5886  
    2424import javax.swing.BorderFactory;
    2525import javax.swing.JDialog;
    26 import javax.swing.JEditorPane;
    2726import javax.swing.JOptionPane;
    2827import javax.swing.JPanel;
     
    4746import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
    4847import org.openstreetmap.josm.gui.help.HelpUtil;
     48import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    4949import org.openstreetmap.josm.tools.ImageProvider;
    5050import org.openstreetmap.josm.tools.WindowGeometry;
     
    5353 * This dialog is used to get a user confirmation that a collection of primitives can be removed
    5454 * from their parent relations.
    55  *
     55 * @since 2308
    5656 */
    5757public class DeleteFromRelationConfirmationDialog extends JDialog implements TableModelListener {
     
    6262     * Replies the unique instance of this dialog
    6363     *
    64      * @return
     64     * @return The unique instance of this dialog
    6565     */
    6666    static public DeleteFromRelationConfirmationDialog getInstance() {
     
    7373    /** the data model */
    7474    private RelationMemberTableModel model;
    75     private JEditorPane jepMessage;
     75    private JosmEditorPane jepMessage;
    7676    private boolean canceled;
    7777    private SideButton btnOK;
     
    7979    protected JPanel buildMessagePanel() {
    8080        JPanel pnl = new JPanel(new BorderLayout());
    81         jepMessage = new JEditorPane("text/html", "");
     81        jepMessage = new JosmEditorPane("text/html", "");
    8282        jepMessage.setOpaque(false);
    8383        jepMessage.setEditable(false);
     
    169169    }
    170170
     171    /**
     172     * Constructs a new {@code DeleteFromRelationConfirmationDialog}.
     173     */
    171174    public DeleteFromRelationConfirmationDialog() {
    172175        super(JOptionPane.getFrameForComponent(Main.parent), "", ModalityType.DOCUMENT_MODAL);
     
    225228        private ArrayList<RelationToChildReference> data;
    226229
     230        /**
     231         * Constructs a new {@code RelationMemberTableModel}.
     232         */
    227233        public RelationMemberTableModel() {
    228234            data = new ArrayList<RelationToChildReference>();
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/LogShowDialog.java

    r5114 r5886  
    11package org.openstreetmap.josm.gui.actionsupport;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Dimension;
    46import java.awt.GridBagLayout;
    5 import javax.swing.*;
     7
     8import javax.swing.JLabel;
     9import javax.swing.JPanel;
     10import javax.swing.JScrollPane;
     11
    612import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.data.Preferences;
    813import org.openstreetmap.josm.gui.ExtendedDialog;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    10 import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference;
    11 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     14import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    1215import org.openstreetmap.josm.tools.GBC;
    13 
    14 import static org.openstreetmap.josm.tools.I18n.tr;
    1516
    1617/**
     
    3435       
    3536        p.add(lbl, GBC.eol().insets(5,0,5,0));
    36         JEditorPane txt = new JEditorPane();
     37        JosmEditorPane txt = new JosmEditorPane();
    3738        txt.setContentType("text/html");
    3839        txt.setText(log);
     
    5051    }
    5152}
    52  
    53 
  • trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

    r5266 r5886  
    3333import javax.swing.JPanel;
    3434import javax.swing.JSpinner;
    35 import javax.swing.JTextField;
    3635import javax.swing.KeyStroke;
    3736import javax.swing.SpinnerNumberModel;
     
    5049import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    5150import org.openstreetmap.josm.tools.ImageProvider;
     51import org.openstreetmap.josm.gui.widgets.JosmTextField;
    5252
    5353/**
     
    210210        static public final String TILE_BOUNDS_PROP = TileGridInputPanel.class.getName() + ".tileBounds";
    211211
    212         private JTextField tfMaxY;
    213         private JTextField tfMinY;
    214         private JTextField tfMaxX;
    215         private JTextField tfMinX;
     212        private JosmTextField tfMaxY;
     213        private JosmTextField tfMinY;
     214        private JosmTextField tfMaxX;
     215        private JosmTextField tfMinX;
    216216        private TileCoordinateValidator valMaxY;
    217217        private TileCoordinateValidator valMinY;
     
    267267            gc.gridx = 1;
    268268            gc.weightx = 0.5;
    269             pnl.add(tfMinX = new JTextField(), gc);
     269            pnl.add(tfMinX = new JosmTextField(), gc);
    270270            valMinX = new TileCoordinateValidator(tfMinX);
    271271            SelectAllOnFocusGainedDecorator.decorate(tfMinX);
     
    275275            gc.gridx = 2;
    276276            gc.weightx = 0.5;
    277             pnl.add(tfMaxX = new JTextField(), gc);
     277            pnl.add(tfMaxX = new JosmTextField(), gc);
    278278            valMaxX = new TileCoordinateValidator(tfMaxX);
    279279            SelectAllOnFocusGainedDecorator.decorate(tfMaxX);
     
    288288            gc.gridx = 1;
    289289            gc.weightx = 0.5;
    290             pnl.add(tfMinY = new JTextField(), gc);
     290            pnl.add(tfMinY = new JosmTextField(), gc);
    291291            valMinY = new TileCoordinateValidator(tfMinY);
    292292            SelectAllOnFocusGainedDecorator.decorate(tfMinY);
     
    296296            gc.gridx = 2;
    297297            gc.weightx = 0.5;
    298             pnl.add(tfMaxY = new JTextField(), gc);
     298            pnl.add(tfMaxY = new JosmTextField(), gc);
    299299            valMaxY = new TileCoordinateValidator(tfMaxY);
    300300            SelectAllOnFocusGainedDecorator.decorate(tfMaxY);
     
    428428        static public final String TILE_BOUNDS_PROP = TileAddressInputPanel.class.getName() + ".tileBounds";
    429429
    430         private JTextField tfTileAddress;
     430        private JosmTextField tfTileAddress;
    431431        private TileAddressValidator valTileAddress;
    432432
     
    452452            gc.weightx = 1.0;
    453453            gc.gridx = 1;
    454             pnl.add(tfTileAddress = new JTextField(), gc);
     454            pnl.add(tfTileAddress = new JosmTextField(), gc);
    455455            valTileAddress = new TileAddressValidator(tfTileAddress);
    456456            SelectAllOnFocusGainedDecorator.decorate(tfTileAddress);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellEditor.java

    r5266 r5886  
    88import javax.swing.AbstractCellEditor;
    99import javax.swing.JTable;
    10 import javax.swing.JTextField;
    1110import javax.swing.table.TableCellEditor;
    1211
    1312import org.openstreetmap.josm.data.osm.RelationMember;
     13import org.openstreetmap.josm.gui.widgets.JosmTextField;
     14
    1415
    1516/**
     
    1920public class RelationMemberTableCellEditor extends AbstractCellEditor implements TableCellEditor{
    2021
    21     private final JTextField editor;
     22    private final JosmTextField editor;
    2223
     24    /**
     25     * Constructs a new {@code RelationMemberTableCellEditor}.
     26     */
    2327    public RelationMemberTableCellEditor() {
    24         editor = new JTextField();
     28        editor = new JosmTextField();
    2529        editor.addFocusListener(
    2630                new FocusAdapter() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    r5539 r5886  
    1717import javax.swing.JScrollPane;
    1818import javax.swing.JTabbedPane;
    19 import javax.swing.JTextArea;
    2019import javax.swing.SingleSelectionModel;
    2120import javax.swing.event.ChangeEvent;
     
    4645import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    4746import org.openstreetmap.josm.gui.mappaint.xml.XmlStyleSource;
     47import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    4848import org.openstreetmap.josm.tools.DateUtils;
    4949import org.openstreetmap.josm.tools.GBC;
     
    6161    protected List<OsmPrimitive> primitives;
    6262    protected OsmDataLayer layer;
    63     private JTextArea txtData;
    64     private JTextArea txtMappaint;
     63    private JosmTextArea txtData;
     64    private JosmTextArea txtMappaint;
    6565    boolean mappaintTabLoaded;
    6666
     
    9494    protected JPanel buildDataPanel() {
    9595        JPanel p = new JPanel(new GridBagLayout());
    96         txtData = new JTextArea();
     96        txtData = new JosmTextArea();
    9797        txtData.setFont(new Font("Monospaced", txtData.getFont().getStyle(), txtData.getFont().getSize()));
    9898        txtData.setEditable(false);
     
    321321    protected void buildMapPaintPanel(JPanel p) {
    322322        p.setLayout(new GridBagLayout());
    323         txtMappaint = new JTextArea();
     323        txtMappaint = new JosmTextArea();
    324324        txtMappaint.setFont(new Font("Monospaced", txtMappaint.getFont().getStyle(), txtMappaint.getFont().getSize()));
    325325        txtMappaint.setEditable(false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java

    r4314 r5886  
    77import java.awt.Component;
    88import java.awt.GridBagLayout;
    9 import java.awt.event.ActionEvent;
    109import java.awt.event.FocusEvent;
    1110import java.awt.event.FocusListener;
    12 import java.awt.event.WindowAdapter;
    13 import java.awt.event.WindowEvent;
    1411import java.text.NumberFormat;
    1512import java.text.ParsePosition;
     
    2017import java.util.regex.Pattern;
    2118
    22 import javax.swing.AbstractAction;
    2319import javax.swing.BorderFactory;
    2420import javax.swing.JLabel;
     
    2622import javax.swing.JSeparator;
    2723import javax.swing.JTabbedPane;
    28 import javax.swing.JTextField;
    2924import javax.swing.UIManager;
    3025import javax.swing.event.ChangeEvent;
     
    3934import org.openstreetmap.josm.gui.ExtendedDialog;
    4035import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     36import org.openstreetmap.josm.gui.widgets.JosmTextField;
    4137import org.openstreetmap.josm.tools.GBC;
    42 import org.openstreetmap.josm.tools.ImageProvider;
    4338import org.openstreetmap.josm.tools.WindowGeometry;
    4439
     
    4742
    4843    public JTabbedPane tabs;
    49     private JTextField tfLatLon, tfEastNorth;
     44    private JosmTextField tfLatLon, tfEastNorth;
    5045    private LatLon latLonCoordinates;
    5146    private EastNorth eastNorthCoordinates;
     
    7772
    7873        pnl.add(new JLabel(tr("Coordinates:")), GBC.std().insets(0,10,5,0));
    79         tfLatLon = new JTextField(24);
     74        tfLatLon = new JosmTextField(24);
    8075        pnl.add(tfLatLon, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
    8176
     
    129124
    130125        pnl.add(new JLabel(tr("Projected coordinates:")), GBC.std().insets(0,10,5,0));
    131         tfEastNorth = new JTextField(24);
     126        tfEastNorth = new JosmTextField(24);
    132127
    133128        pnl.add(tfEastNorth, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL).weight(1.0, 0.0));
     
    208203    }
    209204
    210     protected void setErrorFeedback(JTextField tf, String message) {
     205    protected void setErrorFeedback(JosmTextField tf, String message) {
    211206        tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
    212207        tf.setToolTipText(message);
     
    214209    }
    215210
    216     protected void clearErrorFeedback(JTextField tf, String message) {
     211    protected void clearErrorFeedback(JosmTextField tf, String message) {
    217212        tf.setBorder(UIManager.getBorder("TextField.border"));
    218213        tf.setToolTipText(message);
     
    329324        public void focusGained(FocusEvent e) {
    330325            Component c = e.getComponent();
    331             if (c instanceof JTextField) {
    332                 JTextField tf = (JTextField)c;
     326            if (c instanceof JosmTextField) {
     327                JosmTextField tf = (JosmTextField)c;
    333328                tf.selectAll();
    334329            }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r5519 r5886  
    3535import javax.swing.JSlider;
    3636import javax.swing.JTable;
    37 import javax.swing.JTextField;
    3837import javax.swing.JViewport;
    3938import javax.swing.KeyStroke;
     
    7271import org.openstreetmap.josm.tools.MultikeyShortcutAction.MultikeyInfo;
    7372import org.openstreetmap.josm.tools.Shortcut;
     73import org.openstreetmap.josm.gui.widgets.JosmTextField;
    7474
    7575/**
     
    194194        layerList.getColumnModel().getColumn(1).setResizable(false);
    195195        layerList.getColumnModel().getColumn(2).setCellRenderer(new LayerNameCellRenderer());
    196         layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JTextField()));
     196        layerList.getColumnModel().getColumn(2).setCellEditor(new LayerNameCellEditor(new JosmTextField()));
    197197        for (KeyStroke ks : new KeyStroke[] {
    198198                KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
     
    10091009
    10101010    private static class LayerNameCellEditor extends DefaultCellEditor {
    1011         public LayerNameCellEditor(JTextField tf) {
     1011        public LayerNameCellEditor(JosmTextField tf) {
    10121012            super(tf);
    10131013        }
     
    10151015        @Override
    10161016        public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
    1017             JTextField tf = (JTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
     1017            JosmTextField tf = (JosmTextField) super.getTableCellEditorComponent(table, value, isSelected, row, column);
    10181018            tf.setText(value == null ? "" : ((Layer) value).getName());
    10191019            return tf;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r5576 r5886  
    3939import javax.swing.JTabbedPane;
    4040import javax.swing.JTable;
    41 import javax.swing.JTextArea;
    4241import javax.swing.JViewport;
    4342import javax.swing.ListSelectionModel;
     
    7271import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    7372import org.openstreetmap.josm.gui.widgets.JFileChooserManager;
     73import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    7474import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
    7575import org.openstreetmap.josm.tools.GBC;
     
    9191    protected JCheckBox cbWireframe;
    9292
     93    /**
     94     * Constructs a new {@code MapPaintDialog}.
     95     */
    9396    public MapPaintDialog() {
    9497        super(tr("Map Paint Styles"), "mapstyle", tr("configure the map painting style"),
     
    406409     */
    407410    public static class LaunchMapPaintPreferencesAction extends AbstractAction {
     411        /**
     412         * Constructs a new {@code LaunchMapPaintPreferencesAction}.
     413         */
    408414        public LaunchMapPaintPreferencesAction() {
    409415            putValue(NAME, tr("Preferences"));
     
    652658
    653659        private void buildSourcePanel(StyleSource s, JPanel p) {
    654             JTextArea txtSource = new JTextArea();
     660            JosmTextArea txtSource = new JosmTextArea();
    655661            txtSource.setFont(new Font("Monospaced", txtSource.getFont().getStyle(), txtSource.getFont().getSize()));
    656662            txtSource.setEditable(false);
     
    673679
    674680        private void buildErrorsPanel(StyleSource s, JPanel p) {
    675             JTextArea txtErrors = new JTextArea();
     681            JosmTextArea txtErrors = new JosmTextArea();
    676682            txtErrors.setFont(new Font("Monospaced", txtErrors.getFont().getStyle(), txtErrors.getFont().getSize()));
    677683            txtErrors.setEditable(false);
     
    702708
    703709    public class MapPaintPopup extends JPopupMenu {
     710        /**
     711         * Constructs a new {@code MapPaintPopup}.
     712         */
    704713        public MapPaintPopup() {
    705714            add(reloadAction);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r5825 r5886  
    2727import javax.swing.JPopupMenu;
    2828import javax.swing.JScrollPane;
    29 import javax.swing.JTextField;
    3029import javax.swing.KeyStroke;
    3130import javax.swing.ListSelectionModel;
     
    7675import org.openstreetmap.josm.tools.Shortcut;
    7776import org.openstreetmap.josm.tools.Utils;
     77import org.openstreetmap.josm.gui.widgets.JosmTextField;
    7878
    7979/**
     
    9696    private final PopupMenuHandler popupMenuHandler = new PopupMenuHandler(popupMenu);
    9797
    98     private final JTextField filter;
     98    private final JosmTextField filter;
    9999   
    100100    // Actions
     
    260260    }
    261261
    262     private JTextField  setupFilter() {
    263         final JTextField f = new DisableShortcutsOnFocusGainedTextField();
     262    private JosmTextField  setupFilter() {
     263        final JosmTextField f = new DisableShortcutsOnFocusGainedTextField();
    264264        f.setToolTipText(tr("Relation list filter"));
    265265        f.getDocument().addDocumentListener(new DocumentListener() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

    r5319 r5886  
    2626import javax.swing.JOptionPane;
    2727import javax.swing.JPanel;
    28 import javax.swing.JTextArea;
    29 import javax.swing.JTextField;
    3028import javax.swing.JToolBar;
    3129
     
    4038import org.openstreetmap.josm.gui.help.HelpUtil;
    4139import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     40import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     41import org.openstreetmap.josm.gui.widgets.JosmTextField;
    4242import org.openstreetmap.josm.tools.ImageProvider;
     43
    4344
    4445/**
     
    4950public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener{
    5051
    51     private JTextField tfID;
    52     private JTextArea taComment;
    53     private JTextField tfOpen;
    54     private JTextField tfUser;
    55     private JTextField tfCreatedOn;
    56     private JTextField tfClosedOn;
     52    private JosmTextField tfID;
     53    private JosmTextArea taComment;
     54    private JosmTextField tfOpen;
     55    private JosmTextField tfUser;
     56    private JosmTextField tfCreatedOn;
     57    private JosmTextField tfClosedOn;
    5758    private DonwloadChangesetContentAction actDownloadChangesetContent;
    5859    private UpdateChangesetAction actUpdateChangesets;
     
    118119        gc.weightx = 0.0;
    119120        gc.gridx = 1;
    120         pnl.add(tfID = new JTextField(10), gc);
     121        pnl.add(tfID = new JosmTextField(10), gc);
    121122        tfID.setEditable(false);
    122123
     
    132133        gc.weighty = 1.0;
    133134        gc.gridx = 1;
    134         pnl.add(taComment= new JTextArea(5,40), gc);
     135        pnl.add(taComment= new JosmTextArea(5,40), gc);
    135136        taComment.setEditable(false);
    136137
     
    145146        gc.fill = GridBagConstraints.HORIZONTAL;
    146147        gc.gridx = 1;
    147         pnl.add(tfOpen= new JTextField(10), gc);
     148        pnl.add(tfOpen= new JosmTextField(10), gc);
    148149        tfOpen.setEditable(false);
    149150
     
    158159        gc.weightx = 1.0;
    159160        gc.gridx = 1;
    160         pnl.add(tfUser= new JTextField(""), gc);
     161        pnl.add(tfUser= new JosmTextField(""), gc);
    161162        tfUser.setEditable(false);
    162163
     
    170171        gc.fill = GridBagConstraints.HORIZONTAL;
    171172        gc.gridx = 1;
    172         pnl.add(tfCreatedOn= new JTextField(20), gc);
     173        pnl.add(tfCreatedOn= new JosmTextField(20), gc);
    173174        tfCreatedOn.setEditable(false);
    174175
     
    182183        gc.fill = GridBagConstraints.HORIZONTAL;
    183184        gc.gridx = 1;
    184         pnl.add(tfClosedOn= new JTextField(20), gc);
     185        pnl.add(tfClosedOn= new JosmTextField(20), gc);
    185186        tfClosedOn.setEditable(false);
    186187
     
    230231    }
    231232
     233    /**
     234     * Constructs a new {@code ChangesetDetailPanel}.
     235     */
    232236    public ChangesetDetailPanel() {
    233237        build();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java

    r5266 r5886  
    2525import javax.swing.JRadioButton;
    2626import javax.swing.JScrollPane;
    27 import javax.swing.JTextField;
    2827import javax.swing.text.JTextComponent;
    2928
     
    3938import org.openstreetmap.josm.io.ChangesetQuery;
    4039import org.openstreetmap.josm.tools.CheckParameterUtil;
     40import org.openstreetmap.josm.gui.widgets.JosmTextField;
     41
    4142
    4243/**
     
    375376        private JRadioButton rbRestrictToUid;
    376377        private JRadioButton rbRestrictToUserName;
    377         private JTextField tfUid;
     378        private JosmTextField tfUid;
    378379        private UidInputFieldValidator valUid;
    379         private JTextField tfUserName;
     380        private JosmTextField tfUserName;
    380381        private UserNameInputValidator valUserName;
    381382        private JMultilineLabel lblRestrictedToMyself;
     
    390391
    391392            gc.gridx = 1;
    392             pnl.add(tfUid = new JTextField(10),gc);
     393            pnl.add(tfUid = new JosmTextField(10),gc);
    393394            SelectAllOnFocusGainedDecorator.decorate(tfUid);
    394395            valUid = UidInputFieldValidator.decorate(tfUid);
     
    410411
    411412            gc.gridx = 1;
    412             pnl.add(tfUserName = new JTextField(10),gc);
     413            pnl.add(tfUserName = new JosmTextField(10),gc);
    413414            SelectAllOnFocusGainedDecorator.decorate(tfUserName);
    414415            valUserName = UserNameInputValidator.decorate(tfUserName);
     
    635636        private JRadioButton rbClosedAfter;
    636637        private JRadioButton rbClosedAfterAndCreatedBefore;
    637         private JTextField tfClosedAfterDate1;
     638        private JosmTextField tfClosedAfterDate1;
    638639        private DateValidator valClosedAfterDate1;
    639         private JTextField tfClosedAfterTime1;
     640        private JosmTextField tfClosedAfterTime1;
    640641        private TimeValidator valClosedAfterTime1;
    641         private JTextField tfClosedAfterDate2;
     642        private JosmTextField tfClosedAfterDate2;
    642643        private DateValidator valClosedAfterDate2;
    643         private JTextField tfClosedAfterTime2;
     644        private JosmTextField tfClosedAfterTime2;
    644645        private TimeValidator valClosedAfterTime2;
    645         private JTextField tfCreatedBeforeDate;
     646        private JosmTextField tfCreatedBeforeDate;
    646647        private DateValidator valCreatedBeforeDate;
    647         private JTextField tfCreatedBeforeTime;
     648        private JosmTextField tfCreatedBeforeTime;
    648649        private TimeValidator valCreatedBeforeTime;
    649650
     
    658659            gc.gridx = 1;
    659660            gc.weightx = 0.7;
    660             pnl.add(tfClosedAfterDate1 = new JTextField(),gc);
     661            pnl.add(tfClosedAfterDate1 = new JosmTextField(),gc);
    661662            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate1);
    662663            valClosedAfterDate1 = DateValidator.decorate(tfClosedAfterDate1);
     
    669670            gc.gridx = 3;
    670671            gc.weightx = 0.3;
    671             pnl.add(tfClosedAfterTime1 = new JTextField(),gc);
     672            pnl.add(tfClosedAfterTime1 = new JosmTextField(),gc);
    672673            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime1);
    673674            valClosedAfterTime1 = TimeValidator.decorate(tfClosedAfterTime1);
     
    692693            gc.gridx = 2;
    693694            gc.weightx = 0.7;
    694             pnl.add(tfClosedAfterDate2 = new JTextField(),gc);
     695            pnl.add(tfClosedAfterDate2 = new JosmTextField(),gc);
    695696            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterDate2);
    696697            valClosedAfterDate2 = DateValidator.decorate(tfClosedAfterDate2);
     
    702703            gc.gridx = 4;
    703704            gc.weightx = 0.3;
    704             pnl.add(tfClosedAfterTime2 = new JTextField(),gc);
     705            pnl.add(tfClosedAfterTime2 = new JosmTextField(),gc);
    705706            SelectAllOnFocusGainedDecorator.decorate(tfClosedAfterTime2);
    706707            valClosedAfterTime2 = TimeValidator.decorate(tfClosedAfterTime2);
     
    722723            gc.gridx = 2;
    723724            gc.weightx = 0.7;
    724             pnl.add(tfCreatedBeforeDate = new JTextField(),gc);
     725            pnl.add(tfCreatedBeforeDate = new JosmTextField(),gc);
    725726            SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeDate);
    726727            valCreatedBeforeDate = DateValidator.decorate(tfCreatedBeforeDate);
     
    733734            gc.gridx = 4;
    734735            gc.weightx = 0.3;
    735             pnl.add(tfCreatedBeforeTime = new JTextField(),gc);
     736            pnl.add(tfCreatedBeforeTime = new JosmTextField(),gc);
    736737            SelectAllOnFocusGainedDecorator.decorate(tfCreatedBeforeTime);
    737738            valCreatedBeforeTime = TimeValidator.decorate(tfCreatedBeforeTime);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java

    r5266 r5886  
    1616import javax.swing.JLabel;
    1717import javax.swing.JPanel;
    18 import javax.swing.JTextField;
    1918import javax.swing.event.DocumentEvent;
    2019import javax.swing.event.DocumentListener;
     
    2726import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
    2827import org.openstreetmap.josm.tools.ImageProvider;
     28import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2929
    3030
    3131public class UrlBasedQueryPanel extends JPanel {
    3232
    33     private JTextField tfUrl;
     33    private JosmTextField tfUrl;
    3434    private JLabel lblValid;
    3535
     
    4545        gc.weightx = 1.0;
    4646        gc.fill = GridBagConstraints.HORIZONTAL;
    47         pnl.add(tfUrl = new JTextField(), gc);
     47        pnl.add(tfUrl = new JosmTextField(), gc);
    4848        tfUrl.getDocument().addDocumentListener(new ChangetQueryUrlValidator());
    4949        tfUrl.addFocusListener(
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r5773 r5886  
    4242import javax.swing.AbstractAction;
    4343import javax.swing.Action;
    44 import javax.swing.BorderFactory;
    4544import javax.swing.Box;
    4645import javax.swing.DefaultListCellRenderer;
     
    5049import javax.swing.JLabel;
    5150import javax.swing.JList;
    52 import javax.swing.JMenuItem;
    5351import javax.swing.JOptionPane;
    5452import javax.swing.JPanel;
     
    7977import org.openstreetmap.josm.tools.GBC;
    8078import org.openstreetmap.josm.tools.Shortcut;
    81 import org.openstreetmap.josm.tools.Utils;
    8279import org.openstreetmap.josm.tools.WindowGeometry;
    8380
     
    504501                }
    505502            });
    506             JMenuItem pasteK = new JMenuItem(
    507                 new AbstractAction(tr("Paste tag")){
    508                 public void actionPerformed(ActionEvent e) {
    509                     String buf = Utils.getClipboardContent().trim();
    510                     if (buf.isEmpty()) return;
    511                     keys.setSelectedItem(buf);
    512                 }
    513             });
    514             JMenuItem pasteV = new JMenuItem(
    515                 new AbstractAction(tr("Paste value")){
    516                 public void actionPerformed(ActionEvent e) {
    517                     String buf = Utils.getClipboardContent().trim();
    518                     if (buf.isEmpty()) return;
    519                     values.setSelectedItem(buf);
    520                 }
    521             });
    522            
    523503            {
    524                 add(pasteK);
    525                 add(pasteV);
    526                 addSeparator();
    527504                add(fixTagLanguageCb);
    528505                fixTagLanguageCb.setState(PROPERTY_FIX_TAG_LOCALE.get());
    529506            }
    530507        };
    531                
    532508    }
    533509
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r4420 r5886  
    1717import javax.swing.JPanel;
    1818import javax.swing.JScrollPane;
    19 import javax.swing.JTextArea;
    2019import javax.swing.SwingUtilities;
    2120import javax.swing.event.ListSelectionEvent;
     
    2423import org.openstreetmap.josm.Main;
    2524import org.openstreetmap.josm.data.Bounds;
    26 import org.openstreetmap.josm.data.coor.CoordinateFormat;
    2725import org.openstreetmap.josm.data.osm.BBox;
    2826import org.openstreetmap.josm.gui.BookmarkList;
    2927import org.openstreetmap.josm.gui.BookmarkList.Bookmark;
    3028import org.openstreetmap.josm.gui.JMultilineLabel;
     29import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    3130import org.openstreetmap.josm.tools.ImageProvider;
    3231
     
    5049    /** displays information about the current download area */
    5150    private JMultilineLabel lblCurrentDownloadArea;
    52     final private JTextArea bboxDisplay = new JTextArea();
     51    final private JosmTextArea bboxDisplay = new JosmTextArea();
    5352    /** the add action */
    5453    private AddAction actAdd;
  • trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    r5124 r5886  
    2323import javax.swing.JPanel;
    2424import javax.swing.JPopupMenu;
    25 import javax.swing.JTextArea;
    26 import javax.swing.JTextField;
    2725import javax.swing.UIManager;
    2826import javax.swing.border.Border;
     
    3432import org.openstreetmap.josm.data.coor.CoordinateFormat;
    3533import org.openstreetmap.josm.data.coor.LatLon;
     34import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636import org.openstreetmap.josm.tools.GBC;
    3737import org.openstreetmap.josm.tools.ImageProvider;
     
    4949public class BoundingBoxSelection implements DownloadSelection {
    5050
    51     private JTextField[] latlon = null;
    52     private final JTextArea tfOsmUrl = new JTextArea();
    53     private final JTextArea showUrl = new JTextArea();
     51    private JosmTextField[] latlon = null;
     52    private final JosmTextArea tfOsmUrl = new JosmTextArea();
     53    private final JosmTextArea showUrl = new JosmTextArea();
    5454    private DownloadDialog parent;
    5555
     
    6363
    6464    protected void buildDownloadAreaInputFields() {
    65         latlon = new JTextField[4];
     65        latlon = new JosmTextField[4];
    6666        for(int i=0; i< 4; i++) {
    67             latlon[i] = new JTextField(11);
    68             latlon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
     67            latlon[i] = new JosmTextField(11);
     68            latlon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height));
    6969            latlon[i].addFocusListener(new SelectAllOnFocusHandler(latlon[i]));
    7070        }
     
    160160    }
    161161
     162    /**
     163     * Replies the download area.
     164     * @return The download area
     165     */
    162166    public Bounds getDownloadArea() {
    163167        double[] values = new double[4];
     
    191195        latlon[2].setText(area.getMax().latToString(CoordinateFormat.DECIMAL_DEGREES));
    192196        latlon[3].setText(area.getMax().lonToString(CoordinateFormat.DECIMAL_DEGREES));
    193         for (JTextField tf: latlon) {
     197        for (JosmTextField tf: latlon) {
    194198            resetErrorMessage(tf);
    195199        }
     
    203207    private Border errorBorder = BorderFactory.createLineBorder(Color.RED, 1);
    204208
    205     protected void setErrorMessage(JTextField tf, String msg) {
     209    protected void setErrorMessage(JosmTextField tf, String msg) {
    206210        tf.setBorder(errorBorder);
    207211        tf.setToolTipText(msg);
    208212    }
    209213
    210     protected void resetErrorMessage(JTextField tf) {
     214    protected void resetErrorMessage(JosmTextField tf) {
    211215        tf.setBorder(UIManager.getBorder("TextField.border"));
    212216        tf.setToolTipText("");
     
    214218
    215219    class LatValueChecker extends FocusAdapter implements ActionListener{
    216         private JTextField tfLatValue;
    217 
    218         public LatValueChecker(JTextField tfLatValue) {
     220        private JosmTextField tfLatValue;
     221
     222        public LatValueChecker(JosmTextField tfLatValue) {
    219223            this.tfLatValue = tfLatValue;
    220224        }
     
    246250
    247251    class LonValueChecker extends FocusAdapter implements ActionListener {
    248         private JTextField tfLonValue;
    249 
    250         public LonValueChecker(JTextField tfLonValue) {
     252        private JosmTextField tfLonValue;
     253
     254        public LonValueChecker(JosmTextField tfLonValue) {
    251255            this.tfLonValue = tfLonValue;
    252256        }
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadObjectDialog.java

    r5786 r5886  
    2222import javax.swing.JOptionPane;
    2323import javax.swing.JPanel;
    24 import javax.swing.JTextField;
    2524import javax.swing.KeyStroke;
    2625import javax.swing.border.EtchedBorder;
     
    3635import org.openstreetmap.josm.gui.widgets.OsmPrimitiveTypesComboBox;
    3736import org.openstreetmap.josm.tools.Utils;
     37import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3838
    3939/**
     
    8282        cbId.setEditor(new BasicComboBoxEditor() {
    8383            @Override
    84             protected JTextField createEditorComponent() {
     84            protected JosmTextField createEditorComponent() {
    8585                return tfId;
    8686            }
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r5874 r5886  
    2424import javax.swing.JComponent;
    2525import javax.swing.JDialog;
    26 import javax.swing.JEditorPane;
    2726import javax.swing.JMenuItem;
    2827import javax.swing.JOptionPane;
     
    4039import javax.swing.text.Element;
    4140import javax.swing.text.SimpleAttributeSet;
     41import javax.swing.text.html.HTML.Tag;
    4242import javax.swing.text.html.HTMLDocument;
    4343import javax.swing.text.html.HTMLEditorKit;
    4444import javax.swing.text.html.StyleSheet;
    45 import javax.swing.text.html.HTML.Tag;
    4645
    4746import org.openstreetmap.josm.Main;
     
    4948import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    5049import org.openstreetmap.josm.gui.MainMenu;
     50import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    5151import org.openstreetmap.josm.tools.ImageProvider;
    5252import org.openstreetmap.josm.tools.OpenBrowser;
     
    106106
    107107    /** the help browser */
    108     private JEditorPane help;
     108    private JosmEditorPane help;
    109109
    110110    /** the help browser history */
     
    166166
    167167    protected void build() {
    168         help = new JEditorPane();
     168        help = new JosmEditorPane();
    169169        HTMLEditorKit kit = new HTMLEditorKit();
    170170        kit.setStyleSheet(buildStyleSheet());
  • trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    r5752 r5886  
    2626import javax.swing.JLabel;
    2727import javax.swing.JPanel;
    28 import javax.swing.JPasswordField;
    2928import javax.swing.JTextField;
    3029import javax.swing.KeyStroke;
     
    150149    protected static class CredentialPanel extends JPanel {
    151150        protected JTextField tfUserName;
    152         protected JPasswordField tfPassword;
     151        protected JosmPasswordField tfPassword;
    153152        protected JCheckBox cbSaveCredentials;
    154153        protected JMultilineLabel lblHeading;
  • trunk/src/org/openstreetmap/josm/gui/io/FilenameCellEditor.java

    r5266 r5886  
    1818import javax.swing.JPanel;
    1919import javax.swing.JTable;
    20 import javax.swing.JTextField;
    2120import javax.swing.event.CellEditorListener;
    2221import javax.swing.event.ChangeEvent;
     
    2423
    2524import org.openstreetmap.josm.actions.SaveActionBase;
     25import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2626
    2727/**
     
    3232 */
    3333class FilenameCellEditor extends JPanel implements TableCellEditor {
    34     private JTextField tfFileName;
     34    private JosmTextField tfFileName;
    3535    private CopyOnWriteArrayList<CellEditorListener> listeners;
    3636    private File value;
     
    4747        gc.weightx = 1.0;
    4848        gc.weighty = 1.0;
    49         add(tfFileName = new JTextField(), gc);
     49        add(tfFileName = new JosmTextField(), gc);
    5050
    5151        gc.gridx = 1;
  • trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java

    r5463 r5886  
    2222import javax.swing.JPanel;
    2323import javax.swing.JTable;
    24 import javax.swing.JTextField;
    2524import javax.swing.event.CellEditorListener;
    2625import javax.swing.event.ChangeEvent;
     
    3029import org.openstreetmap.josm.actions.SaveActionBase;
    3130import org.openstreetmap.josm.tools.GBC;
    32 
     31import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3332
    3433class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor {
     
    3938    private final JLabel lblLayerName = new JLabel();
    4039    private final JLabel lblFilename = new JLabel("");
    41     private final JTextField tfFilename = new JTextField();
     40    private final JosmTextField tfFilename = new JosmTextField();
    4241    private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction());
    4342
  • trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java

    r4191 r5886  
    1212
    1313import javax.swing.BorderFactory;
    14 import javax.swing.JEditorPane;
    1514import javax.swing.JLabel;
    1615import javax.swing.JPanel;
     
    2221
    2322import org.openstreetmap.josm.data.osm.Changeset;
     23import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    2424import org.openstreetmap.josm.io.OsmApi;
    2525import org.openstreetmap.josm.tools.ImageProvider;
     
    2828    private UploadStrategySpecification spec = new UploadStrategySpecification();
    2929    private int numObjects;
    30     private JEditorPane jepMessage;
     30    private JosmEditorPane jepMessage;
    3131    private JLabel lblWarning;
    3232
     
    103103
    104104    protected void build() {
    105         jepMessage = new JEditorPane("text/html", "");
     105        jepMessage = new JosmEditorPane("text/html", "");
    106106        jepMessage.setOpaque(false);
    107107        jepMessage.setEditable(false);
     
    142142    }
    143143
     144    /**
     145     * Constructs a new {@code UploadParameterSummaryPanel}.
     146     */
    144147    public UploadParameterSummaryPanel() {
    145148        build();
  • trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java

    r5266 r5886  
    2525import javax.swing.JPanel;
    2626import javax.swing.JRadioButton;
    27 import javax.swing.JTextField;
    2827import javax.swing.UIManager;
    2928import javax.swing.event.DocumentEvent;
     
    3433import org.openstreetmap.josm.io.OsmApi;
    3534import org.openstreetmap.josm.tools.ImageProvider;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636
    3737/**
     
    5656    private Map<UploadStrategy, JLabel> lblNumRequests;
    5757    private Map<UploadStrategy, JMultilineLabel> lblStrategies;
    58     private JTextField tfChunkSize;
     58    private JosmTextField tfChunkSize;
    5959    private JPanel pnlMultiChangesetPolicyPanel;
    6060    private JRadioButton rbFillOneChangeset;
     
    136136        gc.weighty = 0.0;
    137137        gc.gridwidth = 1;
    138         pnl.add(tfChunkSize = new JTextField(4), gc);
     138        pnl.add(tfChunkSize = new JosmTextField(4), gc);
    139139        gc.gridx = 3;
    140140        gc.gridy = 2;
     
    383383        public void focusGained(FocusEvent e) {
    384384            Component c = e.getComponent();
    385             if (c instanceof JTextField) {
    386                 JTextField tf = (JTextField)c;
     385            if (c instanceof JosmTextField) {
     386                JosmTextField tf = (JosmTextField)c;
    387387                tf.selectAll();
    388388            }
     
    392392
    393393    class ChunkSizeInputVerifier implements DocumentListener, PropertyChangeListener {
    394         protected void setErrorFeedback(JTextField tf, String message) {
     394        protected void setErrorFeedback(JosmTextField tf, String message) {
    395395            tf.setBorder(BorderFactory.createLineBorder(Color.RED, 1));
    396396            tf.setToolTipText(message);
     
    398398        }
    399399
    400         protected void clearErrorFeedback(JTextField tf, String message) {
     400        protected void clearErrorFeedback(JosmTextField tf, String message) {
    401401            tf.setBorder(UIManager.getBorder("TextField.border"));
    402402            tf.setToolTipText(message);
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r5869 r5886  
    3838import javax.swing.JPanel;
    3939import javax.swing.JScrollPane;
    40 import javax.swing.JTextArea;
    4140
    4241import org.openstreetmap.josm.Main;
     
    7978import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
    8079import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     80import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    8181import org.openstreetmap.josm.tools.DateUtils;
    8282import org.openstreetmap.josm.tools.FilteredCollection;
     
    697697                JPanel p = new JPanel(new GridBagLayout());
    698698                p.add(new JLabel(tr("Following problems found:")), GBC.eol());
    699                 JTextArea info = new JTextArea(result, 20, 60);
     699                JosmTextArea info = new JosmTextArea(result, 20, 60);
    700700                info.setCaretPosition(0);
    701701                info.setEditable(false);
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r5679 r5886  
    5353import javax.swing.JSeparator;
    5454import javax.swing.JSlider;
    55 import javax.swing.JTextField;
    5655import javax.swing.ListSelectionModel;
    5756import javax.swing.SwingConstants;
     
    8180import org.openstreetmap.josm.tools.PrimaryDateParser;
    8281import org.xml.sax.SAXException;
     82import org.openstreetmap.josm.gui.widgets.JosmTextField;
    8383
    8484/** This class displays the window to select the GPX file and the offset (timezone + delta).
     
    119119    JPanel outerPanel;
    120120    JosmComboBox cbGpx;
    121     JTextField tfTimezone;
    122     JTextField tfOffset;
     121    JosmTextField tfTimezone;
     122    JosmTextField tfOffset;
    123123    JCheckBox cbExifImg;
    124124    JCheckBox cbTaggedImg;
     
    224224        JPanel panel;
    225225        JLabel lbExifTime;
    226         JTextField tfGpsTime;
     226        JosmTextField tfGpsTime;
    227227        JosmComboBox cbTimezones;
    228228        ImageDisplay imgDisp;
     
    269269            panelTf.add(new JLabel(tr("Gps time (read from the above photo): ")), gc);
    270270
    271             tfGpsTime = new JTextField(12);
     271            tfGpsTime = new JosmTextField(12);
    272272            tfGpsTime.setEnabled(false);
    273273            tfGpsTime.setMinimumSize(new Dimension(155, tfGpsTime.getMinimumSize().height));
     
    495495        }
    496496
    497         tfTimezone = new JTextField(10);
     497        tfTimezone = new JosmTextField(10);
    498498        tfTimezone.setText(formatTimezone(timezone));
    499499
     
    505505        delta = delta / 1000;  // milliseconds -> seconds
    506506
    507         tfOffset = new JTextField(10);
     507        tfOffset = new JosmTextField(10);
    508508        tfOffset.setText(Long.toString(delta));
    509509
  • trunk/src/org/openstreetmap/josm/gui/oauth/AccessTokenInfoPanel.java

    r3530 r5886  
    1111import javax.swing.JLabel;
    1212import javax.swing.JPanel;
    13 import javax.swing.JTextField;
    1413
    1514import org.openstreetmap.josm.data.oauth.OAuthToken;
    1615import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
     16import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1717
    1818/**
     
    2222public class AccessTokenInfoPanel extends JPanel {
    2323
    24     private JTextField tfAccessTokenKey;
    25     private JTextField tfAccessTokenSecret;
     24    private JosmTextField tfAccessTokenKey;
     25    private JosmTextField tfAccessTokenSecret;
    2626    private JCheckBox cbSaveAccessTokenInPreferences;
    2727
     
    3939        gc.gridx = 1;
    4040        gc.weightx = 1.0;
    41         add(tfAccessTokenKey = new JTextField(), gc);
     41        add(tfAccessTokenKey = new JosmTextField(), gc);
    4242        tfAccessTokenKey.setEditable(false);
    4343
     
    5151        gc.gridx = 1;
    5252        gc.weightx = 1.0;
    53         add(tfAccessTokenSecret = new JTextField(), gc);
     53        add(tfAccessTokenSecret = new JosmTextField(), gc);
    5454        tfAccessTokenSecret.setEditable(false);
    5555
  • trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java

    r5422 r5886  
    1515import javax.swing.JLabel;
    1616import javax.swing.JOptionPane;
    17 import javax.swing.JTextField;
    1817
    1918import org.openstreetmap.josm.data.Preferences;
     
    2625import org.openstreetmap.josm.tools.CheckParameterUtil;
    2726import org.openstreetmap.josm.tools.ImageProvider;
     27import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2828
    2929/**
     
    4141
    4242    private JCheckBox cbUseDefaults;
    43     private JTextField tfConsumerKey;
    44     private JTextField tfConsumerSecret;
    45     private JTextField tfRequestTokenURL;
    46     private JTextField tfAccessTokenURL;
    47     private JTextField tfAuthoriseURL;
     43    private JosmTextField tfConsumerKey;
     44    private JosmTextField tfConsumerSecret;
     45    private JosmTextField tfRequestTokenURL;
     46    private JosmTextField tfAccessTokenURL;
     47    private JosmTextField tfAuthoriseURL;
    4848    private UseDefaultItemListener ilUseDefault;
    4949    private String apiUrl;
     
    7070        gc.gridx = 1;
    7171        gc.weightx = 1.0;
    72         add(tfConsumerKey = new JTextField(), gc);
     72        add(tfConsumerKey = new JosmTextField(), gc);
    7373        SelectAllOnFocusGainedDecorator.decorate(tfConsumerKey);
    7474
     
    8181        gc.gridx = 1;
    8282        gc.weightx = 1.0;
    83         add(tfConsumerSecret = new JTextField(), gc);
     83        add(tfConsumerSecret = new JosmTextField(), gc);
    8484        SelectAllOnFocusGainedDecorator.decorate(tfConsumerSecret);
    8585
     
    9292        gc.gridx = 1;
    9393        gc.weightx = 1.0;
    94         add(tfRequestTokenURL = new JTextField(), gc);
     94        add(tfRequestTokenURL = new JosmTextField(), gc);
    9595        SelectAllOnFocusGainedDecorator.decorate(tfRequestTokenURL);
    9696
     
    103103        gc.gridx = 1;
    104104        gc.weightx = 1.0;
    105         add(tfAccessTokenURL = new JTextField(), gc);
     105        add(tfAccessTokenURL = new JosmTextField(), gc);
    106106        SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenURL);
    107107
     
    115115        gc.gridx = 1;
    116116        gc.weightx = 1.0;
    117         add(tfAuthoriseURL = new JTextField(), gc);
     117        add(tfAuthoriseURL = new JosmTextField(), gc);
    118118        SelectAllOnFocusGainedDecorator.decorate(tfAuthoriseURL);
    119119
     
    177177    protected void setChildComponentsEnabled(boolean enabled){
    178178        for (Component c: getComponents()) {
    179             if (c instanceof JTextField || c instanceof JLabel) {
     179            if (c instanceof JosmTextField || c instanceof JLabel) {
    180180                c.setEnabled(enabled);
    181181            }
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r5752 r5886  
    1313import java.awt.event.ActionEvent;
    1414import java.io.IOException;
     15import java.net.Authenticator.RequestorType;
    1516import java.net.PasswordAuthentication;
    16 import java.net.Authenticator.RequestorType;
    1717
    1818import javax.swing.AbstractAction;
     
    2121import javax.swing.JOptionPane;
    2222import javax.swing.JPanel;
    23 import javax.swing.JPasswordField;
    2423import javax.swing.JTabbedPane;
    25 import javax.swing.JTextField;
    2624import javax.swing.event.DocumentEvent;
    2725import javax.swing.event.DocumentListener;
     
    4139import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    4240import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
     41import org.openstreetmap.josm.gui.widgets.JosmTextField;
    4342import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    4443import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
     
    5958public class FullyAutomaticAuthorizationUI extends AbstractAuthorizationUI {
    6059
    61     private JTextField tfUserName;
    62     private JPasswordField tfPassword;
     60    private JosmTextField tfUserName;
     61    private JosmPasswordField tfPassword;
    6362    private UserNameValidator valUserName;
    6463    private PasswordValidator valPassword;
     
    116115        gc.gridx = 1;
    117116        gc.weightx = 1.0;
    118         pnl.add(tfUserName = new JTextField(), gc);
     117        pnl.add(tfUserName = new JosmTextField(), gc);
    119118        SelectAllOnFocusGainedDecorator.decorate(tfUserName);
    120119        valUserName = new UserNameValidator(tfUserName);
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticPropertiesPanel.java

    r5752 r5886  
    1212import javax.swing.JLabel;
    1313import javax.swing.JPanel;
    14 import javax.swing.JPasswordField;
    15 import javax.swing.JTextField;
    1614import javax.swing.text.JTextComponent;
    1715
    1816import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator;
    1917import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
     18import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2019import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    2120
    2221public class FullyAutomaticPropertiesPanel extends JPanel {
    2322
    24     private JTextField tfUserName;
    25     private JPasswordField tfPassword;
     23    private JosmTextField tfUserName;
     24    private JosmPasswordField tfPassword;
    2625    private UserNameValidator valUserName;
    2726
     
    4342        gc.gridx = 1;
    4443        gc.weightx = 1.0;
    45         pnl.add(tfUserName = new JTextField(), gc);
     44        pnl.add(tfUserName = new JosmTextField(), gc);
    4645        SelectAllOnFocusGainedDecorator.decorate(tfUserName);
    4746        valUserName = new UserNameValidator(tfUserName);
  • trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java

    r5422 r5886  
    1919import javax.swing.JPanel;
    2020import javax.swing.JTabbedPane;
    21 import javax.swing.JTextField;
    2221import javax.swing.event.DocumentEvent;
    2322import javax.swing.event.DocumentListener;
     
    3231import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    3332import org.openstreetmap.josm.tools.ImageProvider;
     33import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3434
    3535/**
     
    4141public class ManualAuthorizationUI extends AbstractAuthorizationUI{
    4242
    43     private JTextField tfAccessTokenKey;
     43    private JosmTextField tfAccessTokenKey;
    4444    private AccessTokenKeyValidator valAccessTokenKey;
    45     private JTextField tfAccessTokenSecret;
     45    private JosmTextField tfAccessTokenSecret;
    4646    private AccessTokenSecretValidator valAccessTokenSecret;
    4747    private JCheckBox cbSaveToPreferences;
     
    7676        gc.gridx = 1;
    7777        gc.weightx = 1.0;
    78         pnl.add(tfAccessTokenKey = new JTextField(), gc);
     78        pnl.add(tfAccessTokenKey = new JosmTextField(), gc);
    7979        SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenKey);
    8080        valAccessTokenKey = new AccessTokenKeyValidator(tfAccessTokenKey);
     
    9090        gc.gridx = 1;
    9191        gc.weightx = 1.0;
    92         pnl.add(tfAccessTokenSecret = new JTextField(), gc);
     92        pnl.add(tfAccessTokenSecret = new JosmTextField(), gc);
    9393        SelectAllOnFocusGainedDecorator.decorate(tfAccessTokenSecret);
    9494        valAccessTokenSecret = new AccessTokenSecretValidator(tfAccessTokenSecret);
  • trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java

    r5422 r5886  
    2020import javax.swing.JLabel;
    2121import javax.swing.JPanel;
    22 import javax.swing.JTextField;
    2322import javax.swing.SwingUtilities;
    2423
     
    3130import org.openstreetmap.josm.tools.ImageProvider;
    3231import org.openstreetmap.josm.tools.OpenBrowser;
     32import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3333
    3434/**
     
    207207    private class RetrieveAccessTokenPanel extends JPanel {
    208208
    209         private JTextField tfAuthoriseUrl;
     209        private JosmTextField tfAuthoriseUrl;
    210210
    211211        protected JPanel buildTitlePanel() {
     
    246246            gc.gridx = 1;
    247247            gc.weightx = 1.0;
    248             pnl.add(tfAuthoriseUrl = new JTextField(), gc);
     248            pnl.add(tfAuthoriseUrl = new JosmTextField(), gc);
    249249            tfAuthoriseUrl.setEditable(false);
    250250
  • trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java

    r4976 r5886  
    1010import javax.swing.JLabel;
    1111import javax.swing.JPanel;
    12 import javax.swing.JTextField;
    1312
    1413import org.openstreetmap.josm.Main;
    1514import org.openstreetmap.josm.tools.GBC;
     15import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1616
    1717/*
     
    5050    private JCheckBox audioMarkersFromStart = new JCheckBox(tr("Start of track (will always do this if no other markers available)."));
    5151
    52     private JTextField audioLeadIn = new JTextField(8);
    53     private JTextField audioForwardBackAmount = new JTextField(8);
    54     private JTextField audioFastForwardMultiplier = new JTextField(8);
    55     private JTextField audioCalibration = new JTextField(8);
     52    private JosmTextField audioLeadIn = new JosmTextField(8);
     53    private JosmTextField audioForwardBackAmount = new JosmTextField(8);
     54    private JosmTextField audioFastForwardMultiplier = new JosmTextField(8);
     55    private JosmTextField audioCalibration = new JosmTextField(8);
    5656
    5757    public void addGui(PreferenceTabbedPane gui) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r5723 r5886  
    3030import javax.swing.JScrollPane;
    3131import javax.swing.JTabbedPane;
    32 import javax.swing.JTextField;
    3332import javax.swing.SwingUtilities;
    3433import javax.swing.UIManager;
     
    5352import org.openstreetmap.josm.tools.GBC;
    5453import org.openstreetmap.josm.tools.ImageProvider;
     54import org.openstreetmap.josm.gui.widgets.JosmTextField;
    5555
    5656public class PluginPreference extends DefaultTabPreferenceSetting {
     
    9898    }
    9999
    100     private JTextField tfFilter;
     100    private JosmTextField tfFilter;
    101101    private PluginListPanel pnlPluginPreferences;
    102102    private PluginPreferencesModel model;
     
    123123        gc.gridx = 1;
    124124        gc.weightx = 1.0;
    125         pnl.add(tfFilter = new JTextField(), gc);
     125        pnl.add(tfFilter = new JosmTextField(), gc);
    126126        tfFilter.setToolTipText(tr("Enter a search expression"));
    127127        SelectAllOnFocusGainedDecorator.decorate(tfFilter);
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r5874 r5886  
    5959import javax.swing.JSeparator;
    6060import javax.swing.JTable;
    61 import javax.swing.JTextField;
    6261import javax.swing.JToolBar;
    6362import javax.swing.KeyStroke;
     
    7473import javax.swing.table.DefaultTableCellRenderer;
    7574import javax.swing.table.TableCellEditor;
    76 import javax.swing.table.TableCellRenderer;
    7775
    7876import org.openstreetmap.josm.Main;
     
    8583import org.openstreetmap.josm.gui.util.TableHelper;
    8684import org.openstreetmap.josm.gui.widgets.JFileChooserManager;
     85import org.openstreetmap.josm.gui.widgets.JosmTextField;
    8786import org.openstreetmap.josm.io.MirroredInputStream;
    8887import org.openstreetmap.josm.io.OsmTransferException;
     
    680679    protected class EditSourceEntryDialog extends ExtendedDialog {
    681680
    682         private JTextField tfTitle;
    683         private JTextField tfURL;
     681        private JosmTextField tfTitle;
     682        private JosmTextField tfURL;
    684683        private JCheckBox cbActive;
    685684
     
    691690            JPanel p = new JPanel(new GridBagLayout());
    692691
    693             tfTitle = new JTextField(60);
     692            tfTitle = new JosmTextField(60);
    694693            p.add(new JLabel(tr("Name (optional):")), GBC.std().insets(15, 0, 5, 5));
    695694            p.add(tfTitle, GBC.eol().insets(0, 0, 5, 5));
    696695
    697             tfURL = new JTextField(60);
     696            tfURL = new JosmTextField(60);
    698697            p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0));
    699698            p.add(tfURL, GBC.std().insets(0, 0, 5, 5));
     
    13181317
    13191318    class FileOrUrlCellEditor extends JPanel implements TableCellEditor {
    1320         private JTextField tfFileName;
     1319        private JosmTextField tfFileName;
    13211320        private CopyOnWriteArrayList<CellEditorListener> listeners;
    13221321        private String value;
     
    13341333            gc.weightx = 1.0;
    13351334            gc.weighty = 1.0;
    1336             add(tfFileName = new JTextField(), gc);
     1335            add(tfFileName = new JosmTextField(), gc);
    13371336
    13381337            gc.gridx = 1;
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java

    r5590 r5886  
    3434import javax.swing.JScrollPane;
    3535import javax.swing.JTable;
    36 import javax.swing.JTextField;
    3736import javax.swing.event.DocumentEvent;
    3837import javax.swing.event.DocumentListener;
     
    5655import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    5756import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     57import org.openstreetmap.josm.gui.widgets.JosmTextField;
    5858import org.openstreetmap.josm.tools.CheckParameterUtil;
    5959import org.openstreetmap.josm.tools.GBC;
     
    144144    protected List<PrefEntry> data;
    145145    protected List<PrefEntry> displayData;
    146     protected JTextField txtFilter;
     146    protected JosmTextField txtFilter;
    147147
    148148    public void addGui(final PreferenceTabbedPane gui) {
    149149        JPanel p = gui.createPreferenceTab(this);
    150150
    151         txtFilter = new JTextField();
     151        txtFilter = new JosmTextField();
    152152        JLabel lbFilter = new JLabel(tr("Search: "));
    153153        lbFilter.setLabelFor(txtFilter);
     
    453453    private static class SettingCellEditor extends DefaultCellEditor {
    454454        public SettingCellEditor() {
    455             super(new JTextField());
     455            super(new JosmTextField());
    456456        }
    457457
     
    523523        JPanel p = new JPanel(new GridBagLayout());
    524524        p.add(new JLabel(tr("Key")), GBC.std().insets(0,0,5,0));
    525         JTextField tkey = new JTextField("", 50);
     525        JosmTextField tkey = new JosmTextField("", 50);
    526526        p.add(tkey, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL));
    527527
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java

    r4634 r5886  
    1414import javax.swing.JScrollPane;
    1515import javax.swing.JTable;
    16 import javax.swing.JTextField;
    1716import javax.swing.table.AbstractTableModel;
    1817
     
    2120import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    2221import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
     22import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2323import org.openstreetmap.josm.tools.GBC;
    2424import org.openstreetmap.josm.tools.WindowGeometry;
     
    5555        table.setTableHeader(null);
    5656
    57         DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
     57        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
    5858        editor.setClickCountToStart(1);
    5959        table.setDefaultEditor(table.getColumnClass(0), editor);
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java

    r4634 r5886  
    1919import javax.swing.JScrollPane;
    2020import javax.swing.JTable;
    21 import javax.swing.JTextField;
    2221import javax.swing.JToolBar;
    2322import javax.swing.event.ListSelectionEvent;
    2423import javax.swing.event.ListSelectionListener;
     24import javax.swing.table.AbstractTableModel;
    2525import javax.swing.table.TableCellEditor;
    26 import javax.swing.table.AbstractTableModel;
    2726
    2827import org.openstreetmap.josm.data.Preferences.ListListSetting;
     
    3029import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    3130import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
     31import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3232import org.openstreetmap.josm.tools.GBC;
    3333import org.openstreetmap.josm.tools.ImageProvider;
     
    9595        table.setTableHeader(null);
    9696
    97         DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
     97        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
    9898        editor.setClickCountToStart(1);
    9999        table.setDefaultEditor(table.getColumnClass(0), editor);
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java

    r5590 r5886  
    2323import javax.swing.JScrollPane;
    2424import javax.swing.JTable;
    25 import javax.swing.JTextField;
    2625import javax.swing.JToolBar;
    2726import javax.swing.event.ListSelectionEvent;
    2827import javax.swing.event.ListSelectionListener;
     28import javax.swing.table.AbstractTableModel;
    2929import javax.swing.table.TableCellEditor;
    30 import javax.swing.table.AbstractTableModel;
    3130
    3231import org.openstreetmap.josm.data.Preferences.MapListSetting;
     
    3433import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    3534import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636import org.openstreetmap.josm.tools.GBC;
    3737import org.openstreetmap.josm.tools.ImageProvider;
     
    117117        table.getTableHeader().getColumnModel().getColumn(0).setHeaderValue(tr("Key"));
    118118        table.getTableHeader().getColumnModel().getColumn(1).setHeaderValue(tr("Value"));
    119         DefaultCellEditor editor = new DefaultCellEditor(new JTextField());
     119        DefaultCellEditor editor = new DefaultCellEditor(new JosmTextField());
    120120        editor.setClickCountToStart(1);
    121121        table.setDefaultEditor(table.getColumnClass(0), editor);
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r4634 r5886  
    88import javax.swing.JLabel;
    99import javax.swing.JPanel;
    10 import javax.swing.JTextField;
    1110
    1211import org.openstreetmap.josm.data.Preferences.StringSetting;
     
    1413import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    1514import org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference.PrefEntry;
     15import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1616import org.openstreetmap.josm.tools.GBC;
    1717
     
    1919
    2020    PrefEntry entry;
    21     JTextField tvalue;
     21    JosmTextField tvalue;
    2222
    2323    public StringEditor(final PreferenceTabbedPane gui, PrefEntry entry, StringSetting setting) {
     
    3737
    3838        p.add(new JLabel(tr("Value: ")), GBC.std());
    39         tvalue = new JTextField(orig, 50);
     39        tvalue = new JosmTextField(orig, 50);
    4040        p.add(tvalue, GBC.eop().insets(5,0,0,0).fill(GBC.HORIZONTAL));
    4141
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r5568 r5886  
    1717import javax.swing.JPanel;
    1818import javax.swing.JRadioButton;
    19 import javax.swing.JTextField;
    2019import javax.swing.event.ChangeEvent;
    2120import javax.swing.event.ChangeListener;
     
    3029import org.openstreetmap.josm.tools.template_engine.ParseError;
    3130import org.openstreetmap.josm.tools.template_engine.TemplateParser;
     31import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3232
    3333public class GPXSettingsPanel extends JPanel implements ValidationListener {
     
    4545    private JRadioButton drawRawGpsLinesNone = new JRadioButton(tr("None"));
    4646    private ActionListener drawRawGpsLinesActionListener;
    47     private JTextField drawRawGpsMaxLineLength = new JTextField(8);
    48     private JTextField drawRawGpsMaxLineLengthLocal = new JTextField(8);
    49     private JTextField drawLineWidth = new JTextField(2);
     47    private JosmTextField drawRawGpsMaxLineLength = new JosmTextField(8);
     48    private JosmTextField drawRawGpsMaxLineLengthLocal = new JosmTextField(8);
     49    private JosmTextField drawLineWidth = new JosmTextField(2);
    5050    private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported"));
    5151    private JCheckBox largeGpsPoints = new JCheckBox(tr("Draw large GPS points"));
     
    6262    private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows"));
    6363    private JCheckBox drawGpsArrowsFast = new JCheckBox(tr("Fast drawing (looks uglier)"));
    64     private JTextField drawGpsArrowsMinDist = new JTextField(8);
     64    private JosmTextField drawGpsArrowsMinDist = new JosmTextField(8);
    6565    private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits"));
    6666    private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    67     private JTextField waypointLabelPattern = new JTextField();
     67    private JosmTextField waypointLabelPattern = new JosmTextField();
    6868    private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    69     private JTextField audioWaypointLabelPattern = new JTextField();
     69    private JosmTextField audioWaypointLabelPattern = new JosmTextField();
    7070    private JCheckBox useGpsAntialiasing = new JCheckBox(tr("Smooth GPX graphics (antialiasing)"));
    7171
     
    422422    }
    423423
    424     private void updateWaypointLabelCombobox(JosmComboBox cb, JTextField tf, TemplateEntryProperty property) {
     424    private void updateWaypointLabelCombobox(JosmComboBox cb, JosmTextField tf, TemplateEntryProperty property) {
    425425        String labelPattern = property.getAsString();
    426426        boolean found = false;
     
    439439    }
    440440
    441     private void updateWaypointPattern(JosmComboBox cb, JTextField tf) {
     441    private void updateWaypointPattern(JosmComboBox cb, JosmTextField tf) {
    442442        if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) {
    443443            tf.setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddImageryPanel.java

    r5731 r5886  
    99import javax.swing.AbstractButton;
    1010import javax.swing.JPanel;
    11 import javax.swing.JTextArea;
    12 import javax.swing.JTextField;
    1311import javax.swing.event.ChangeEvent;
    1412import javax.swing.event.ChangeListener;
     
    1816
    1917import org.openstreetmap.josm.data.imagery.ImageryInfo;
     18import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     19import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2020
    2121/**
     
    2727public abstract class AddImageryPanel extends JPanel {
    2828
    29     protected final JTextArea rawUrl = new JTextArea(3, 40);
    30     protected final JTextField name = new JTextField();
     29    protected final JosmTextArea rawUrl = new JosmTextArea(3, 40);
     30    protected final JosmTextField name = new JosmTextField();
    3131   
    3232    protected final Collection<ContentValidationListener> listeners = new ArrayList<ContentValidationListener>();
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddTMSLayerPanel.java

    r5731 r5886  
    1010
    1111import javax.swing.JLabel;
    12 import javax.swing.JTextArea;
    13 import javax.swing.JTextField;
    1412import javax.swing.text.View;
    1513
    1614import org.openstreetmap.josm.data.imagery.ImageryInfo;
     15import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     16import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1717import org.openstreetmap.josm.tools.GBC;
    1818import org.openstreetmap.josm.tools.Utils;
     
    2020public class AddTMSLayerPanel extends AddImageryPanel {
    2121
    22     private final JTextField tmsZoom = new JTextField();
    23     private final JTextArea tmsUrl = new JTextArea(3, 40);
     22    private final JosmTextField tmsZoom = new JosmTextField();
     23    private final JosmTextArea tmsUrl = new JosmTextArea(3, 40);
    2424    private final KeyAdapter keyAdapter = new KeyAdapter() {
    2525        @Override
     
    2929    };
    3030
     31    /**
     32     * Constructs a new {@code AddTMSLayerPanel}.
     33     */
    3134    public AddTMSLayerPanel() {
    3235
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r5731 r5886  
    1818import javax.swing.JOptionPane;
    1919import javax.swing.JScrollPane;
    20 import javax.swing.JTextArea;
    2120
    2221import org.openstreetmap.josm.data.imagery.ImageryInfo;
    2322import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
     23import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2424import org.openstreetmap.josm.io.imagery.WMSImagery;
    2525import org.openstreetmap.josm.tools.GBC;
     
    3232    private final WMSLayerTree tree = new WMSLayerTree();
    3333    private final JLabel wmsInstruction;
    34     private final JTextArea wmsUrl = new JTextArea(3, 40);
     34    private final JosmTextArea wmsUrl = new JosmTextArea(3, 40);
    3535    private final JButton showBounds = new JButton(tr("Show bounds"));
    3636
     37    /**
     38     * Constructs a new {@code AddWMSLayerPanel}.
     39     */
    3740    public AddWMSLayerPanel() {
    3841
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r5733 r5886  
    2929import javax.swing.Box;
    3030import javax.swing.JButton;
    31 import javax.swing.JEditorPane;
    3231import javax.swing.JLabel;
    3332import javax.swing.JOptionPane;
     
    6261import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
    6362import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     63import org.openstreetmap.josm.gui.widgets.JosmEditorPane;
    6464import org.openstreetmap.josm.tools.GBC;
    6565import org.openstreetmap.josm.tools.ImageProvider;
     
    663663            try {
    664664                url = new URL(eulaUrl.replaceAll("\\{lang\\}", LanguageInfo.getWikiLanguagePrefix()));
    665                 JEditorPane htmlPane = null;
     665                JosmEditorPane htmlPane = null;
    666666                try {
    667                     htmlPane = new JEditorPane(url);
     667                    htmlPane = new JosmEditorPane(url);
    668668                } catch (IOException e1) {
    669669                    // give a second chance with a default Locale 'en'
    670670                    try {
    671671                        url = new URL(eulaUrl.replaceAll("\\{lang\\}", ""));
    672                         htmlPane = new JEditorPane(url);
     672                        htmlPane = new JosmEditorPane(url);
    673673                    } catch (IOException e2) {
    674674                        JOptionPane.showMessageDialog(gui ,tr("EULA license URL not available: {0}", eulaUrl));
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java

    r5465 r5886  
    1010import javax.swing.JPanel;
    1111import javax.swing.JSpinner;
    12 import javax.swing.JTextField;
    1312import javax.swing.SpinnerNumberModel;
    1413
    1514import org.openstreetmap.josm.gui.layer.TMSLayer;
    1615import org.openstreetmap.josm.tools.GBC;
     16import org.openstreetmap.josm.gui.widgets.JosmTextField;
    1717
    1818/**
     
    2828    private final JSpinner maxZoomLvl;
    2929    private final JCheckBox addToSlippyMapChosser = new JCheckBox();
    30     private final JTextField tilecacheDir = new JTextField();
     30    private final JosmTextField tilecacheDir = new JosmTextField();
    3131
    3232    /**
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java

    r5631 r5886  
    1515import javax.swing.JScrollPane;
    1616import javax.swing.JSeparator;
    17 import javax.swing.JTextField;
    1817
    1918import org.openstreetmap.josm.data.AutosaveTask;
     
    2625import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    2726import org.openstreetmap.josm.tools.GBC;
     27import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2828
    2929public class BackupPreference implements SubPreferenceSetting {
     
    3838    private JCheckBox keepBackup;
    3939    private JCheckBox autosave;
    40     private final JTextField autosaveInterval = new JTextField(8);
    41     private final JTextField backupPerLayer = new JTextField(8);
     40    private final JosmTextField autosaveInterval = new JosmTextField(8);
     41    private final JosmTextField backupPerLayer = new JosmTextField(8);
    4242
    4343    @Override
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r5511 r5886  
    1515import javax.swing.JPanel;
    1616import javax.swing.JRadioButton;
    17 import javax.swing.JTextField;
    1817import javax.swing.event.ChangeEvent;
    1918import javax.swing.event.ChangeListener;
     
    2322import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    2423import org.openstreetmap.josm.plugins.PluginHandler;
     24import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2525
    2626/**
     
    5959    private Map<Policy, JRadioButton> rbVersionBasedUpatePolicy;
    6060    private Map<Policy, JRadioButton> rbTimeBasedUpatePolicy;
    61     private JTextField tfUpdateInterval;
     61    private JosmTextField tfUpdateInterval;
    6262    private JLabel lblUpdateInterval;
    6363
     
    9696        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
    9797        pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):")));
    98         pnl.add(tfUpdateInterval = new JTextField(5));
     98        pnl.add(tfUpdateInterval = new JosmTextField(5));
    9999        SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval);
    100100        return pnl;
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java

    r5634 r5886  
    1919import javax.swing.JPanel;
    2020import javax.swing.JScrollPane;
    21 import javax.swing.JTextField;
    2221import javax.swing.event.DocumentEvent;
    2322import javax.swing.event.DocumentListener;
     
    2827import org.openstreetmap.josm.data.projection.Projections;
    2928import org.openstreetmap.josm.tools.GBC;
     29import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3030
    3131/**
     
    4242    private class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
    4343
    44         public JTextField filter;
     44        public JosmTextField filter;
    4545        private ProjectionCodeListModel model;
    4646        public JList selectionList;
     
    108108
    109109        private void build() {
    110             filter = new JTextField(30);
     110            filter = new JosmTextField(30);
    111111            filter.setColumns(10);
    112112            filter.getDocument().addDocumentListener(this);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r5634 r5886  
    2121import javax.swing.JLabel;
    2222import javax.swing.JPanel;
    23 import javax.swing.JTextField;
    2423import javax.swing.plaf.basic.BasicComboBoxEditor;
    2524
     
    3736import org.openstreetmap.josm.tools.ImageProvider;
    3837import org.openstreetmap.josm.tools.Utils;
     38import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3939
    4040public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions {
     
    4848    private static class PreferencePanel extends JPanel {
    4949
    50         public JTextField input;
     50        public JosmTextField input;
    5151        private HistoryComboBox cbInput;
    5252
     
    5656
    5757        private void build(String initialText, final ActionListener listener) {
    58             input = new JTextField(30);
     58            input = new JosmTextField(30);
    5959            cbInput = new HistoryComboBox();
    6060            cbInput.setPrototypeDisplayValue(new AutoCompletionListItem("xxxx"));
    6161            cbInput.setEditor(new BasicComboBoxEditor() {
    6262                @Override
    63                 protected JTextField createEditorComponent() {
     63                protected JosmTextField createEditorComponent() {
    6464                    return input;
    6565                }
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java

    r5752 r5886  
    88import java.awt.GridBagLayout;
    99import java.awt.Insets;
     10import java.net.Authenticator.RequestorType;
    1011import java.net.PasswordAuthentication;
    11 import java.net.Authenticator.RequestorType;
    1212
    1313import javax.swing.BorderFactory;
    1414import javax.swing.JLabel;
    1515import javax.swing.JPanel;
    16 import javax.swing.JPasswordField;
    17 import javax.swing.JTextField;
    1816
    1917import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
     18import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2019import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
     20import org.openstreetmap.josm.io.OsmApi;
    2121import org.openstreetmap.josm.io.auth.CredentialsAgent;
    2222import org.openstreetmap.josm.io.auth.CredentialsAgentException;
    2323import org.openstreetmap.josm.io.auth.CredentialsManager;
    24 import org.openstreetmap.josm.io.OsmApi;
    2524
    2625/**
     
    3231
    3332    /** the OSM user name */
    34     private JTextField tfOsmUserName;
     33    private JosmTextField tfOsmUserName;
    3534    private UserNameValidator valUserName;
    3635    /** the OSM password */
    37     private JPasswordField tfOsmPassword;
     36    private JosmPasswordField tfOsmPassword;
    3837    /** a panel with further information, e.g. some warnings */
    3938    private JPanel decorationPanel;
     
    5655        gc.gridx = 1;
    5756        gc.weightx = 1.0;
    58         add(tfOsmUserName = new JTextField(), gc);
     57        add(tfOsmUserName = new JosmTextField(), gc);
    5958        SelectAllOnFocusGainedDecorator.decorate(tfOsmUserName);
    6059        valUserName = new UserNameValidator(tfOsmUserName);
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r5422 r5886  
    2222import javax.swing.JLabel;
    2323import javax.swing.JPanel;
    24 import javax.swing.JTextField;
    2524
    2625import org.openstreetmap.josm.Main;
     
    3433import org.openstreetmap.josm.io.auth.CredentialsManager;
    3534import org.openstreetmap.josm.tools.ImageProvider;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636
    3737/**
     
    214214     */
    215215    private class AlreadyAuthorisedPanel extends JPanel {
    216         private JTextField tfAccessTokenKey;
    217         private JTextField tfAccessTokenSecret;
     216        private JosmTextField tfAccessTokenKey;
     217        private JosmTextField tfAccessTokenSecret;
    218218
    219219        protected void build() {
     
    238238            gc.gridx = 1;
    239239            gc.weightx = 1.0;
    240             add(tfAccessTokenKey = new JTextField(), gc);
     240            add(tfAccessTokenKey = new JosmTextField(), gc);
    241241            tfAccessTokenKey.setEditable(false);
    242242
     
    250250            gc.gridx = 1;
    251251            gc.weightx = 1.0;
    252             add(tfAccessTokenSecret = new JTextField(), gc);
     252            add(tfAccessTokenSecret = new JosmTextField(), gc);
    253253            tfAccessTokenSecret.setEditable(false);
    254254
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r5422 r5886  
    2121import javax.swing.JLabel;
    2222import javax.swing.JPanel;
    23 import javax.swing.JTextField;
    2423import javax.swing.SwingUtilities;
    2524import javax.swing.event.DocumentEvent;
     
    3433import org.openstreetmap.josm.io.OsmApi;
    3534import org.openstreetmap.josm.tools.ImageProvider;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636
    3737public class OsmApiUrlInputPanel extends JPanel {
     
    4040    private JLabel lblValid;
    4141    private JLabel lblApiUrl;
    42     private JTextField tfOsmServerUrl;
     42    private JosmTextField tfOsmServerUrl;
    4343    private ApiUrlValidator valOsmServerUrl;
    4444    private SideButton btnTest;
     
    9090        gc.gridx = 1;
    9191        gc.weightx = 1.0;
    92         add(tfOsmServerUrl = new JTextField(), gc);
     92        add(tfOsmServerUrl = new JosmTextField(), gc);
    9393        SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl);
    9494        valOsmServerUrl = new ApiUrlValidator(tfOsmServerUrl);
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r5752 r5886  
    1212import java.awt.event.ItemEvent;
    1313import java.awt.event.ItemListener;
     14import java.net.Authenticator.RequestorType;
    1415import java.net.PasswordAuthentication;
    1516import java.net.ProxySelector;
    16 import java.net.Authenticator.RequestorType;
    1717import java.util.HashMap;
    1818import java.util.Map;
     
    2222import javax.swing.JLabel;
    2323import javax.swing.JPanel;
    24 import javax.swing.JPasswordField;
    2524import javax.swing.JRadioButton;
    26 import javax.swing.JTextField;
    2725
    2826import org.openstreetmap.josm.Main;
     
    3028import org.openstreetmap.josm.gui.help.HelpUtil;
    3129import org.openstreetmap.josm.gui.widgets.JosmPasswordField;
     30import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3231import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    3332import org.openstreetmap.josm.io.DefaultProxySelector;
     
    7574    private ButtonGroup bgProxyPolicy;
    7675    private Map<ProxyPolicy, JRadioButton> rbProxyPolicy;
    77     private JTextField tfProxyHttpHost;
    78     private JTextField tfProxyHttpPort;
    79     private JTextField tfProxySocksHost;
    80     private JTextField tfProxySocksPort;
    81     private JTextField tfProxyHttpUser;
    82     private JPasswordField tfProxyHttpPassword;
     76    private JosmTextField tfProxyHttpHost;
     77    private JosmTextField tfProxyHttpPort;
     78    private JosmTextField tfProxySocksHost;
     79    private JosmTextField tfProxySocksPort;
     80    private JosmTextField tfProxyHttpUser;
     81    private JosmPasswordField tfProxyHttpPassword;
    8382
    8483    private JPanel pnlHttpProxyConfigurationPanel;
     
    107106        gc.gridx = 1;
    108107        gc.weightx = 1.0;
    109         pnl.add(tfProxyHttpHost = new JTextField(),gc);
     108        pnl.add(tfProxyHttpHost = new JosmTextField(),gc);
    110109
    111110        gc.gridy = 1;
     
    117116        gc.gridx = 1;
    118117        gc.weightx = 1.0;
    119         pnl.add(tfProxyHttpPort = new JTextField(5),gc);
     118        pnl.add(tfProxyHttpPort = new JosmTextField(5),gc);
    120119        tfProxyHttpPort.setMinimumSize(tfProxyHttpPort.getPreferredSize());
    121120
     
    137136        gc.gridx = 1;
    138137        gc.weightx = 1.0;
    139         pnl.add(tfProxyHttpUser = new JTextField(20),gc);
     138        pnl.add(tfProxyHttpUser = new JosmTextField(20),gc);
    140139        tfProxyHttpUser.setMinimumSize(tfProxyHttpUser.getPreferredSize());
    141140
     
    182181        gc.gridx = 1;
    183182        gc.weightx = 1.0;
    184         pnl.add(tfProxySocksHost = new JTextField(20),gc);
     183        pnl.add(tfProxySocksHost = new JosmTextField(20),gc);
    185184
    186185        gc.gridy = 1;
     
    192191        gc.gridx = 1;
    193192        gc.weightx = 1.0;
    194         pnl.add(tfProxySocksPort = new JTextField(5), gc);
     193        pnl.add(tfProxySocksPort = new JosmTextField(5), gc);
    195194        tfProxySocksPort.setMinimumSize(tfProxySocksPort.getPreferredSize());
    196195
  • trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java

    r5429 r5886  
    2929import javax.swing.JScrollPane;
    3030import javax.swing.JTable;
    31 import javax.swing.JTextField;
    3231import javax.swing.KeyStroke;
    3332import javax.swing.ListSelectionModel;
     
    4847import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    4948import org.openstreetmap.josm.tools.Shortcut;
     49import org.openstreetmap.josm.gui.widgets.JosmTextField;
    5050
    5151/**
     
    138138    JTable shortcutTable = new JTable();
    139139
    140     private JTextField filterField = new JTextField();
     140    private JosmTextField filterField = new JosmTextField();
    141141
    142142    /** Creates new form prefJPanel */
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r5874 r5886  
    4646import javax.swing.JPanel;
    4747import javax.swing.JScrollPane;
    48 import javax.swing.JTextField;
    4948import javax.swing.JToggleButton;
    5049import javax.swing.ListCellRenderer;
     
    9291import org.openstreetmap.josm.tools.template_engine.TemplateParser;
    9392import org.xml.sax.SAXException;
     93import org.openstreetmap.josm.gui.widgets.JosmTextField;
     94
    9495
    9596/**
     
    522523            if (comp instanceof JosmComboBox) {
    523524                return ((JosmComboBox) comp).getEditor().getItem().toString();
    524             } else if (comp instanceof JTextField) {
    525                 return ((JTextField) comp).getText();
     525            } else if (comp instanceof JosmTextField) {
     526                return ((JosmTextField) comp).getText();
    526527            } else if (comp instanceof JPanel) {
    527528                return getValue(((JPanel)comp).getComponent(0));
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java

    r5196 r5886  
    3131import javax.swing.JPanel;
    3232import javax.swing.JScrollPane;
    33 import javax.swing.JTextField;
    3433import javax.swing.event.DocumentEvent;
    3534import javax.swing.event.DocumentListener;
     
    5049import org.openstreetmap.josm.gui.tagging.TaggingPreset.Role;
    5150import org.openstreetmap.josm.gui.tagging.TaggingPreset.Roles;
     51import org.openstreetmap.josm.gui.widgets.JosmTextField;
     52
    5253
    5354public class TaggingPresetSearchDialog extends ExtendedDialog implements SelectionChangedListener {
     
    192193    }
    193194
    194     private JTextField edSearchText;
     195    private JosmTextField edSearchText;
    195196    private JList lsResult;
    196197    private JCheckBox ckOnlyApplicable;
     
    239240        content.setLayout(new BorderLayout());
    240241
    241         edSearchText = new JTextField();
     242        edSearchText = new JosmTextField();
    242243        edSearchText.getDocument().addDocumentListener(new DocumentListener() {
    243244
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java

    r5579 r5886  
    1111import javax.swing.ComboBoxEditor;
    1212import javax.swing.JTable;
    13 import javax.swing.JTextField;
    1413import javax.swing.event.CellEditorListener;
    1514import javax.swing.table.TableCellEditor;
     
    2221import org.openstreetmap.josm.Main;
    2322import org.openstreetmap.josm.gui.util.TableCellEditorSupport;
     23import org.openstreetmap.josm.gui.widgets.JosmTextField;
     24
    2425
    2526/**
     
    3233 *
    3334 */
    34 public class AutoCompletingTextField extends JTextField implements ComboBoxEditor, TableCellEditor {
     35public class AutoCompletingTextField extends JosmTextField implements ComboBoxEditor, TableCellEditor {
    3536
    3637    private Integer maxChars;
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java

    r5765 r5886  
    22package org.openstreetmap.josm.gui.widgets;
    33
    4 import javax.swing.JTextField;
    54import javax.swing.text.JTextComponent;
    65
     6import org.openstreetmap.josm.gui.widgets.JosmTextField;
    77import org.openstreetmap.josm.tools.Utils;
    88
     
    1313 * @since 5765
    1414 */
    15 public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JTextField {
     15public abstract class AbstractIdTextField<T extends AbstractTextComponentValidator> extends JosmTextField {
    1616
    1717    protected final T validator;
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java

    r5266 r5886  
    1111
    1212import javax.swing.BorderFactory;
    13 import javax.swing.JTextField;
    1413import javax.swing.UIManager;
    1514import javax.swing.border.Border;
     
    2019import org.openstreetmap.josm.tools.CheckParameterUtil;
    2120import org.openstreetmap.josm.tools.Utils;
     21import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2222
    2323/**
     
    110110        }
    111111        if (addActionListener) {
    112             if (tc instanceof JTextField) {
    113                 JTextField tf = (JTextField)tc;
     112            if (tc instanceof JosmTextField) {
     113                JosmTextField tf = (JosmTextField)tc;
    114114                tf.addActionListener(this);
    115115            }
  • trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java

    r5544 r5886  
    1919import javax.swing.JPanel;
    2020import javax.swing.JPopupMenu;
    21 import javax.swing.JTextField;
    2221import javax.swing.event.DocumentEvent;
    2322import javax.swing.event.DocumentListener;
     
    3231import org.openstreetmap.josm.tools.OsmUrlToBounds;
    3332import org.openstreetmap.josm.tools.Utils;
     33import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3434
    3535/**
     
    3939public class BoundingBoxSelectionPanel extends JPanel {
    4040
    41     private JTextField[] tfLatLon = null;
    42     private final JTextField tfOsmUrl = new JTextField();
     41    private JosmTextField[] tfLatLon = null;
     42    private final JosmTextField tfOsmUrl = new JosmTextField();
    4343
    4444    protected void buildInputFields() {
    45         tfLatLon = new JTextField[4];
     45        tfLatLon = new JosmTextField[4];
    4646        for(int i=0; i< 4; i++) {
    47             tfLatLon[i] = new JTextField(11);
    48             tfLatLon[i].setMinimumSize(new Dimension(100,new JTextField().getMinimumSize().height));
     47            tfLatLon[i] = new JosmTextField(11);
     48            tfLatLon[i].setMinimumSize(new Dimension(100,new JosmTextField().getMinimumSize().height));
    4949            SelectAllOnFocusGainedDecorator.decorate(tfLatLon[i]);
    5050        }
  • trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java

    r5696 r5886  
    1212import javax.swing.JMenu;
    1313import javax.swing.JMenuItem;
    14 import javax.swing.JTextField;
    1514import javax.swing.KeyStroke;
    1615import javax.swing.text.Document;
     
    2019import org.openstreetmap.josm.tools.Pair;
    2120import org.openstreetmap.josm.tools.Shortcut;
     21import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2222
    2323/**
     
    2727 * @since 5696
    2828 */
    29 public class DisableShortcutsOnFocusGainedTextField extends JTextField implements FocusListener {
     29public class DisableShortcutsOnFocusGainedTextField extends JosmTextField implements FocusListener {
    3030
    3131    /**
  • trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java

    r5881 r5886  
    2222 */
    2323public class HtmlPanel extends JPanel {
    24     private JEditorPane jepMessage;
     24    private JosmEditorPane jepMessage;
    2525
    2626    protected void build() {
    2727        setLayout(new BorderLayout());
    28         jepMessage = new JEditorPane("text/html", "");
     28        jepMessage = new JosmEditorPane("text/html", "");
    2929        jepMessage.setOpaque(false);
    3030        jepMessage.setEditable(false);
     
    5757    }
    5858
     59    /**
     60     * Constructs a new {@code HtmlPanel}.
     61     */
    5962    public HtmlPanel() {
    6063        build();
    6164    }
    6265
     66    /**
     67     * Constructs a new {@code HtmlPanel} with the given HTML text.
     68     * @param text the text to display
     69     */
    6370    public HtmlPanel(String text) {
    6471        this();
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java

    r5558 r5886  
    55import java.awt.Dimension;
    66import java.awt.Toolkit;
     7import java.awt.event.MouseAdapter;
     8import java.awt.event.MouseEvent;
     9import java.beans.PropertyChangeEvent;
     10import java.beans.PropertyChangeListener;
    711import java.util.ArrayList;
    812import java.util.Arrays;
     
    1620import javax.swing.JList;
    1721import javax.swing.plaf.basic.ComboPopup;
     22import javax.swing.text.JTextComponent;
    1823
    1924/**
     
    185190            setMaximumRowCount(Math.max(getMaximumRowCount(), maxsize));
    186191        }
     192        // Handle text contextual menus for editable comboboxes
     193        ContextMenuHandler handler = new ContextMenuHandler();
     194        addPropertyChangeListener("editable", handler);
     195        addPropertyChangeListener("editor", handler);
     196    }
     197   
     198    protected class ContextMenuHandler extends MouseAdapter implements PropertyChangeListener {
     199
     200        private JTextComponent component;
     201        private PopupMenuLauncher launcher;
     202       
     203        @Override public void propertyChange(PropertyChangeEvent evt) {
     204            if (evt.getPropertyName().equals("editable")) {
     205                if (evt.getNewValue().equals(true)) {
     206                    enableMenu();
     207                } else {
     208                    disableMenu();
     209                }
     210            } else if (evt.getPropertyName().equals("editor")) {
     211                disableMenu();
     212                if (isEditable()) {
     213                    enableMenu();
     214                }
     215            }
     216        }
     217       
     218        private void enableMenu() {
     219            if (launcher == null) {
     220                Component editorComponent = getEditor().getEditorComponent();
     221                if (editorComponent instanceof JTextComponent) {
     222                    component = (JTextComponent) editorComponent;
     223                    component.addMouseListener(this);
     224                    launcher = TextContextualPopupMenu.enableMenuFor(component);
     225                }
     226            }
     227        }
     228
     229        private void disableMenu() {
     230            if (launcher != null) {
     231                TextContextualPopupMenu.disableMenuFor(component, launcher);
     232                launcher = null;
     233                component.removeMouseListener(this);
     234                component = null;
     235            }
     236        }
     237       
     238        @Override public void mousePressed(MouseEvent e) { processEvent(e); }
     239        @Override public void mouseClicked(MouseEvent e) { processEvent(e); }
     240        @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
     241       
     242        private void processEvent(MouseEvent e) {
     243            if (launcher != null && !e.isPopupTrigger()) {
     244                if (launcher.getMenu().isShowing()) {
     245                    launcher.getMenu().setVisible(false);
     246                }
     247            }
     248        }
    187249    }
    188250   
  • trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java

    r5884 r5886  
    22package org.openstreetmap.josm.gui.widgets;
    33
     4import java.awt.Component;
     5import java.awt.event.FocusEvent;
     6import java.awt.event.FocusListener;
    47import java.awt.event.MouseAdapter;
    58import java.awt.event.MouseEvent;
     
    1316public class PopupMenuLauncher extends MouseAdapter {
    1417    private final JPopupMenu menu;
     18    private final boolean checkEnabled;
    1519
    1620    /**
     
    2832     */
    2933    public PopupMenuLauncher(JPopupMenu menu) {
    30         this.menu = menu;
     34        this(menu, false);
    3135    }
    3236
    33     @Override
    34     public void mousePressed(MouseEvent e) {
    35         if (e.isPopupTrigger()) {
    36             launch(e);
    37         }
     37    /**
     38     * Creates a new {@link PopupMenuLauncher} with the given menu.
     39     * @param menu The popup menu to display
     40     * @param checkEnabled if {@code true}, the popup menu will only be displayed if the component triggering the mouse event is enabled
     41     * @since 5885
     42     */
     43    public PopupMenuLauncher(JPopupMenu menu, boolean checkEnabled) {
     44        this.menu = menu;
     45        this.checkEnabled = checkEnabled;
    3846    }
    3947
    40     @Override
    41     public void mouseClicked(MouseEvent e) {
    42         if (e.isPopupTrigger()) {
    43             launch(e);
    44         }
    45     }
    46 
    47     @Override
    48     public void mouseReleased(MouseEvent e) {
    49         if (e.isPopupTrigger()) {
     48    @Override public void mousePressed(MouseEvent e) { processEvent(e); }
     49    @Override public void mouseClicked(MouseEvent e) { processEvent(e); }
     50    @Override public void mouseReleased(MouseEvent e) { processEvent(e); }
     51   
     52    private void processEvent(MouseEvent e) {
     53        if (e.isPopupTrigger() && (!checkEnabled || e.getComponent().isEnabled())) {
    5054            launch(e);
    5155        }
     
    5761     * @param evt A mouse event
    5862     */
    59     public void launch(MouseEvent evt) {
     63    public void launch(final MouseEvent evt) {
    6064        if (menu != null) {
    61             menu.show(evt.getComponent(), evt.getX(), evt.getY());
     65            final Component component = evt.getComponent();
     66            if (component != null && component.isFocusable() && !component.hasFocus() && component.requestFocusInWindow()) {
     67                component.addFocusListener(new FocusListener() {
     68                    @Override public void focusLost(FocusEvent e) {}
     69                    @Override public void focusGained(FocusEvent e) {
     70                        menu.show(component, evt.getX(), evt.getY());
     71                        component.removeFocusListener(this);
     72                    }
     73                });
     74            } else {
     75                menu.show(component, evt.getX(), evt.getY());
     76            }
    6277        }
    6378    }
    64 
     79   
    6580    /**
    6681     * @return the popup menu if defined, {@code null} otherwise.
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r5874 r5886  
    2222import javax.swing.JPanel;
    2323import javax.swing.JScrollPane;
    24 import javax.swing.JTextArea;
    25 import javax.swing.JTextField;
    2624import javax.swing.ListSelectionModel;
    2725
     
    3432import org.openstreetmap.josm.gui.layer.Layer;
    3533import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     34import org.openstreetmap.josm.gui.widgets.JosmTextArea;
     35import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3636import org.openstreetmap.josm.tools.CheckParameterUtil;
    3737import org.openstreetmap.josm.tools.GBC;
     
    4242        + tr("Note: GPL is not compatible with the OSM license. Do not upload GPL licensed tracks.") + "</html>";
    4343
     44    /**
     45     * Constructs a new {@code GpxExporter}.
     46     */
    4447    public GpxExporter() {
    4548        super(GpxImporter.FILE_FILTER);
     
    8184
    8285        p.add(new JLabel(tr("GPS track description")), GBC.eol());
    83         JTextArea desc = new JTextArea(3, 40);
     86        JosmTextArea desc = new JosmTextArea(3, 40);
    8487        desc.setWrapStyleWord(true);
    8588        desc.setLineWrap(true);
     
    9194        JLabel nameLabel = new JLabel(tr("Real name"));
    9295        p.add(nameLabel, GBC.std().insets(10, 0, 5, 0));
    93         JTextField authorName = new JTextField();
     96        JosmTextField authorName = new JosmTextField();
    9497        p.add(authorName, GBC.eol().fill(GBC.HORIZONTAL));
    9598        JLabel emailLabel = new JLabel(tr("E-Mail"));
    9699        p.add(emailLabel, GBC.std().insets(10, 0, 5, 0));
    97         JTextField email = new JTextField();
     100        JosmTextField email = new JosmTextField();
    98101        p.add(email, GBC.eol().fill(GBC.HORIZONTAL));
    99102        JLabel copyrightLabel = new JLabel(tr("Copyright (URL)"));
    100103        p.add(copyrightLabel, GBC.std().insets(10, 0, 5, 0));
    101         JTextField copyright = new JTextField();
     104        JosmTextField copyright = new JosmTextField();
    102105        p.add(copyright, GBC.std().fill(GBC.HORIZONTAL));
    103106        JButton predefined = new JButton(tr("Predefined"));
     
    105108        JLabel copyrightYearLabel = new JLabel(tr("Copyright year"));
    106109        p.add(copyrightYearLabel, GBC.std().insets(10, 0, 5, 5));
    107         JTextField copyrightYear = new JTextField("");
     110        JosmTextField copyrightYear = new JosmTextField("");
    108111        p.add(copyrightYear, GBC.eol().fill(GBC.HORIZONTAL));
    109112        JLabel warning = new JLabel("<html><font size='-2'>&nbsp;</html");
     
    113116
    114117        p.add(new JLabel(tr("Keywords")), GBC.eol());
    115         JTextField keywords = new JTextField();
     118        JosmTextField keywords = new JosmTextField();
    116119        keywords.setText((String) gpxData.attr.get(META_KEYWORDS));
    117120        p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL));
     
    184187    }
    185188
    186     private static void enableCopyright(final GpxData data, final JTextField copyright, final JButton predefined,
    187             final JTextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel,
     189    private static void enableCopyright(final GpxData data, final JosmTextField copyright, final JButton predefined,
     190            final JosmTextField copyrightYear, final JLabel copyrightLabel, final JLabel copyrightYearLabel,
    188191            final JLabel warning, boolean enable) {
    189192        copyright.setEnabled(enable);
     
    227230            final GpxData data,
    228231            final JCheckBox author,
    229             final JTextField authorName,
    230             final JTextField email,
    231             final JTextField copyright,
     232            final JosmTextField authorName,
     233            final JosmTextField email,
     234            final JosmTextField copyright,
    232235            final JButton predefined,
    233             final JTextField copyrightYear,
     236            final JosmTextField copyrightYear,
    234237            final JLabel nameLabel,
    235238            final JLabel emailLabel,
  • trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java

    r5501 r5886  
    3030import javax.swing.JPanel;
    3131import javax.swing.JRadioButton;
    32 import javax.swing.JTextField;
    3332import javax.swing.SwingConstants;
    3433
     
    3635import org.openstreetmap.josm.gui.layer.Layer;
    3736import org.openstreetmap.josm.gui.util.GuiHelper;
     37import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3838import org.openstreetmap.josm.io.GpxWriter;
    3939import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport;
     
    7979        final File file = layer.getAssociatedFile();
    8080        if (file != null) {
    81             JTextField tf = new JTextField();
     81            JosmTextField tf = new JosmTextField();
    8282            tf.setText(file.getPath());
    8383            tf.setEditable(false);
  • trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    r5684 r5886  
    3232import javax.swing.JPanel;
    3333import javax.swing.JRadioButton;
    34 import javax.swing.JTextField;
    3534import javax.swing.SwingConstants;
    3635
     
    4140import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4241import org.openstreetmap.josm.gui.util.GuiHelper;
     42import org.openstreetmap.josm.gui.widgets.JosmTextField;
    4343import org.openstreetmap.josm.io.OsmWriter;
    4444import org.openstreetmap.josm.io.OsmWriterFactory;
     
    109109        final JButton save = new JButton(saveAction);
    110110        if (file != null) {
    111             JTextField tf = new JTextField();
     111            JosmTextField tf = new JosmTextField();
    112112            tf.setText(file.getPath());
    113113            tf.setEditable(false);
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r5857 r5886  
    4545import javax.swing.JPanel;
    4646import javax.swing.JScrollPane;
    47 import javax.swing.JTextArea;
    4847import javax.swing.UIManager;
    4948
     
    5958import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    6059import org.openstreetmap.josm.gui.progress.ProgressMonitor;
     60import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    6161import org.openstreetmap.josm.tools.CheckParameterUtil;
    6262import org.openstreetmap.josm.tools.GBC;
     
    12001200                        b.append("\n");
    12011201                    }
    1202                     JTextArea a = new JTextArea(10, 40);
     1202                    JosmTextArea a = new JosmTextArea(10, 40);
    12031203                    a.setEditable(false);
    12041204                    a.setText(b.toString());
     
    12091209            }), GBC.eol());
    12101210
    1211             JTextArea description = new JTextArea((info.description == null ? tr("no description available")
     1211            JosmTextArea description = new JosmTextArea((info.description == null ? tr("no description available")
    12121212                    : info.description));
    12131213            description.setEditable(false);
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r5874 r5886  
    1919import javax.swing.JPanel;
    2020import javax.swing.JScrollPane;
    21 import javax.swing.JTextArea;
    2221import javax.swing.SwingUtilities;
    2322
     
    2625import org.openstreetmap.josm.gui.ExtendedDialog;
    2726import org.openstreetmap.josm.gui.JMultilineLabel;
     27import org.openstreetmap.josm.gui.widgets.JosmTextArea;
    2828import org.openstreetmap.josm.plugins.PluginHandler;
    2929
     
    151151                            }
    152152
    153                             JTextArea info = new JTextArea(text, 18, 60);
     153                            JosmTextArea info = new JosmTextArea(text, 18, 60);
    154154                            info.setCaretPosition(0);
    155155                            info.setEditable(false);
Note: See TracChangeset for help on using the changeset viewer.