Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java	(revision 652)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java	(revision 653)
@@ -13,8 +13,10 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Map.Entry;
 
 import javax.swing.JButton;
+import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
@@ -32,10 +34,15 @@
 import org.openstreetmap.josm.command.AddCommand;
 import org.openstreetmap.josm.command.ChangeCommand;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.DataSource;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
+import org.openstreetmap.josm.io.OsmServerObjectReader;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.xml.sax.SAXException;
 
 /**
@@ -238,4 +245,12 @@
 			}
 		}));
+        buttonPanel.add(createButton(marktr("Download Members"),"down", tr("Download all incomplete ways and nodes in relation"), KeyEvent.VK_L, new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                downloadRelationMembers();                
+                refreshTables();
+            }            
+        }));
+        
+        
 		bothTables.add(buttonPanel, GBC.eop().fill(GBC.HORIZONTAL));
 
@@ -285,3 +300,50 @@
 		refreshTables();
 	}
+    private void downloadRelationMembers()  {
+
+        boolean download = false;
+        for (RelationMember member : clone.members) {
+            if (member.member.incomplete) {
+                download = true;
+                break;
+            }
+        }
+        if (download) {
+            OsmServerObjectReader reader = new OsmServerObjectReader();
+            try {
+                DataSet dataSet = reader.parseOsm(clone.id,
+                        OsmServerObjectReader.TYPE_REL, true);
+                if (dataSet != null) {
+                    final MergeVisitor visitor = new MergeVisitor(Main.main
+                            .editLayer().data, dataSet);
+                    for (final OsmPrimitive osm : dataSet.allPrimitives())
+                        osm.visit(visitor);
+                    visitor.fixReferences();
+
+                    // copy the merged layer's data source info
+                    for (DataSource src : dataSet.dataSources)
+                        Main.main.editLayer().data.dataSources.add(src);
+                    Main.main.editLayer().fireDataChange();
+
+                    if (visitor.conflicts.isEmpty())
+                        return;
+                    final ConflictDialog dlg = Main.map.conflictDialog;
+                    dlg.add(visitor.conflicts);
+                    JOptionPane.showMessageDialog(Main.parent,
+                            tr("There were conflicts during import."));
+                    if (!dlg.isVisible())
+                        dlg.action
+                                .actionPerformed(new ActionEvent(this, 0, ""));
+                }
+
+            } catch (SAXException e) {
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(this,tr("Error parsing server response.")+": "+e.getMessage(), tr("Error"), JOptionPane.ERROR_MESSAGE);        
+            } catch (IOException e) {
+                e.printStackTrace();                
+                JOptionPane.showMessageDialog(this,tr("Cannot connect to server.")+": "+e.getMessage(), tr("Error"), JOptionPane.ERROR_MESSAGE);
+            }
+        }
+
+    }
 }
Index: trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 653)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java	(revision 653)
@@ -0,0 +1,69 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.xml.sax.SAXException;
+
+public class OsmServerObjectReader extends OsmServerReader {
+    
+     public final static  String TYPE_WAY = "way";
+     public final static  String TYPE_REL = "relation";
+     public final static  String TYPE_NODE = "node";
+     
+     /**
+      * Method to download single Objects from OSM server. ways, relations, nodes
+      * @param id  Object ID
+      * @param type  way node relation
+      * @param full download with or without child objects
+      * @return
+      * @throws SAXException
+      * @throws IOException
+      */
+     public DataSet parseOsm(long id,String type, boolean full ) throws SAXException, IOException {
+            try {
+                
+                Main.pleaseWaitDlg.progress.setValue(0);
+                Main.pleaseWaitDlg.currentAction.setText(tr("Contacting OSM Server..."));
+                StringBuffer sb = new StringBuffer();
+                sb.append(type);
+                sb.append("/");
+                sb.append(id);
+                if (full)
+                {
+                    sb.append("/full");
+                }
+                
+                final InputStream in = getInputStream(sb.toString(), Main.pleaseWaitDlg);
+                if (in == null)
+                    return null;
+                Main.pleaseWaitDlg.currentAction.setText(tr("Downloading OSM data..."));
+                final DataSet data = OsmReader.parseDataSet(in, null, Main.pleaseWaitDlg);
+//                String origin = Main.pref.get("osm-server.url")+"/"+Main.pref.get("osm-server.version", "0.5");
+//                Bounds bounds = new Bounds(new LatLon(lat1, lon1), new LatLon(lat2, lon2));
+//                DataSource src = new DataSource(bounds, origin);
+//                data.dataSources.add(src);
+                in.close();
+                activeConnection = null;
+                return data;
+            } catch (IOException e) {
+                if (cancel)
+                    return null;
+                throw e;
+            } catch (SAXException e) {
+                throw e;
+            } catch (Exception e) {
+                if (cancel)
+                    return null;
+                if (e instanceof RuntimeException)
+                    throw (RuntimeException)e;
+                throw new RuntimeException(e);
+            }
+        }
+
+}
