Index: trunk/src/org/openstreetmap/josm/data/osm/Relation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 7556)
@@ -163,9 +163,11 @@
     }
 
-    @Override public void accept(Visitor visitor) {
+    @Override
+    public void accept(Visitor visitor) {
         visitor.visit(this);
     }
 
-    @Override public void accept(PrimitiveVisitor visitor) {
+    @Override
+    public void accept(PrimitiveVisitor visitor) {
         visitor.visit(this);
     }
@@ -223,5 +225,6 @@
     }
 
-    @Override public void cloneFrom(OsmPrimitive osm) {
+    @Override
+    public void cloneFrom(OsmPrimitive osm) {
         boolean locked = writeLock();
         try {
@@ -234,5 +237,6 @@
     }
 
-    @Override public void load(PrimitiveData data) {
+    @Override
+    public void load(PrimitiveData data) {
         boolean locked = writeLock();
         try {
@@ -548,3 +552,19 @@
         return false;
     }
+
+    /**
+     * Returns the set of roles used in this relation.
+     * @return the set of roles used in this relation. Can be empty but never null
+     * @since 7556
+     */
+    public Set<String> getMemberRoles() {
+        Set<String> result = new HashSet<>();
+        for (RelationMember rm : members) {
+            String role = rm.getRole();
+            if (!role.isEmpty()) {
+                result.add(role);
+            }
+        }
+        return result;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 7556)
@@ -92,5 +92,5 @@
 /**
  * This dialog is for editing relations.
- *
+ * @since 343
  */
 public class GenericRelationEditor extends RelationEditor  {
@@ -172,5 +172,5 @@
         tagEditorPanel.getModel().ensureOneTag();
 
-        JSplitPane pane = buildSplitPane();
+        JSplitPane pane = buildSplitPane(relation);
         pane.setPreferredSize(new Dimension(100, 100));
 
@@ -293,8 +293,7 @@
      */
     protected JPanel buildMemberEditorPanel() {
-        final JPanel pnl = new JPanel();
-        pnl.setLayout(new GridBagLayout());
+        final JPanel pnl = new JPanel(new GridBagLayout());
         // setting up the member table
-        memberTable = new MemberTable(getLayer(),memberTableModel);
+        memberTable = new MemberTable(getLayer(), getRelation(), memberTableModel);
         memberTable.addMouseListener(new MemberTableDblClickAdapter());
         memberTableModel.addMemberModelListener(memberTable);
@@ -350,5 +349,5 @@
                         if (list != null) {
                             list.clear();
-                            getLayer().data.getAutoCompletionManager().populateWithMemberRoles(list);
+                            getLayer().data.getAutoCompletionManager().populateWithMemberRoles(list, getRelation());
                         }
                     }
@@ -454,5 +453,5 @@
      * @return the split panel
      */
-    protected JSplitPane buildSplitPane() {
+    protected JSplitPane buildSplitPane(Relation relation) {
         final JSplitPane pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
         pane.setTopComponent(buildTagEditorPanel());
@@ -1603,6 +1602,5 @@
 
     /**
-     * Creates a new relation with a copy of the current editor state
-     *
+     * Creates a new relation with a copy of the current editor state.
      */
     class DuplicateRelationAction extends AbstractAction {
@@ -1626,7 +1624,5 @@
 
     /**
-     * Action for editing the currently selected relation
-     *
-     *
+     * Action for editing the currently selected relation.
      */
     class EditAction extends AbstractAction implements ListSelectionListener {
@@ -1736,5 +1732,4 @@
             }
         }
-
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberRoleCellEditor.java	(revision 7556)
@@ -10,4 +10,5 @@
 
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
@@ -15,5 +16,6 @@
 public class MemberRoleCellEditor extends AbstractCellEditor implements TableCellEditor {
     private AutoCompletingTextField editor = null;
-    private DataSet ds;
+    private final DataSet ds;
+    private final Relation relation;
 
     /** user input is matched against this list of auto completion items */
@@ -21,8 +23,11 @@
 
     /**
-     * constructor
+     * Constructs a new {@code MemberRoleCellEditor}.
+     * @param ds the data set. Must not be null
+     * @param relation the relation. Can be null
      */
-    public MemberRoleCellEditor(DataSet ds) {
+    public MemberRoleCellEditor(DataSet ds, Relation relation) {
         this.ds = ds;
+        this.relation = relation;
         editor = new AutoCompletingTextField();
         editor.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
@@ -31,7 +36,4 @@
     }
 
-    /**
-     * replies the table cell editor
-     */
     @Override
     public Component getTableCellEditorComponent(JTable table,
@@ -41,5 +43,5 @@
         editor.setText(role);
         autoCompletionList.clear();
-        ds.getAutoCompletionManager().populateWithMemberRoles(autoCompletionList);
+        ds.getAutoCompletionManager().populateWithMemberRoles(autoCompletionList, relation);
         return editor;
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java	(revision 7556)
@@ -29,4 +29,5 @@
 import org.openstreetmap.josm.actions.ZoomToAction;
 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.Way;
@@ -50,9 +51,10 @@
      * constructor for relation member table
      *
-     * @param layer the data layer of the relation
+     * @param layer the data layer of the relation. Must not be null
+     * @param relation the relation. Can be null
      * @param model the table model
      */
-    public MemberTable(OsmDataLayer layer, MemberTableModel model) {
-        super(model, new MemberTableColumnModel(layer.data), model.getSelectionModel());
+    public MemberTable(OsmDataLayer layer, Relation relation, MemberTableModel model) {
+        super(model, new MemberTableColumnModel(layer.data, relation), model.getSelectionModel());
         setLayer(layer);
         model.addMemberModelListener(this);
@@ -157,6 +159,4 @@
      * <li>it jumps over cells in the first column</li> <li>it automatically add a new empty row
      * when the user leaves the last cell in the table</li></ul>
-     *
-     *
      */
     class SelectNextColumnCellAction extends AbstractAction {
@@ -191,5 +191,4 @@
      * Action to be run when the user navigates to the previous cell in the table, for instance by
      * pressing Shift-TAB
-     *
      */
     private class SelectPreviousColumnCellAction extends AbstractAction {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java	(revision 7556)
@@ -8,8 +8,14 @@
 
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.Relation;
 
 public class MemberTableColumnModel extends DefaultTableColumnModel {
 
-    public MemberTableColumnModel(DataSet ds) {
+    /**
+     * Constructs a new {@code MemberTableColumnModel}.
+     * @param ds the data set. Must not be null
+     * @param relation the relation. Can be null
+     */
+    public MemberTableColumnModel(DataSet ds, Relation relation) {
         TableColumn col = null;
 
@@ -20,5 +26,5 @@
         col.setPreferredWidth(100);
         col.setCellRenderer(new MemberTableRoleCellRenderer());
-        col.setCellEditor(new MemberRoleCellEditor(ds));
+        col.setCellEditor(new MemberRoleCellEditor(ds, relation));
         addColumn(col);
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 7556)
@@ -29,5 +29,8 @@
 import org.openstreetmap.josm.gui.tagging.TaggingPresetItem;
 import org.openstreetmap.josm.gui.tagging.TaggingPresetItems;
+import org.openstreetmap.josm.gui.tagging.TaggingPresetItems.Role;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.MultiMap;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -210,5 +213,5 @@
 
     /**
-     * Populates the an {@link AutoCompletionList} with the currently cached
+     * Populates the {@link AutoCompletionList} with the currently cached
      * member roles.
      *
@@ -218,4 +221,33 @@
         list.add(presetRoleCache, AutoCompletionItemPriority.IS_IN_STANDARD);
         list.add(getRoleCache(), AutoCompletionItemPriority.IS_IN_DATASET);
+    }
+
+    /**
+     * Populates the {@link AutoCompletionList} with the roles used in this relation
+     * plus the ones defined in its applicable presets, if any. If the relation type is unknown,
+     * then all the roles known globally will be added, as in {@link #populateWithMemberRoles(AutoCompletionList)}.
+     *
+     * @param list the list to populate
+     * @param r the relation to get roles from
+     * @throws IllegalArgumentException if list is null
+     * @since 7556
+     */
+    public void populateWithMemberRoles(AutoCompletionList list, Relation r) {
+        CheckParameterUtil.ensureParameterNotNull(list, "list");
+        Collection<TaggingPreset> presets = r != null ? TaggingPreset.getMatchingPresets(null, r.getKeys(), false) : null;
+        if (r != null && presets != null && !presets.isEmpty()) {
+            for (TaggingPreset tp : presets) {
+                if (tp.roles != null) {
+                    list.add(Utils.transform(tp.roles.roles, new Utils.Function<Role, String>() {
+                        public String apply(Role x) {
+                            return x.key;
+                        }
+                    }), AutoCompletionItemPriority.IS_IN_STANDARD);
+                }
+            }
+            list.add(r.getMemberRoles(), AutoCompletionItemPriority.IS_IN_DATASET);
+        } else {
+            populateWithMemberRoles(list);
+        }
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7555)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 7556)
@@ -625,5 +625,4 @@
         return new AbstractList<B>() {
 
-
             @Override
             public int size() {
@@ -635,6 +634,4 @@
                 return f.apply(l.get(index));
             }
-
-
         };
     }
