Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 13130)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 13434)
@@ -64,4 +64,5 @@
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.SelectionChangedListener;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.IRelation;
@@ -91,4 +92,5 @@
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler;
@@ -231,5 +233,5 @@
 
     private final PreferenceChangedListener preferenceListener = e -> {
-                if (MainApplication.getLayerManager().getEditDataSet() != null) {
+                if (MainApplication.getLayerManager().getActiveDataSet() != null) {
                     // Re-load data when display preference change
                     updateSelection();
@@ -487,9 +489,9 @@
         Relation relation = (Relation) membershipData.getValueAt(row, 0);
         MainApplication.getMap().relationListDialog.selectRelation(relation);
-        RelationEditor.getEditor(
-                MainApplication.getLayerManager().getEditLayer(),
-                relation,
-                ((MemberInfo) membershipData.getValueAt(row, 1)).role
-        ).setVisible(true);
+        OsmDataLayer layer = MainApplication.getLayerManager().getActiveDataLayer();
+        if (!layer.isReadOnly()) {
+            RelationEditor.getEditor(
+                    layer, relation, ((MemberInfo) membershipData.getValueAt(row, 1)).role).setVisible(true);
+        }
     }
 
@@ -534,5 +536,5 @@
     public void setVisible(boolean b) {
         super.setVisible(b);
-        if (b && MainApplication.getLayerManager().getEditDataSet() != null) {
+        if (b && MainApplication.getLayerManager().getActiveDataSet() != null) {
             updateSelection();
         }
@@ -644,10 +646,12 @@
         membershipTable.setVisible(membershipData.getRowCount() > 0);
 
+        DataSet ds = Main.main.getActiveDataSet();
+        boolean isReadOnly = ds != null && ds.isReadOnly();
         boolean hasSelection = !newSel.isEmpty();
         boolean hasTags = hasSelection && tagData.getRowCount() > 0;
         boolean hasMemberships = hasSelection && membershipData.getRowCount() > 0;
-        addAction.setEnabled(hasSelection);
-        editAction.setEnabled(hasTags || hasMemberships);
-        deleteAction.setEnabled(hasTags || hasMemberships);
+        addAction.setEnabled(!isReadOnly && hasSelection);
+        editAction.setEnabled(!isReadOnly && (hasTags || hasMemberships));
+        deleteAction.setEnabled(!isReadOnly && (hasTags || hasMemberships));
         tagTable.setVisible(hasTags);
         tagTable.getTableHeader().setVisible(hasTags);
@@ -1055,8 +1059,9 @@
         @Override
         protected final void updateEnabledState() {
-            setEnabled(
-                    (tagTable != null && tagTable.getSelectedRowCount() >= 1)
+            DataSet ds = Main.main.getActiveDataSet();
+            setEnabled(ds != null && !ds.isReadOnly() &&
+                    ((tagTable != null && tagTable.getSelectedRowCount() >= 1)
                     || (membershipTable != null && membershipTable.getSelectedRowCount() > 0)
-                    );
+                    ));
         }
 
@@ -1110,8 +1115,9 @@
         @Override
         protected void updateEnabledState() {
-            setEnabled(
-                    (tagTable != null && tagTable.getSelectedRowCount() == 1)
+            DataSet ds = Main.main.getActiveDataSet();
+            setEnabled(ds != null && !ds.isReadOnly() &&
+                    ((tagTable != null && tagTable.getSelectedRowCount() == 1)
                     ^ (membershipTable != null && membershipTable.getSelectedRowCount() == 1)
-                    );
+                    ));
         }
 
