Commit e472c41d authored by Simon Legner's avatar Simon Legner

JOSM/wikipedia: reuse UserQueryList (drops massive code duplication) - see #josm15264

git-svn-id: https://svn.openstreetmap.org/applications/editors/josm/plugins/wikipedia@33641 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
parent 80e15c8f
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- enter the SVN commit message --> <!-- enter the SVN commit message -->
<property name="commit.message" value="Commit message"/> <property name="commit.message" value="Commit message"/>
<!-- enter the *lowest* JOSM version this plugin is currently compatible with --> <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
<property name="plugin.main.version" value="12878"/> <property name="plugin.main.version" value="12880"/>
<property name="plugin.canloadatruntime" value="true"/> <property name="plugin.canloadatruntime" value="true"/>
<property name="plugin.author" value="simon04"/> <property name="plugin.author" value="simon04"/>
......
...@@ -29,6 +29,7 @@ import org.openstreetmap.josm.gui.download.DownloadSettings; ...@@ -29,6 +29,7 @@ import org.openstreetmap.josm.gui.download.DownloadSettings;
import org.openstreetmap.josm.gui.download.DownloadSource; import org.openstreetmap.josm.gui.download.DownloadSource;
import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy; import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy;
import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy; import org.openstreetmap.josm.gui.download.DownloadSourceSizingPolicy.AdjustableDownloadSizePolicy;
import org.openstreetmap.josm.gui.download.UserQueryList;
import org.openstreetmap.josm.gui.util.GuiHelper; import org.openstreetmap.josm.gui.util.GuiHelper;
import org.openstreetmap.josm.gui.widgets.JosmTextArea; import org.openstreetmap.josm.gui.widgets.JosmTextArea;
import org.openstreetmap.josm.tools.GBC; import org.openstreetmap.josm.tools.GBC;
...@@ -83,12 +84,12 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource ...@@ -83,12 +84,12 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource
private static final String ACTION_IMG_SUBDIR = "dialogs"; private static final String ACTION_IMG_SUBDIR = "dialogs";
private final JosmTextArea wikosmQuery; private final JosmTextArea wikosmQuery;
private final WikosmQueryList wikosmQueryList; private final UserQueryList wikosmQueryList;
private final JCheckBox referrers; private final JCheckBox referrers;
private final JCheckBox fullRel; private final JCheckBox fullRel;
/** /**
* Create a new {@link WikosmDownloadSourcePanel} * Create a new {@code WikosmDownloadSourcePanel}
* @param ds The download source to create the panel for * @param ds The download source to create the panel for
*/ */
public WikosmDownloadSourcePanel(WikosmDownloadSource ds) { public WikosmDownloadSourcePanel(WikosmDownloadSource ds) {
...@@ -122,7 +123,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource ...@@ -122,7 +123,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource
}); });
this.wikosmQueryList = new WikosmQueryList(this, this.wikosmQuery); this.wikosmQueryList = new UserQueryList(this, this.wikosmQuery, "download.wikosm.query");
this.wikosmQueryList.setPreferredSize(new Dimension(350, 300)); this.wikosmQueryList.setPreferredSize(new Dimension(350, 300));
EditSnippetAction edit = new EditSnippetAction(); EditSnippetAction edit = new EditSnippetAction();
...@@ -268,7 +269,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource ...@@ -268,7 +269,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource
} }
/** /**
* Action that delegates snippet creation to {@link WikosmQueryList#createNewItem()}. * Action that delegates snippet creation to {@link UserQueryList#createNewItem()}.
*/ */
private class AddSnippetAction extends AbstractAction { private class AddSnippetAction extends AbstractAction {
...@@ -288,7 +289,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource ...@@ -288,7 +289,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource
} }
/** /**
* Action that delegates snippet removal to {@link WikosmQueryList#removeSelectedItem()}. * Action that delegates snippet removal to {@link UserQueryList#removeSelectedItem()}.
*/ */
private class RemoveSnippetAction extends AbstractAction implements ListSelectionListener { private class RemoveSnippetAction extends AbstractAction implements ListSelectionListener {
...@@ -321,7 +322,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource ...@@ -321,7 +322,7 @@ public class WikosmDownloadSource implements DownloadSource<WikosmDownloadSource
} }
/** /**
* Action that delegates snippet edit to {@link WikosmQueryList#editSelectedItem()}. * Action that delegates snippet edit to {@link UserQueryList#editSelectedItem()}.
*/ */
private class EditSnippetAction extends AbstractAction implements ListSelectionListener { private class EditSnippetAction extends AbstractAction implements ListSelectionListener {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment