Changeset 29329 in osm for applications
- Timestamp:
- 2013-03-03T14:11:53+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia/src/org/wikipedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r29323 r29329 10 10 import java.net.URLEncoder; 11 11 import java.util.ArrayList; 12 import java.util.Arrays; 12 13 import java.util.Collection; 13 14 import java.util.HashMap; … … 25 26 import org.openstreetmap.josm.data.osm.Tag; 26 27 import org.openstreetmap.josm.tools.Utils; 28 import org.openstreetmap.josm.tools.Utils.Function; 27 29 import org.w3c.dom.Document; 28 30 import org.w3c.dom.NodeList; … … 84 86 } 85 87 88 static List<WikipediaEntry> getEntriesFromClipboard(final String wikipediaLang) { 89 final List<String> clipboardLines = Arrays.asList(Utils.getClipboardContent().split("[\\n\\r]+")); 90 return new ArrayList<WikipediaEntry>(Utils.transform(clipboardLines, new Function<String, WikipediaEntry>() { 91 92 @Override 93 public WikipediaEntry apply(String x) { 94 return new WikipediaEntry(x, wikipediaLang, x); 95 } 96 })); 97 } 98 86 99 static void updateWIWOSMStatus(String wikipediaLang, Collection<WikipediaEntry> entries) { 87 100 Collection<String> articleNames = new ArrayList<String>(); -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
r29328 r29329 47 47 new SideButton(new WikipediaLoadCoordinatesAction()), 48 48 new SideButton(new WikipediaLoadCategoryAction()), 49 new SideButton(new PasteWikipediaArticlesAction()), 49 50 new SideButton(new AddWikipediaTagAction()), 50 51 new SideButton(new OpenWikipediaArticleAction()), … … 165 166 } 166 167 168 class PasteWikipediaArticlesAction extends AbstractAction { 169 170 public PasteWikipediaArticlesAction() { 171 super(tr("Clipboard"), ImageProvider.get("paste")); 172 putValue(SHORT_DESCRIPTION, tr("Pastes Wikipedia articles from the system clipboard")); 173 } 174 175 @Override 176 public void actionPerformed(ActionEvent e) { 177 setWikipediaEntries(WikipediaApp.getEntriesFromClipboard(wikipediaLang.get())); 178 titleContext = tr("clipboard"); 179 updateTitle(); 180 } 181 } 182 167 183 class OpenWikipediaArticleAction extends AbstractAction { 168 184
Note:
See TracChangeset
for help on using the changeset viewer.