Index: /trunk/resources/images/cut.svg
===================================================================
--- /trunk/resources/images/cut.svg	(revision 16409)
+++ /trunk/resources/images/cut.svg	(revision 16409)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48px" height="48px" id="svg4289" >
+  <defs id="defs4291">
+    <linearGradient id="linearGradient3125">
+      <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3127"/>
+      <stop style="stop-color:black;stop-opacity:0;" offset="1" id="stop3129"/>
+    </linearGradient>
+    <linearGradient id="linearGradient3109">
+      <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3111"/>
+      <stop style="stop-color:black;stop-opacity:0;" offset="1" id="stop3113"/>
+    </linearGradient>
+    <radialGradient xlink:href="#linearGradient3109" id="radialGradient3115" cx="16.6875" cy="42.0625" fx="16.6875" fy="42.0625" r="7.0625" gradientTransform="matrix(1,0,0,0.39823,0,25.31195)" gradientUnits="userSpaceOnUse"/>
+    <radialGradient xlink:href="#linearGradient3109" id="radialGradient3117" cx="16.6875" cy="42.0625" fx="16.6875" fy="42.0625" r="7.0625" gradientTransform="matrix(1,0,0,0.39823,0,25.31195)" gradientUnits="userSpaceOnUse"/>
+    <radialGradient xlink:href="#linearGradient3125" id="radialGradient3131" cx="25.015625" cy="37.8125" fx="25.015625" fy="37.8125" r="7.953125" gradientTransform="matrix(1,0,0,0.444008,0,21.02345)" gradientUnits="userSpaceOnUse"/>
+  </defs>
+  <g id="layer1">
+    <path style="opacity:0.11000001;color:black;fill:url(#radialGradient3131);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.4;stroke-opacity:0.47058824;visibility:visible;display:inline;overflow:visible" id="path3123" d="M 32.96875 37.8125 A 7.953125 3.53125 0 1 1  17.0625,37.8125 A 7.953125 3.53125 0 1 1  32.96875 37.8125 z" transform="matrix(1.005894,0,0,0.991151,0.836926,1.022119)"/>
+    <g id="g3119" style="opacity:0.3" transform="translate(0,0.59375)">
+      <path transform="matrix(0.99115,0,0,1.066667,0.460177,-4.866667)" d="M 23.75 42.0625 A 7.0625 2.8125 0 1 1  9.625,42.0625 A 7.0625 2.8125 0 1 1  23.75 42.0625 z" id="path2218" style="opacity:1;color:black;fill:url(#radialGradient3115);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.4;stroke-opacity:0.47058824;visibility:visible;display:inline;overflow:visible"/>
+      <path transform="matrix(0.99115,0,0,1.066667,16.46018,-4.866667)" d="M 23.75 42.0625 A 7.0625 2.8125 0 1 1  9.625,42.0625 A 7.0625 2.8125 0 1 1  23.75 42.0625 z" id="path3107" style="opacity:1;color:black;fill:url(#radialGradient3117);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.4;stroke-opacity:0.47058824;visibility:visible;display:inline;overflow:visible"/>
+    </g>
+    <g id="g2200" transform="matrix(1,0,0,-1,-7,50.98481)">
+      <path style="opacity:0.6;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 23.555074,40.141369 L 35.161165,20.64645 L 24.411662,42 L 23.555074,40.141369 z " id="path10844"/>
+      <path id="path10784" d="M 23.5,42.920786 C 23.5,42.920786 21.538778,40.657664 21.5,34.918534 C 21.461222,29.128896 33.545431,17.539902 33.545431,17.539902 L 35.428571,19.156518 L 23.5,42.920786 z " style="fill:#d9d6d0;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
+      <path id="path10848" d="M 23.502378,40.5 C 23.502378,40.5 22.633959,38.835453 22.501208,34.816554 C 22.368457,30.761939 33.223776,18.734624 33.223776,18.734624 L 34.198114,19.264746 L 23.502378,40.5 z " style="opacity:0.4;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:white;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
+      <path style="opacity:0.6;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 22.238158,38.40995 L 33.543378,19.801557 L 34.241997,20.373435 L 23.492494,41.726988 L 22.238158,38.40995 z " id="path12233"/>
+      <path id="path10822" d="M 39.466015,9.5345307 C 43.029605,9.5871898 44.466015,12.207182 44.466015,15.500271 C 44.466015,18.587542 42.486282,21.129254 39.966015,21.434941 L 35.278515,21.466011 L 32.466015,18.762785 C 33.141566,17.460107 34.380092,16.346765 34.403515,15.344913 C 34.451281,13.251654 35.903534,9.4818885 39.466015,9.5345307 z M 39.497265,12.610016 C 37.43933,12.57492 36.388379,13.918237 36.412444,15.313842 L 36.483872,19.456292 L 39.809765,19.425221 C 41.265645,19.221426 42.403516,17.496356 42.403515,15.438128 C 42.403515,13.242685 41.55584,12.645123 39.497265,12.610016 z " style="fill:#ef2929;fill-opacity:1;stroke:#a40000;stroke-width:1.06796968;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
+      <path id="path10786" d="M 39.493806,43.484807 C 39.493806,43.484807 41.505536,40.924025 41.493806,35.50796 C 41.482077,30.092022 29.75142,17.931965 29.75142,17.931965 L 27.565235,19.795988 L 39.493806,43.484807 z " style="fill:#d9d6d0;fill-opacity:1;fill-rule:evenodd;stroke:#888a85;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
+      <path id="path10846" d="M 39.549281,41.230586 C 39.549281,41.230586 40.4177,39.566039 40.550451,35.547139 C 40.683202,31.492525 29.827883,19.46521 29.827883,19.46521 L 28.853545,19.995332 L 39.549281,41.230586 z " style="opacity:0.4;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:white;stroke-width:1.00000024px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"/>
+      <path id="path10805" d="M 23.533985,9.5345374 C 19.970395,9.5871977 18.533985,12.207195 18.533985,15.500288 C 18.533985,18.587563 20.513718,21.12928 23.033985,21.434965 L 27.721485,21.466037 L 30.533985,18.762807 C 29.858434,17.460126 28.619908,16.346782 28.596485,15.344929 C 28.548719,13.251666 27.096466,9.4818952 23.533985,9.5345374 z M 23.502735,12.565833 C 25.56067,12.530736 26.480414,13.918043 26.480414,15.313858 L 26.480414,19.415311 L 23.190235,19.384239 C 21.734355,19.180444 20.596485,17.496377 20.596485,15.438145 C 20.596485,13.242697 21.44416,12.60094 23.502735,12.565833 z " style="fill:#ef2929;fill-opacity:1;stroke:#a40000;stroke-width:1.06797028;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
+      <path style="opacity:0.6;fill:white;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 40.751301,39.087023 L 29.446081,20.47863 L 28.747462,21.050508 L 39.496965,42.404061 L 40.751301,39.087023 z " id="path10842"/>
+      <path id="path12235" d="M 23.672328,10.534436 C 20.722856,10.578269 19.533985,12.759109 19.533985,15.500222 C 19.533985,18.070015 21.172548,20.185695 23.258494,20.440143 L 27.138192,20.466006 L 29.15351,18.528385 C 28.563128,17.600306 27.663039,16.892328 27.643652,16.058403 C 27.604118,14.316008 26.620883,10.490618 23.672328,10.534436 z " style="opacity:0.2;fill:none;fill-opacity:1;stroke:white;stroke-width:1.06797004;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
+      <path id="path12237" d="M 39.327672,10.534358 C 42.277144,10.578191 43.466015,12.759031 43.466015,15.500144 C 43.466015,18.069937 41.827452,20.185617 39.741506,20.440065 L 35.861808,20.465928 L 33.84649,18.528307 C 34.436872,17.600228 35.336961,16.89225 35.356348,16.058325 C 35.395882,14.31593 36.379117,10.49054 39.327672,10.534358 z " style="opacity:0.2;fill:none;fill-opacity:1;stroke:white;stroke-width:1.06797004;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
+      <path d="M 32.5 22.90625 A 1.21875 1.21875 0 1 1  30.0625,22.90625 A 1.21875 1.21875 0 1 1  32.5 22.90625 z" id="path2797" style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:#888a85;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
+      <path id="path2799" d="M 28.770407,23.295457 L 30.847533,27.272933 L 30.140426,28.598758 L 28.770407,23.295457 z " style="opacity:0.15577889;color:black;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
+      <path transform="matrix(0.825663,0,0,0.825663,3.514811,9.28956)" d="M 38.095378 12.357399 A 0.59662133 0.59662133 0 1 1  36.902135,12.357399 A 0.59662133 0.59662133 0 1 1  38.095378 12.357399 z" id="path2801" style="opacity:0.64824123;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"/>
+      <path style="opacity:0.64824123;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" id="path2803" d="M 38.095378 12.357399 A 0.59662133 0.59662133 0 1 1  36.902135,12.357399 A 0.59662133 0.59662133 0 1 1  38.095378 12.357399 z" transform="matrix(0.825663,0,0,0.825663,-9.45394,9.28956)"/>
+      <path style="opacity:1;color:black;fill:white;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" id="path2805" d="M 38.095378 12.357399 A 0.59662133 0.59662133 0 1 1  36.902135,12.357399 A 0.59662133 0.59662133 0 1 1  38.095378 12.357399 z" transform="matrix(1.637526,0,0,1.637526,-30.49516,3.101231)"/>
+    </g>
+  </g>
+</svg>
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 16408)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 16409)
@@ -8,6 +8,4 @@
 import java.awt.event.KeyEvent;
 import java.beans.PropertyChangeListener;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.swing.AbstractAction;
@@ -46,11 +44,4 @@
     private static final String EDITABLE = "editable";
 
-    private static final Map<String, ImageIcon> iconCache = new HashMap<>();
-
-    private static ImageIcon loadIcon(String iconName) {
-        return iconCache.computeIfAbsent(iconName,
-                x -> new ImageProvider(x).setOptional(true).setSize(ImageProvider.ImageSizes.SMALLICON).get());
-    }
-
     protected JTextComponent component;
     protected boolean undoRedo;
@@ -132,17 +123,17 @@
         if (component.isEditable()) {
             if (undoRedo) {
-                add(new JMenuItem(undoAction));
-                add(new JMenuItem(redoAction));
+                addMenuEntry(new JMenuItem(undoAction), "undo");
+                addMenuEntry(new JMenuItem(redoAction), "redo");
                 addSeparator();
             }
-            addMenuEntry(component, tr("Cut"), DefaultEditorKit.cutAction, null);
+            addMenuEntry(component, tr("Cut"), DefaultEditorKit.cutAction, "cut");
         }
         addMenuEntry(component, tr("Copy"), DefaultEditorKit.copyAction, "copy");
         if (component.isEditable()) {
             addMenuEntry(component, tr("Paste"), DefaultEditorKit.pasteAction, "paste");
-            addMenuEntry(component, tr("Delete"), DefaultEditorKit.deleteNextCharAction, null);
+            addMenuEntry(component, tr("Delete"), DefaultEditorKit.deleteNextCharAction, "dialogs/delete");
         }
         addSeparator();
-        addMenuEntry(component, tr("Select All"), DefaultEditorKit.selectAllAction, null);
+        addMenuEntry(component, tr("Select All"), DefaultEditorKit.selectAllAction, "dialogs/select");
     }
 
@@ -213,12 +204,14 @@
             JMenuItem mi = new JMenuItem(action);
             mi.setText(label);
-            if (iconName != null && Config.getPref().getBoolean("text.popupmenu.useicons", true)) {
-                ImageIcon icon = loadIcon(iconName);
-                if (icon != null) {
-                    mi.setIcon(icon);
-                }
-            }
-            add(mi);
-        }
+            addMenuEntry(mi, iconName);
+        }
+    }
+
+    protected void addMenuEntry(JMenuItem mi, String iconName) {
+        if (iconName != null && Config.getPref().getBoolean("text.popupmenu.useicons", true)) {
+            ImageIcon icon = new ImageProvider(iconName).setSize(ImageProvider.ImageSizes.SMALLICON).get();
+            mi.setIcon(icon);
+        }
+        add(mi);
     }
 
@@ -263,4 +256,5 @@
         public RedoAction() {
             super(tr("Redo"));
+            new ImageProvider("redo").getResource().attachImageIcon(this);
             setEnabled(false);
         }
