Ignore:
Timestamp:
2013-04-20T02:24:00+02:00 (11 years ago)
Author:
Don-vip
Message:

see #8606 - Fix user-agent used with JEditorPage.setPage() or JEditorPane(URL) + fix version number from previous commit

Location:
trunk/src/org/openstreetmap/josm/gui/widgets
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java

    r5886 r5887  
    33
    44import java.io.IOException;
     5import java.io.InputStream;
    56import java.net.URL;
     7import java.net.URLConnection;
    68
    79import javax.swing.JEditorPane;
    810
     11import org.openstreetmap.josm.tools.Utils;
     12
    913/**
    10  * Subclass of {@link JEditorPane} that adds a "native" context menu (cut/copy/paste/select all).
    11  * @since 5885
     14 * Subclass of {@link JEditorPane} that adds a "native" context menu (cut/copy/paste/select all)
     15 * and effectively uses JOSM user agent when performing HTTP request in {@link #setPage(URL)} method.
     16 * @since 5886
    1217 */
    1318public class JosmEditorPane extends JEditorPane {
     
    5964        setText(text);
    6065    }
     66
     67    @Override
     68    protected InputStream getStream(URL page) throws IOException {
     69        URLConnection conn = Utils.setupURLConnection(page.openConnection());
     70        InputStream result = conn.getInputStream();
     71        String type = conn.getContentType();
     72        if (type != null) {
     73            setContentType(type);
     74        }
     75        return result;
     76    }
    6177}
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java

    r5886 r5887  
    77/**
    88 * Subclass of {@link JTextArea} that adds a "native" context menu (cut/copy/paste/select all).
    9  * @since 5885
     9 * @since 5886
    1010 */
    1111public class JosmTextArea extends JTextArea {
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java

    r5886 r5887  
    77/**
    88 * Subclass of {@link JTextField} that adds a "native" context menu (cut/copy/paste/select all).
    9  * @since 5885
     9 * @since 5886
    1010 */
    1111public class JosmTextField extends JTextField {
  • trunk/src/org/openstreetmap/josm/gui/widgets/PopupMenuLauncher.java

    r5886 r5887  
    3939     * @param menu The popup menu to display
    4040     * @param checkEnabled if {@code true}, the popup menu will only be displayed if the component triggering the mouse event is enabled
    41      * @since 5885
     41     * @since 5886
    4242     */
    4343    public PopupMenuLauncher(JPopupMenu menu, boolean checkEnabled) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java

    r5886 r5887  
    3434 * <li>Select All</li>
    3535 * </ul>
    36  * @since 5885
     36 * @since 5886
    3737 */
    3838public class TextContextualPopupMenu extends JPopupMenu {
Note: See TracChangeset for help on using the changeset viewer.