Index: applications/editors/josm/plugins/usertools/.classpath
===================================================================
--- applications/editors/josm/plugins/usertools/.classpath	(revision 12910)
+++ applications/editors/josm/plugins/usertools/.classpath	(revision 12910)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/josm"/>
+	<classpathentry kind="output" path="build"/>
+</classpath>
Index: applications/editors/josm/plugins/usertools/.project
===================================================================
--- applications/editors/josm/plugins/usertools/.project	(revision 12910)
+++ applications/editors/josm/plugins/usertools/.project	(revision 12910)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>usertools</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.core.prefs	(revision 12910)
+++ applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.core.prefs	(revision 12910)
@@ -0,0 +1,12 @@
+#Mon Dec 31 17:33:41 GMT 2007
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.source=1.5
+eclipse.preferences.version=1
Index: applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.ui.prefs	(revision 12910)
+++ applications/editors/josm/plugins/usertools/.settings/org.eclipse.jdt.ui.prefs	(revision 12910)
@@ -0,0 +1,3 @@
+#Mon Dec 31 17:33:41 GMT 2007
+eclipse.preferences.version=1
+internal.default.compliance=default
Index: applications/editors/josm/plugins/usertools/build.xml
===================================================================
--- applications/editors/josm/plugins/usertools/build.xml	(revision 12910)
+++ applications/editors/josm/plugins/usertools/build.xml	(revision 12910)
@@ -0,0 +1,41 @@
+<project name="usertools" default="dist" basedir=".">
+    <property name="josm"                   location="../../core/dist/josm-custom.jar" />
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
+    <property name="ant.build.javac.target" value="1.5"/>
+    <target name="init">
+        <mkdir dir="${plugin.build.dir}"/>
+    </target>
+    <target name="compile" depends="init">
+        <echo message="creating ${plugin.jar}"/>
+        <javac srcdir="src" classpath="${josm}" debug="true" destdir="build">
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:unchecked"/>
+            <include name="**/*.java" />
+        </javac>
+    </target>
+    <target name="dist" depends="compile">
+        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="."/>
+        </exec>
+        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
+        <delete file="REVISION"/>
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
+            <manifest>
+                <attribute name="Plugin-Class" value="usertools.UserToolsPlugin" />
+                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
+                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
+                <attribute name="Plugin-Description" value="Tools to help work with authors/users.&lt;br&gt; Used with the author panel alt-a).&lt;br&gt; Opens up user profile and selects user's stuff on the map" />
+                <attribute name="Plugin-Mainversion" value="1180" />
+            </manifest>
+        </jar>
+    </target>
+    <target name="clean">
+        <delete dir="${plugin.build.dir}" />
+        <delete file="${plugin.jar}" />
+    </target>
+</project>
Index: applications/editors/josm/plugins/usertools/src/usertools/UserToolsPlugin.java
===================================================================
--- applications/editors/josm/plugins/usertools/src/usertools/UserToolsPlugin.java	(revision 12910)
+++ applications/editors/josm/plugins/usertools/src/usertools/UserToolsPlugin.java	(revision 12910)
@@ -0,0 +1,181 @@
+package usertools;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.io.UnsupportedEncodingException;
+
+import javax.swing.*;
+
+import org.openstreetmap.josm.actions.JosmAction;
+//import org.openstreetmap.josm.actions.search.*;
+import org.openstreetmap.josm.actions.search.SearchAction;
+import org.openstreetmap.josm.gui.dialogs.UserListDialog;
+import org.openstreetmap.josm.gui.MainMenu;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.tools.OpenBrowser;
+
+/**
+ * plugin for JOSM Java OpenStreetMap Editor 
+ * for use with authors and users
+ * has basic functionality at the moment, and messy code!
+ * opens browser for selected user page
+ * Selects data based on user on map
+ *
+ * @author Tim Waters (chippy)
+ */
+
+
+
+public class UserToolsPlugin extends Plugin {
+    static JMenu userJMenu;
+
+    //private static User anonymousUser = User.get("(anonymous users)");
+
+    public UserToolsPlugin() {
+        refreshMenu();
+    }
+    public static enum SearchMode {replace, add, remove}
+
+    private static String urlEncodeWithNoPluses(String input){
+        if(input==null)
+            return null;
+        String inputEnc = "";
+        try {
+            inputEnc = java.net.URLEncoder.encode(input, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        StringBuffer retu = new StringBuffer();
+        for(int i=0;i<inputEnc.length();i++){
+            if(inputEnc.charAt(i)=='+')
+                retu.append("%20");
+            else
+                retu.append(inputEnc.charAt(i));
+        }
+        return retu.toString();
+    }
+
+//   TODO refactor these actions
+    public static void refreshMenu() {
+        MainMenu menu = Main.main.menu;
+
+        if (userJMenu == null) {
+            userJMenu = new JMenu(tr("User"));
+            menu.add(userJMenu, KeyEvent.VK_U, "user");
+            menu.add(userJMenu, 5);
+        } else {
+            userJMenu.removeAll();
+        }
+
+        userJMenu.add(new JMenuItem(new JosmAction(tr("Show Author Panel"),
+        "dialogs/userlist", tr("Show Author Panel"), null, false) {
+            public void actionPerformed(ActionEvent ev) {
+                int dialogIndex = 100;
+                for (int i = 0; i < Main.map.toggleDialogs.getComponentCount(); i++) {
+
+                    if (Main.map.toggleDialogs.getComponent(i).getClass()
+                            .getSimpleName().equals("UserListDialog")) {
+
+                        dialogIndex = i;
+                    }
+                }
+                UserListDialog uld = (UserListDialog) Main.map.toggleDialogs.getComponent(dialogIndex);
+
+                uld.setVisible(true);
+            }
+        }));
+
+        userJMenu.addSeparator();
+        // userJMenu.addSeparator();
+        userJMenu.add(new JMenuItem(new JosmAction(tr("Open User Page"),
+                "presets/letter", tr("Open User Page in browser"), null, false) {
+            public void actionPerformed(ActionEvent ev) {
+                String name =  getSelectedUser();
+                if (!name.equals("0")){
+                String userUrl = "http://www.openstreetmap.org/user/" + name;
+                //System.out.println("User Tools plugin: Opening browser "+userUrl);
+                OpenBrowser.displayUrl(userUrl);
+                }
+            }
+        }));
+
+        userJMenu.add(new JMenuItem(new JosmAction(tr("Select User's Data"),
+        "dialogs/search", tr("Replaces Selection with Users data"), null, false) {
+            public void actionPerformed(ActionEvent ev) {
+                String name =  getSelectedUser();
+                if (!name.equals("0")){
+                    SearchAction.SearchMode mode = SearchAction.SearchMode.replace;
+                    SearchAction.search(name, mode, false);
+                }
+            }
+        }));
+
+        setEnabledAll(false);
+    }
+
+    public static String getSelectedUser(){
+        int dialogIndex = 100;
+        for (int i = 0; i < Main.map.toggleDialogs.getComponentCount(); i++) {
+
+            //  System.out.println(Main.map.toggleDialogs.getComponent(i)
+            //      .getClass().getSimpleName());
+
+            if (Main.map.toggleDialogs.getComponent(i).getClass()
+                    .getSimpleName().equals("UserListDialog")) {
+                dialogIndex = i;
+            }
+        }
+        UserListDialog uld = (UserListDialog) Main.map.toggleDialogs.getComponent(dialogIndex);
+
+        //these are hard coded, probably better to search, like above
+        JScrollPane jsp = (JScrollPane) uld.getComponent(1);
+        JViewport view = (JViewport)jsp.getComponent(0);
+        JTable tab = (JTable)view.getComponent(0);
+
+        if (tab.getRowCount() == 0) {
+            JOptionPane.showMessageDialog(Main.parent, tr("Please select some data"));
+            return "0";
+        }
+        if (tab.getSelectedRow() == -1 && tab.getRowCount() > 0){
+            JOptionPane.showMessageDialog(Main.parent, tr("Please choose a user using the author panel"));
+            return "0";
+        }
+
+        String name = "(anonymous users)";
+        //(anonymous users)
+        if (tab.getSelectedRow() > -1){
+        //  System.out.println(tab.getValueAt(tab.getSelectedRow(), tab.getSelectedColumn()));
+            name = (String)tab.getValueAt(tab.getSelectedRow(), 0);
+        }
+
+        if (name.equals("(anonymous users)") ) {
+            JOptionPane.showMessageDialog(Main.parent,
+            tr("Sorry, doesn't work with anonymous users"));
+            return "0";
+        }
+        name = urlEncodeWithNoPluses(name);
+
+        return name;
+    }
+
+    private static void setEnabledAll(boolean isEnabled) {
+        for(int i=0; i < userJMenu.getItemCount(); i++) {
+            JMenuItem item = userJMenu.getItem(i);
+
+            if(item != null) item.setEnabled(isEnabled);
+        }
+    }
+
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame==null && newFrame!=null) { 
+            setEnabledAll(true);
+        } else if (oldFrame!=null && newFrame==null ) {
+            setEnabledAll(false);
+        }
+    }
+}
Index: applications/editors/josm/plugins/wmsplugin/build.xml
===================================================================
--- applications/editors/josm/plugins/wmsplugin/build.xml	(revision 12908)
+++ applications/editors/josm/plugins/wmsplugin/build.xml	(revision 12910)
@@ -1,21 +1,10 @@
 <project name="wmsplugin" default="dist" basedir=".">
-<!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
-    <property environment="env"/>
-    <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
-        <and>
-            <os family="windows"/>
-        </and>
-    </condition>
-<!-- compilation properties -->
-    <property name="josm.build.dir"   value="../../core"/>
-    <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
-    <property name="josm"         location="../../core/dist/josm-custom.jar" />
-    <property name="plugin.build.dir" value="build"/>
-    <property name="plugin.dist.dir"  value="../../dist"/>
-    <property name="plugin.name"      value="${ant.project.name}"/>
-    <property name="plugin.jar"       value="../../dist/${plugin.name}.jar"/>
+    <property name="josm"                   location="../../core/dist/josm-custom.jar" />
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     <property name="ant.build.javac.target" value="1.5"/>
     <target name="init">
-        <mkdir dir="build"></mkdir>
+        <mkdir dir="${plugin.build.dir}"/>
     </target>
     <target name="compile" depends="init">
@@ -31,5 +20,5 @@
             <fileset dir="resources"/>
         </copy>
-        <copy todir="build/images" >
+        <copy todir="${plugin.build.dir}/images" >
             <fileset dir="images" />
         </copy>
@@ -42,5 +31,5 @@
         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
         <delete file="REVISION"/>
-        <jar destfile="${plugin.jar}" basedir="build">
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
             <manifest>
                 <attribute name="Plugin-Class" value="wmsplugin.WMSPlugin" />
@@ -56,6 +45,3 @@
         <delete file="${plugin.jar}" />
     </target>
-    <target name="install" depends="dist">
-        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
-    </target>
 </project>
