Changeset 5887 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
- Timestamp:
- 2013-04-20T02:24:00+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
r5886 r5887 3 3 4 4 import java.io.IOException; 5 import java.io.InputStream; 5 6 import java.net.URL; 7 import java.net.URLConnection; 6 8 7 9 import javax.swing.JEditorPane; 8 10 11 import org.openstreetmap.josm.tools.Utils; 12 9 13 /** 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 12 17 */ 13 18 public class JosmEditorPane extends JEditorPane { … … 59 64 setText(text); 60 65 } 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 } 61 77 }
Note:
See TracChangeset
for help on using the changeset viewer.