Index: applications/editors/josm/plugins/turnrestrictions/build.xml
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/build.xml	(revision 33537)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="10580"/>
+    <property name="plugin.main.version" value="12663"/>
 
     <!-- Configure these properties (replace "..." accordingly).
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 33537)
@@ -8,7 +8,7 @@
 import java.util.Collection;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditor;
@@ -51,5 +51,5 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer layer = getLayerManager().getEditLayer();
         if (layer == null) return;
         Collection<Relation> trs = TurnRestrictionSelectionPopupPanel.getTurnRestrictionsParticipatingIn(layer.data.getSelected());
@@ -59,5 +59,5 @@
             //
             Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
-            TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView, layer, tr);
+            TurnRestrictionEditor editor = new TurnRestrictionEditor(MainApplication.getMap().mapView, layer, tr);
             TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
             TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
@@ -66,7 +66,5 @@
             // let the user choose whether he wants to create a new turn restriction or
             // edit one of the turn restrictions participating in the current selection
-            TurnRestrictionSelectionPopupPanel pnl = new TurnRestrictionSelectionPopupPanel(
-                    layer
-            );
+            TurnRestrictionSelectionPopupPanel pnl = new TurnRestrictionSelectionPopupPanel(layer);
             pnl.launch();
         }
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 33537)
@@ -12,5 +12,4 @@
 import javax.swing.ListSelectionModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -25,4 +24,5 @@
 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
@@ -155,5 +155,5 @@
     @Override
     public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-        OsmDataLayer newLayer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer newLayer = MainApplication.getLayerManager().getEditLayer();
         if (newLayer == null) {
             // don't show a JOSM selection if we don't have a data layer
@@ -175,5 +175,5 @@
         // only update the JOSM selection if it is changed in the same data layer
         // this turn restriction editor is working on
-        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
         if (layer == null) return;
         if (layer != this.layer) return;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 33537)
@@ -22,9 +22,9 @@
 import javax.swing.TransferHandler;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -86,5 +86,5 @@
      */
     public void wireListeners() {
-        Main.getLayerManager().addActiveLayerChangeListener(model);
+        MainApplication.getLayerManager().addActiveLayerChangeListener(model);
         DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT);
         SelectionEventManager.getInstance().addSelectionListener(model, FireMode.IN_EDT_CONSOLIDATED);
@@ -95,5 +95,5 @@
      */
     public void unwireListeners() {
-        Main.getLayerManager().removeActiveLayerChangeListener(model);
+        MainApplication.getLayerManager().removeActiveLayerChangeListener(model);
         DatasetEventManager.getInstance().removeDatasetListener(model);
         SelectionEventManager.getInstance().removeSelectionListener(model);
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 33537)
@@ -15,9 +15,9 @@
 import javax.swing.table.AbstractTableModel;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 33537)
@@ -43,9 +43,10 @@
 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
 import org.openstreetmap.josm.data.conflict.Conflict;
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
@@ -545,5 +546,5 @@
             }
 
-            Main.main.undoRedo.add(new AddCommand(getLayer(), newTurnRestriction));
+            MainApplication.undoRedo.add(new AddCommand(getLayer(), newTurnRestriction));
 
             // make sure everybody is notified about the changes
@@ -567,5 +568,5 @@
             editorModel.apply(toUpdate);
             Conflict<Relation> conflict = new Conflict<>(getTurnRestriction(), toUpdate);
-            Main.main.undoRedo.add(new ConflictAddCommand(getLayer(), conflict));
+            MainApplication.undoRedo.add(new ConflictAddCommand(getLayer(), conflict));
         }
 
@@ -577,9 +578,9 @@
             if (getTurnRestriction().getDataSet() == null) {
                 editorModel.apply(getTurnRestriction());
-                Main.main.undoRedo.add(new AddCommand(getTurnRestriction()));
+                MainApplication.undoRedo.add(new AddCommand(getTurnRestriction()));
             } else {
                 Relation toUpdate = new Relation(getTurnRestriction());
                 editorModel.apply(toUpdate);
-                Main.main.undoRedo.add(new ChangeCommand(getTurnRestriction(), toUpdate));
+                MainApplication.undoRedo.add(new ChangeCommand(getTurnRestriction(), toUpdate));
             }
             // this will refresh the snapshot and update the dialog title
@@ -826,6 +827,6 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            if (Main.getLayerManager().getActiveLayer() != getLayer()) {
-                Main.getLayerManager().setActiveLayer(getLayer());
+            if (MainApplication.getLayerManager().getActiveLayer() != getLayer()) {
+                MainApplication.getLayerManager().setActiveLayer(getLayer());
             }
             Relation tr = getTurnRestriction();
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 33537)
@@ -11,7 +11,7 @@
 import java.util.Map.Entry;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
@@ -39,5 +39,5 @@
         if (TurnRestrictionEditorManager.instance == null) {
             TurnRestrictionEditorManager.instance = new TurnRestrictionEditorManager();
-            Main.getLayerManager().addLayerChangeListener(TurnRestrictionEditorManager.instance);
+            MainApplication.getLayerManager().addLayerChangeListener(TurnRestrictionEditorManager.instance);
         }
         return TurnRestrictionEditorManager.instance;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java	(revision 33537)
@@ -43,9 +43,9 @@
 import javax.swing.event.ListSelectionListener;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.PrimitiveId;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.plugins.turnrestrictions.dnd.PrimitiveIdListProvider;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 33537)
@@ -9,5 +9,5 @@
     TO("to");
 
-    private String osmRoleName;
+    private final String osmRoleName;
 
     TurnRestrictionLegRole(String osmRoleName) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 33537)
@@ -34,7 +34,7 @@
 import javax.swing.table.TableColumn;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder;
@@ -197,5 +197,5 @@
         PointerInfo info = MouseInfo.getPointerInfo();
         Point pt = info.getLocation();
-        parentPopup = PopupFactory.getSharedInstance().getPopup(Main.map.mapView, this, pt.x, pt.y);
+        parentPopup = PopupFactory.getSharedInstance().getPopup(MainApplication.getMap().mapView, this, pt.x, pt.y);
         parentPopup.show();
         btnNew.requestFocusInWindow();
@@ -225,5 +225,5 @@
         public void actionPerformed(ActionEvent e) {
             Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
-            TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView, layer, tr);
+            TurnRestrictionEditor editor = new TurnRestrictionEditor(MainApplication.getMap().mapView, layer, tr);
             TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
             TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
@@ -246,5 +246,5 @@
                 editor.toFront();
             } else {
-                editor = new TurnRestrictionEditor(Main.map.mapView, layer, tr);
+                editor = new TurnRestrictionEditor(MainApplication.getMap().mapView, layer, tr);
                 manager.positionOnScreen(editor);
                 manager.register(layer, tr, editor);
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java	(revision 33537)
@@ -18,6 +18,6 @@
     ONLY_STRAIGHT_ON("only_straight_on", tr("Only Straight On"));
 
-    private String tagValue;
-    private String displayName;
+    private final String tagValue;
+    private final String displayName;
 
     TurnRestrictionType(String tagValue, String displayName) {
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 33537)
@@ -24,9 +24,9 @@
 
 import org.openstreetmap.josm.data.Preferences;
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
 import org.openstreetmap.josm.plugins.turnrestrictions.preferences.PreferenceKeys;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 33537)
@@ -8,5 +8,4 @@
 import javax.swing.DefaultListSelectionModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
@@ -20,4 +19,5 @@
 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
@@ -63,5 +63,5 @@
     @Override
     public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-        OsmDataLayer newLayer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer newLayer = MainApplication.getLayerManager().getEditLayer();
         if (newLayer == null) {
             setTurnRestrictions(null);
@@ -82,5 +82,5 @@
     @Override
     public void dataChanged(DataChangedEvent event) {
-        OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
         if (layer == null) {
             setTurnRestrictions(null);
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java	(revision 33537)
@@ -9,8 +9,8 @@
 import javax.swing.ListSelectionModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.event.DataSetListener;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 
@@ -32,13 +32,13 @@
 
     protected void registerAsListener() {
-        Main.getLayerManager().addActiveLayerChangeListener((ActiveLayerChangeListener) model);
+        MainApplication.getLayerManager().addActiveLayerChangeListener((ActiveLayerChangeListener) model);
         DatasetEventManager.getInstance().addDatasetListener((DataSetListener) model, FireMode.IN_EDT);
-        if (Main.getLayerManager().getEditLayer() != null) {
-            model.setTurnRestrictions(Main.getLayerManager().getEditLayer().data.getRelations());
+        if (MainApplication.getLayerManager().getEditLayer() != null) {
+            model.setTurnRestrictions(MainApplication.getLayerManager().getEditLayer().data.getRelations());
         }
     }
 
     protected void unregisterAsListener() {
-        Main.getLayerManager().removeActiveLayerChangeListener((ActiveLayerChangeListener) model);
+        MainApplication.getLayerManager().removeActiveLayerChangeListener((ActiveLayerChangeListener) model);
         DatasetEventManager.getInstance().removeDatasetListener((DataSetListener) model);
     }
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java	(revision 33537)
@@ -8,8 +8,8 @@
 import javax.swing.DefaultListSelectionModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
@@ -51,5 +51,5 @@
     @Override
     public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-        OsmDataLayer newLayer = Main.getLayerManager().getEditLayer();
+        OsmDataLayer newLayer = MainApplication.getLayerManager().getEditLayer();
         if (newLayer == null) {
             setTurnRestrictions(null);
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java	(revision 33537)
@@ -10,9 +10,9 @@
 import javax.swing.ListSelectionModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 
@@ -37,9 +37,9 @@
 
     protected void registerAsListener() {
-        Main.getLayerManager().addActiveLayerChangeListener((ActiveLayerChangeListener) model);
+        MainApplication.getLayerManager().addActiveLayerChangeListener((ActiveLayerChangeListener) model);
         SelectionEventManager.getInstance().addSelectionListener((SelectionChangedListener) model, FireMode.IN_EDT_CONSOLIDATED);
         TurnRestrictionsInSelectionListModel m = (TurnRestrictionsInSelectionListModel) model;
-        if (Main.getLayerManager().getEditLayer() != null) {
-            m.initFromSelection(Main.getLayerManager().getEditLayer().data.getSelected());
+        if (MainApplication.getLayerManager().getEditLayer() != null) {
+            m.initFromSelection(MainApplication.getLayerManager().getEditLayer().data.getSelected());
         } else {
             m.initFromSelection(Collections.<OsmPrimitive>emptyList());
@@ -48,5 +48,5 @@
 
     protected void unregisterAsListener() {
-        Main.getLayerManager().removeActiveLayerChangeListener((ActiveLayerChangeListener) model);
+        MainApplication.getLayerManager().removeActiveLayerChangeListener((ActiveLayerChangeListener) model);
         SelectionEventManager.getInstance().removeSelectionListener((SelectionChangedListener) model);
     }
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 33537)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
@@ -79,5 +80,5 @@
         pnlTurnRestrictionsInDataSet.registerAsListener();
         pnlTurnRestrictionsInSelection.registerAsListener();
-        Main.getLayerManager().addActiveLayerChangeListener(actNew);
+        MainApplication.getLayerManager().addActiveLayerChangeListener(actNew);
         actNew.updateEnabledState();
         Main.pref.addPreferenceChangeListener(preferenceChangeHandler);
@@ -89,5 +90,5 @@
         pnlTurnRestrictionsInDataSet.unregisterAsListener();
         pnlTurnRestrictionsInSelection.unregisterAsListener();
-        Main.getLayerManager().removeActiveLayerChangeListener(actNew);
+        MainApplication.getLayerManager().removeActiveLayerChangeListener(actNew);
         Main.pref.removePreferenceChangeListener(preferenceChangeHandler);
     }
@@ -207,5 +208,5 @@
         protected Collection<RelationMember> getMembersForCurrentSelection(Relation r) {
             Collection<RelationMember> members = new HashSet<>();
-            Collection<OsmPrimitive> selection = Main.getLayerManager().getEditLayer().data.getSelected();
+            Collection<OsmPrimitive> selection = MainApplication.getLayerManager().getEditLayer().data.getSelected();
             for (RelationMember member: r.getMembers()) {
                 if (selection.contains(member.getMember())) {
@@ -219,5 +220,5 @@
             if (toEdit == null)
                 return;
-            OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+            OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
             TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
             TurnRestrictionEditor editor = manager.getEditorForRelation(layer, toEdit);
@@ -271,5 +272,5 @@
                 return;
             org.openstreetmap.josm.actions.mapmode.DeleteAction.deleteRelation(
-                    Main.getLayerManager().getEditLayer(),
+            		MainApplication.getLayerManager().getEditLayer(),
                     toDelete
             );
@@ -308,5 +309,5 @@
 
         public void run() {
-             OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+             OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
              if (layer == null) return;
              Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
@@ -323,5 +324,5 @@
 
         public void updateEnabledState() {
-            setEnabled(Main.getLayerManager().getEditLayer() != null);
+            setEnabled(MainApplication.getLayerManager().getEditLayer() != null);
         }
 
@@ -352,5 +353,5 @@
             List<Relation> toSelect = currentListView.getModel().getSelectedTurnRestrictions();
             if (toSelect.isEmpty()) return;
-            OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+            OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
             if (layer == null) return;
             layer.data.setSelected(toSelect);
@@ -387,5 +388,5 @@
             List<Relation> toSelect = currentListView.getModel().getSelectedTurnRestrictions();
             if (toSelect.isEmpty()) return;
-            OsmDataLayer layer = Main.getLayerManager().getEditLayer();
+            OsmDataLayer layer = MainApplication.getLayerManager().getEditLayer();
             if (layer == null) return;
             layer.data.setSelected(toSelect);
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java	(revision 33537)
@@ -13,8 +13,8 @@
 import javax.swing.DefaultListSelectionModel;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.NameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 
 /**
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 33537)
@@ -8,6 +8,6 @@
 import javax.swing.AbstractAction;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 
 /**
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 33537)
@@ -9,8 +9,8 @@
 import javax.swing.AbstractAction;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler.BasicEditorFokusTargets;
 
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 33537)
@@ -10,11 +10,11 @@
 import javax.swing.AbstractAction;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.SplitWayAction;
 import org.openstreetmap.josm.actions.SplitWayAction.SplitWayResult;
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionBuilder;
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionLegRole;
@@ -140,5 +140,5 @@
                   );
                   if (result != null) {
-                      Main.main.undoRedo.add(result.getCommand());
+                	  MainApplication.undoRedo.add(result.getCommand());
                   }
             }
@@ -152,5 +152,5 @@
                 );
                 if (result != null) {
-                    Main.main.undoRedo.add(result.getCommand());
+                    MainApplication.undoRedo.add(result.getCommand());
                 }
                 if (result == null) return;
Index: applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java
===================================================================
--- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 33267)
+++ applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 33537)
@@ -8,6 +8,6 @@
 import javax.swing.AbstractAction;
 
+import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler;
 import org.openstreetmap.josm.plugins.turnrestrictions.editor.NavigationControler.BasicEditorFokusTargets;
