Index: /applications/editors/josm/plugins/tageditor/resources/osm-tag-definitions.dtd
===================================================================
--- /applications/editors/josm/plugins/tageditor/resources/osm-tag-definitions.dtd	(revision 30488)
+++ /applications/editors/josm/plugins/tageditor/resources/osm-tag-definitions.dtd	(revision 30488)
@@ -0,0 +1,20 @@
+<!ELEMENT osm-tag-definitions (tag*)>
+<!ATTLIST osm-tag-definitions
+     version CDATA #FIXED '0.9'
+     xmlns:xs CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-datatypes'
+>
+<!ELEMENT tag (label*) >
+<!ATTLIST tag
+     key CDATA #REQUIRED
+     type CDATA #REQUIRED
+     for-way (yes|no) 'no' 
+     for-node (yes|no) 'no' 
+     for-relation (yes|no) 'no'
+>
+<!ELEMENT label EMPTY>
+<!ATTLIST label
+     value CDATA #REQUIRED 
+     for-way (yes|no) 'no' 
+     for-node (yes|no) 'no' 
+     for-relation (yes|no) 'no'
+>
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java	(revision 30488)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
@@ -35,5 +36,4 @@
 import org.openstreetmap.josm.plugins.tageditor.editor.TagEditor;
 import org.openstreetmap.josm.plugins.tageditor.editor.TagEditorModel;
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
 import org.openstreetmap.josm.plugins.tageditor.preset.ui.IPresetSelectorListener;
 import org.openstreetmap.josm.plugins.tageditor.preset.ui.TabularPresetSelector;
@@ -43,4 +43,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.WindowGeometry;
+
 /**
  * The dialog for editing name/value-pairs (aka <em>tags</em>) associated with {@link OsmPrimitive}s.
@@ -155,5 +156,5 @@
         presetSelector.addPresetSelectorListener(
                 new IPresetSelectorListener() {
-                    public void itemSelected(Item item) {
+                    public void itemSelected(TaggingPreset item) {
                         tagEditor.stopEditing();
                         tagEditor.getModel().applyPreset(item);
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.ac;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.ac;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.ac;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.editor;
 
@@ -10,13 +11,12 @@
 import javax.swing.UIManager;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
-public class PresetItemListCellRenderer extends JLabel implements ListCellRenderer {
+public class PresetItemListCellRenderer extends JLabel implements ListCellRenderer<TaggingPreset> {
     //private static final Logger logger = Logger.getLogger(PresetItemListCellRenderer.class.getName());
 
-    public Component getListCellRendererComponent(JList list, Object value,
+    public Component getListCellRendererComponent(JList<? extends TaggingPreset> list, TaggingPreset item,
             int index, boolean isSelected, boolean cellHasFocus) {
 
-        Item item = (Item)value;
         if (item == null) {
             setText(tr("(none)"));
@@ -31,9 +31,5 @@
             }
             setIcon(item.getIcon());
-            StringBuilder sb = new StringBuilder();
-            sb.append(item.getParent().getName())
-            .append("/")
-            .append(item.getName());
-            setText(sb.toString());
+            setText(item.getName());
             setOpaque(true);
             setFont(UIManager.getFont("Table.font"));
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.editor;
 
@@ -14,5 +15,5 @@
 import javax.swing.JPanel;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
 public class PresetManager extends JPanel {
@@ -20,5 +21,5 @@
     //static private final Logger logger = Logger.getLogger(PresetManager.class.getName());
 
-    private JComboBox presets;
+    private JComboBox<TaggingPreset> presets;
     private JButton btnRemove;
     private JButton btnHighlight;
@@ -30,5 +31,5 @@
         // create the combobox to display the list of applied presets
         //
-        presets = new JComboBox() {
+        presets = new JComboBox<TaggingPreset>() {
             @Override
             public Dimension getPreferredSize() {
@@ -80,5 +81,5 @@
 
     protected void removeCurrentPreset() {
-        Item item= (Item)presets.getSelectedItem();
+        TaggingPreset item= (TaggingPreset)presets.getSelectedItem();
         if (item != null && model !=null) {
             model.removeAppliedPreset(item);
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java	(revision 30487)
+++ 	(revision )
@@ -1,165 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.plugins.tageditor.editor;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Font;
-
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.UIManager;
-import javax.swing.border.EmptyBorder;
-
-import org.openstreetmap.josm.gui.tagging.TagModel;
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
-import org.openstreetmap.josm.plugins.tageditor.preset.Tag;
-
-
-/**
- * This is the table cell renderer for cells for the table of tags
- * in the tag editor dialog.
- * 
- *
- */
-public class TableCellRenderer extends JLabel implements javax.swing.table.TableCellRenderer  {
-    
-    //private static Logger logger = Logger.getLogger(TableCellRenderer.class.getName());
-    public static final Color BG_COLOR_HIGHLIGHTED = new Color(255,255,204);
-        
-    private Font fontStandard = null;
-    private Font fontItalic = null;
-    
-    public TableCellRenderer() {
-        fontStandard = getFont();
-        fontItalic = fontStandard.deriveFont(Font.ITALIC);
-        setOpaque(true);
-        setBorder(new EmptyBorder(5,5,5,5));
-    }
-    
-    /**
-     * renders the name of a tag in the second column of
-     * the table
-     * 
-     * @param tag  the tag 
-     */
-    protected void renderTagName(TagModel tag) {
-        setText(tag.getName());
-    }
-    
-    /**
-     * renders the value of a a tag in the third column of 
-     * the table
-     * 
-     * @param tag  the  tag 
-     */
-    protected void renderTagValue(TagModel tag) {
-        if (tag.getValueCount() == 0) {
-            setText("");
-        } else if (tag.getValueCount() == 1) {
-            setText(tag.getValues().get(0));
-        } else if (tag.getValueCount() >  1) {
-            setText(tr("multiple"));
-            setFont(fontItalic);
-        }
-    }
-    
-    /**
-     * resets the renderer 
-     */
-    protected void resetRenderer() {
-        setText("");
-        setIcon(null);
-        setFont(fontStandard);
-    }
-    
-    protected TagEditorModel getModel(JTable table) {
-        return (TagEditorModel)table.getModel();
-    }
-    
-    protected boolean belongsToSelectedPreset(TagModel tagModel, TagEditorModel model) {
-        
-        // current tag is empty or consists of whitespace only => can't belong to
-        // a selected preset
-        //
-        if (tagModel.getName().trim().equals("") && tagModel.getValue().equals("")) {
-            return false;
-        }
-        
-        // no current preset selected? 
-        //
-        Item item = (Item)model.getAppliedPresetsModel().getSelectedItem();
-        if (item == null) {
-            return false;
-        }
-        
-        for(Tag tag: item.getTags()) {
-            if (tag.getValue() == null) {
-                if (tagModel.getName().equals(tag.getKey())) {
-                    return true; 
-                }
-            } else {
-                if (tagModel.getName().equals(tag.getKey())
-                    && tagModel.getValue().equals(tag.getValue())) {
-                    return true; 
-                }
-            }
-        }       
-        return false;
-    }
-    
-    /**
-     * renders the background color. The default color is white. It is
-     * set to {@see TableCellRenderer#BG_COLOR_HIGHLIGHTED} if this cell
-     * displays the tag which is suggested by the currently selected 
-     * preset.
-     * 
-     * @param tagModel the tag model 
-     * @param model the tag editor model 
-     */
-    protected void renderColor(TagModel tagModel, TagEditorModel model, boolean isSelected) {
-        if (isSelected){
-            setBackground(UIManager.getColor("Table.selectionBackground"));
-            setForeground(UIManager.getColor("Table.selectionForeground"));
-        } else {
-            setBackground(UIManager.getColor("Table.background"));
-            setForeground(UIManager.getColor("Table.foreground"));
-        }       
-        if (belongsToSelectedPreset(tagModel, model)) {
-            setBackground(BG_COLOR_HIGHLIGHTED);
-        }
-    }
-    
-    /**
-     * replies the cell renderer component for a specific cell 
-     * 
-     * @param table  the table
-     * @param value the value to be rendered
-     * @param isSelected  true, if the value is selected 
-     * @param hasFocus true, if the cell has focus 
-     * @param rowIndex the row index 
-     * @param vColIndex the column index 
-     * 
-     * @return the renderer component 
-     */
-    public Component getTableCellRendererComponent(JTable table, Object value,
-            boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
-        
-        resetRenderer();
-        TagModel tagModel  = (TagModel)value;
-        switch(vColIndex) { 
-            case 0: renderTagName(tagModel); break;
-            case 1: renderTagValue(tagModel); break;
-        }
-        renderColor(tagModel, (TagEditorModel)table.getModel(),isSelected);
-        if (hasFocus && isSelected) {
-            if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) {
-                if (table.getEditorComponent() != null) {
-                    table.getEditorComponent().requestFocusInWindow();
-                }
-            }
-        }
-        return this;
-    }
-}
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.editor;
 
@@ -16,8 +17,7 @@
 
 import org.openstreetmap.josm.gui.tagging.TagTable;
+import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
 import org.openstreetmap.josm.plugins.tageditor.ac.IAutoCompletionListListener;
-
 
 /**
@@ -103,5 +103,5 @@
         tblTagEditor = new TagTable(tagEditorModel);
         tblTagEditor.setTagCellEditor(new TagSpecificationAwareTagCellEditor());
-        TableCellRenderer renderer = new TableCellRenderer();
+        TagTableCellRenderer renderer = new TagTableCellRenderer();
         tblTagEditor.getColumnModel().getColumn(0).setCellRenderer(renderer);
         tblTagEditor.getColumnModel().getColumn(1).setCellRenderer(renderer);
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java	(revision 30488)
@@ -15,16 +15,13 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.tagging.TagModel;
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
-import org.openstreetmap.josm.plugins.tageditor.preset.Tag;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
+import org.openstreetmap.josm.plugins.tageditor.preset.AdvancedTag;
 import org.openstreetmap.josm.plugins.tageditor.tagspec.KeyValuePair;
 
-/**
- * 
- */
 @SuppressWarnings("serial")
 public class TagEditorModel extends org.openstreetmap.josm.gui.tagging.TagEditorModel  {
     //static private final Logger logger = Logger.getLogger(TagEditorModel.class.getName());
     
-    private DefaultComboBoxModel appliedPresets = null;
+    private DefaultComboBoxModel<TaggingPreset> appliedPresets = null;
 
     /**
@@ -33,5 +30,5 @@
     public TagEditorModel(DefaultListSelectionModel rowSelectionModel, DefaultListSelectionModel colSelectionModel){
         super(rowSelectionModel, colSelectionModel);
-        appliedPresets = new DefaultComboBoxModel();
+        appliedPresets = new DefaultComboBoxModel<>();
     }
 
@@ -47,5 +44,5 @@
      * 
      */
-    public void applyPreset(Item item) {
+    public void applyPreset(TaggingPreset item) {
         if (item == null)
             throw new IllegalArgumentException("argument 'item' must not be null");
@@ -60,5 +57,5 @@
         // apply the tags proposed by the preset
         //
-        for(Tag tag : item.getTags()) {
+        for(AdvancedTag tag : AdvancedTag.forTaggingPreset(item)) {
             if (!tag.isOptional()) {
                 if (!includesTag(tag.getKey())) {
@@ -103,12 +100,12 @@
 
 
-    public DefaultComboBoxModel getAppliedPresetsModel() {
+    public DefaultComboBoxModel<TaggingPreset> getAppliedPresetsModel() {
         return appliedPresets;
     }
 
-    public void removeAppliedPreset(Item item) {
+    public void removeAppliedPreset(TaggingPreset item) {
         if (item == null)
             return;
-        for (Tag tag: item.getTags()) {
+        for (AdvancedTag tag: AdvancedTag.forTaggingPreset(item)) {
             if (tag.getValue() != null) {
                 // preset tag with explicit key and explicit value. Remove tag model
@@ -116,5 +113,5 @@
                 //
                 TagModel tagModel = get(tag.getKey());
-                if (tagModel !=null && tag.getValue().equals(tagModel.getValue())) {
+                if (tagModel != null && tag.getValue().equals(tagModel.getValue())) {
                     tags.remove(tagModel);
                     setDirty(true);
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.editor;
 
@@ -6,6 +7,6 @@
 import org.openstreetmap.josm.gui.tagging.TagCellEditor;
 import org.openstreetmap.josm.gui.tagging.TagModel;
+import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
-import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPriority;
 import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext;
 import org.openstreetmap.josm.plugins.tageditor.tagspec.TagSpecifications;
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTableCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTableCellRenderer.java	(revision 30488)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagTableCellRenderer.java	(revision 30488)
@@ -0,0 +1,163 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.tageditor.editor;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Font;
+
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.UIManager;
+import javax.swing.border.EmptyBorder;
+import javax.swing.table.TableCellRenderer;
+
+import org.openstreetmap.josm.gui.tagging.TagModel;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
+import org.openstreetmap.josm.plugins.tageditor.preset.AdvancedTag;
+
+/**
+ * This is the table cell renderer for cells for the table of tags
+ * in the tag editor dialog.
+ */
+public class TagTableCellRenderer extends JLabel implements TableCellRenderer  {
+    
+    //private static Logger logger = Logger.getLogger(TagTableCellRenderer.class.getName());
+    public static final Color BG_COLOR_HIGHLIGHTED = new Color(255,255,204);
+        
+    private Font fontStandard = null;
+    private Font fontItalic = null;
+    
+    public TagTableCellRenderer() {
+        fontStandard = getFont();
+        fontItalic = fontStandard.deriveFont(Font.ITALIC);
+        setOpaque(true);
+        setBorder(new EmptyBorder(5,5,5,5));
+    }
+    
+    /**
+     * renders the name of a tag in the second column of
+     * the table
+     * 
+     * @param tag  the tag 
+     */
+    protected void renderTagName(TagModel tag) {
+        setText(tag.getName());
+    }
+    
+    /**
+     * renders the value of a a tag in the third column of 
+     * the table
+     * 
+     * @param tag  the  tag 
+     */
+    protected void renderTagValue(TagModel tag) {
+        if (tag.getValueCount() == 0) {
+            setText("");
+        } else if (tag.getValueCount() == 1) {
+            setText(tag.getValues().get(0));
+        } else if (tag.getValueCount() >  1) {
+            setText(tr("multiple"));
+            setFont(fontItalic);
+        }
+    }
+    
+    /**
+     * resets the renderer 
+     */
+    protected void resetRenderer() {
+        setText("");
+        setIcon(null);
+        setFont(fontStandard);
+    }
+    
+    protected TagEditorModel getModel(JTable table) {
+        return (TagEditorModel)table.getModel();
+    }
+    
+    protected boolean belongsToSelectedPreset(TagModel tagModel, TagEditorModel model) {
+        
+        // current tag is empty or consists of whitespace only => can't belong to
+        // a selected preset
+        //
+        if (tagModel.getName().trim().equals("") && tagModel.getValue().equals("")) {
+            return false;
+        }
+        
+        // no current preset selected? 
+        //
+        TaggingPreset item = (TaggingPreset)model.getAppliedPresetsModel().getSelectedItem();
+        if (item == null) {
+            return false;
+        }
+        
+        for(AdvancedTag tag: AdvancedTag.forTaggingPreset(item)) {
+            if (tag.getValue() == null) {
+                if (tagModel.getName().equals(tag.getKey())) {
+                    return true; 
+                }
+            } else {
+                if (tagModel.getName().equals(tag.getKey())
+                    && tagModel.getValue().equals(tag.getValue())) {
+                    return true; 
+                }
+            }
+        }       
+        return false;
+    }
+    
+    /**
+     * renders the background color. The default color is white. It is
+     * set to {@see TableCellRenderer#BG_COLOR_HIGHLIGHTED} if this cell
+     * displays the tag which is suggested by the currently selected 
+     * preset.
+     * 
+     * @param tagModel the tag model 
+     * @param model the tag editor model 
+     */
+    protected void renderColor(TagModel tagModel, TagEditorModel model, boolean isSelected) {
+        if (isSelected){
+            setBackground(UIManager.getColor("Table.selectionBackground"));
+            setForeground(UIManager.getColor("Table.selectionForeground"));
+        } else {
+            setBackground(UIManager.getColor("Table.background"));
+            setForeground(UIManager.getColor("Table.foreground"));
+        }       
+        if (belongsToSelectedPreset(tagModel, model)) {
+            setBackground(BG_COLOR_HIGHLIGHTED);
+        }
+    }
+    
+    /**
+     * replies the cell renderer component for a specific cell 
+     * 
+     * @param table  the table
+     * @param value the value to be rendered
+     * @param isSelected  true, if the value is selected 
+     * @param hasFocus true, if the cell has focus 
+     * @param rowIndex the row index 
+     * @param vColIndex the column index 
+     * 
+     * @return the renderer component 
+     */
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
+        
+        resetRenderer();
+        TagModel tagModel  = (TagModel)value;
+        switch(vColIndex) { 
+            case 0: renderTagName(tagModel); break;
+            case 1: renderTagValue(tagModel); break;
+        }
+        renderColor(tagModel, (TagEditorModel)table.getModel(),isSelected);
+        if (hasFocus && isSelected) {
+            if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) {
+                if (table.getEditorComponent() != null) {
+                    table.getEditorComponent().requestFocusInWindow();
+                }
+            }
+        }
+        return this;
+    }
+}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AbstractNameIconProvider.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AbstractNameIconProvider.java	(revision 30487)
+++ 	(revision )
@@ -1,43 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-import java.io.File;
-import java.util.Collection;
-
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.tools.ImageProvider;
-
-public abstract class AbstractNameIconProvider implements INameIconProvider {
-    
-    protected String name;
-    protected String iconName;
-    protected ImageIcon icon;
-    protected File zipIconArchive;
-    
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getIconName() {
-        return iconName;
-    }
-
-    public void setIconName(String iconName, File zipIconArchive) {
-        this.iconName = iconName;
-    }
-    
-    public Icon getIcon() {
-        if (icon == null && getIconName() != null) {
-            Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
-            icon = new ImageProvider(getIconName()).setDirs(s).setId("presets").setArchive(zipIconArchive).setOptional(true)
-            .setMaxWidth(16).setMaxHeight(16).get();
-        }
-        return icon;
-    }
-}
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AdvancedTag.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AdvancedTag.java	(revision 30488)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AdvancedTag.java	(revision 30488)
@@ -0,0 +1,80 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.tageditor.preset;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.I18n.trc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.openstreetmap.josm.data.osm.Tag;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
+import org.openstreetmap.josm.gui.tagging.TaggingPresetItem;
+import org.openstreetmap.josm.gui.tagging.TaggingPresetItems.KeyedItem;
+import org.openstreetmap.josm.gui.tagging.TaggingPresetItems.Optional;
+
+public class AdvancedTag extends Tag {
+    private String displayName;
+    private boolean optional = false;
+
+    public AdvancedTag() {
+    }
+
+    public AdvancedTag(String key, String value) {
+        super(key, value);
+    }
+
+    public AdvancedTag(String key) {
+        super(key);
+    }
+
+    public AdvancedTag(Tag tag) {
+        super(tag);
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
+    public boolean isOptional() {
+        return optional;
+    }
+
+    public void setOptional(boolean optional) {
+        this.optional = optional;
+    }
+    
+    public static Collection<AdvancedTag> forTaggingPreset(TaggingPreset preset) {
+        Collection<AdvancedTag> result = new ArrayList<>();
+        boolean isOptional = false;
+        for (TaggingPresetItem item : preset.data) {
+            if (item instanceof KeyedItem) {
+                KeyedItem ki = (KeyedItem)item;
+                for (String value : ki.getValues()) {
+                    AdvancedTag tag = new AdvancedTag(ki.key, value);
+                    tag.setOptional(isOptional);
+                    if (ki.text != null) {
+                        if (ki.text_context != null) {
+                            tag.setDisplayName(trc(ki.text_context, ki.text));
+                        } else {
+                            tag.setDisplayName(tr(ki.text));
+                        }
+                    }
+                    result.add(tag);
+                }
+            } else if (item instanceof Optional) {
+                isOptional = true;
+            }
+            // TODO optional stuff is not perfect: all items found after an optional item will be considered as optional
+            // even if they are outside the <optional> element.
+            // We can't easily access this information. The plugin previously reimplemented a lot of JOSM code to determine that.
+            // This duplicated code has been stripped off. It's not really important as optional items are almost always
+            // located at the end of an item.
+        }
+        return result;
+    }
+}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Group.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Group.java	(revision 30487)
+++ 	(revision )
@@ -1,37 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Group represents a named group of preset items. Groups can be nested.
- * 
- */
-public class Group extends AbstractNameIconProvider {
-    
-    //static final private Logger logger = Logger.getLogger(Group.class.getName());
-    
-    private List<Item> items = null;
-    
-    public Group() {
-        items = new ArrayList<Item>();
-    }
-    
-    public Group(String name) {
-        this();
-        setName(name);
-    }
-    
-    public void addItem(Item item) {
-        item.setParent(this);
-        items.add(item);
-    }
-    
-    public void removeItem(Item item) {
-        items.remove(item);
-    }
-    
-    public List<Item> getItems() {
-        return items; 
-    }
-}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/INameIconProvider.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/INameIconProvider.java	(revision 30487)
+++ 	(revision )
@@ -1,8 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-import javax.swing.Icon;
-
-public interface INameIconProvider {
-    public String getName();
-    public Icon  getIcon();
-}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java	(revision 30487)
+++ 	(revision )
@@ -1,58 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Item  extends AbstractNameIconProvider {
-
-    //private final static Logger logger = Logger.getLogger(Item.class.getName());
-
-    private String label;
-    private List<Tag> tags;
-    private Group parent;
-
-    public Item() {
-        tags = new ArrayList<Tag>();
-    }
-
-    public Group getParent() {
-        return parent;
-    }
-
-    public void setParent(Group parent) {
-        this.parent = parent;
-    }
-
-    public String getLabel() {
-        return label;
-    }
-
-    public void setLabel(String label) {
-        this.label = label;
-    }
-
-    public Item(String name) {
-        setName(name);
-    }
-
-    public void addTag(Tag tag) {
-        tags.add(tag);
-    }
-
-    public List<Tag> getTags() {
-        return tags;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder builder  = new StringBuilder();
-        builder.append("[")
-        .append(getClass().getName())
-        .append(":")
-        .append("name=")
-        .append(name)
-        .append("]");
-
-        return builder.toString();
-    }
-}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Presets.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Presets.java	(revision 30487)
+++ 	(revision )
@@ -1,127 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.JOptionPane;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.io.MirroredInputStream;
-import org.openstreetmap.josm.plugins.tageditor.preset.io.Parser;
-import org.openstreetmap.josm.plugins.tageditor.preset.io.PresetIOException;
-
-public class Presets {
-    private static Logger logger = Logger.getLogger(Presets.class.getName());
-
-    private static Presets presets = null;
-
-    static public void initPresets() {
-
-        presets = new Presets();
-        LinkedList<String> sources = new LinkedList<String>();
-
-        // code copied from org.openstreetmap.josm.gui.tagging.TaggingPreset
-        // and slightly modified
-        //
-        if (Main.pref.getBoolean("taggingpreset.enable-defaults", true)) {
-            sources.add("resource://data/defaultpresets.xml");
-        }
-        sources.addAll(Main.pref.getCollection("taggingpreset.sources",
-                new LinkedList<String>()));
-
-        File zipIconArchive = null;
-        for (String source : sources) {
-            try {
-                MirroredInputStream s = new MirroredInputStream(source);
-                InputStream zip = s.findZipEntryInputStream("xml","preset");
-                if(zip != null) {
-                    zipIconArchive = s.getFile();
-                }
-                InputStreamReader r;
-                try {
-                    r = new InputStreamReader(s, "UTF-8");
-                } catch (UnsupportedEncodingException e) {
-                    r = new InputStreamReader(s);
-                }
-                presets = loadPresets(r, presets, zipIconArchive);
-            } catch (PresetIOException e) {
-                logger
-                        .log(Level.SEVERE, tr(
-                                "Could not read tagging preset source: {0}",
-                                source), e);
-                JOptionPane.showMessageDialog(Main.parent, tr(
-                        "Could not read tagging preset source: {0}", source),
-                        tr("Error"), JOptionPane.ERROR_MESSAGE);
-            } catch (IOException e) {
-                e.printStackTrace();
-                JOptionPane.showMessageDialog(Main.parent, tr(
-                        "Could not read tagging preset source: {0}", source),
-                        tr("Error"), JOptionPane.ERROR_MESSAGE);
-            }
-        }
-    }
-
-    static public Presets loadPresets(URL from) throws PresetIOException {
-        try {
-            URLConnection con = from.openConnection();
-            con.connect();
-            Reader reader = new InputStreamReader(con.getInputStream());
-            return loadPresets(reader, null, null);
-        } catch (Exception e) {
-            logger.log(Level.SEVERE,
-                    "exception caught while loading preset file", e);
-            throw new PresetIOException(e);
-        }
-    }
-
-    static public Presets loadPresets(Reader reader, Presets p, File zipIconArchive) throws PresetIOException {
-        try {
-            Parser parser = new Parser();
-            parser.setReader(reader);
-            parser.setPresets(p);
-            parser.parse();
-            return parser.getPresets();
-        } catch (Exception e) {
-            logger.log(Level.SEVERE, "exception caught while loading presets",e);
-            throw new PresetIOException(e);
-        }
-    }
-
-    static public Presets getPresets() {
-        if (presets == null) {
-            initPresets();
-        }
-        return presets;
-    }
-
-    private List<Group> groups;
-
-    public Presets() {
-        groups = new ArrayList<Group>();
-    }
-
-    public void addGroup(Group group) {
-        groups.add(group);
-    }
-
-    public void removeGroup(Group group) {
-        groups.remove(group);
-    }
-
-    public List<Group> getGroups() {
-        return groups;
-    }
-}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Tag.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Tag.java	(revision 30487)
+++ 	(revision )
@@ -1,43 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.preset;
-
-public class Tag {
-    private String key;
-    private String value;
-    private String displayName;
-    private boolean optional = false;
-    
-    public Tag() {      
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public String getDisplayName() {
-        return displayName;
-    }
-
-    public void setDisplayName(String displayName) {
-        this.displayName = displayName;
-    }
-
-    public boolean isOptional() {
-        return optional;
-    }
-
-    public void setOptional(boolean optional) {
-        this.optional = optional;
-    }
-}
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java	(revision 30488)
@@ -1,8 +1,9 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
 public interface IPresetSelectorListener {
 
-    public void itemSelected(Item item);
+    public void itemSelected(TaggingPreset item);
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
@@ -9,7 +10,5 @@
 import javax.swing.table.TableCellRenderer;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.INameIconProvider;
-
-
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
 public class NameIconCellRenderer extends JLabel implements TableCellRenderer {
@@ -17,5 +16,4 @@
     //private static Logger logger = Logger.getLogger(NameIconCellRenderer.class.getName());
     public static final Color BG_COLOR_SELECTED = new Color(143,170,255);
-
 
     protected void init() {
@@ -36,7 +34,9 @@
             setBackground(Color.WHITE);
         }
-        INameIconProvider provider = (INameIconProvider) value;
-        setText(provider.getName());
-        setIcon(provider.getIcon());
+        TaggingPreset provider = (TaggingPreset) value;
+        if (provider != null) {
+            setText(provider.getName());
+            setIcon(provider.getIcon());
+        }
         return this;
     }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
@@ -5,5 +6,4 @@
 import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
-
 
 public class PresetsTable extends JTable {
@@ -17,5 +17,4 @@
         setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         setRowHeight(18); // icon height (=16) + minimal border
-        
     }
     
@@ -44,4 +43,3 @@
         }
     }
-
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
@@ -6,5 +7,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-public class PresetsTableColumnModel extends DefaultTableColumnModel  {
+public class PresetsTableColumnModel extends DefaultTableColumnModel {
 
     protected void createColumns() {
@@ -26,5 +27,4 @@
         col.setCellRenderer(renderer);
         addColumn(col);
-
     }
 
@@ -32,4 +32,3 @@
         createColumns();
     }
-    
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java	(revision 30488)
@@ -1,13 +1,12 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
 import java.util.ArrayList;
+import java.util.Collection;
 
 import javax.swing.event.TableModelListener;
 import javax.swing.table.AbstractTableModel;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.Group;
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
-import org.openstreetmap.josm.plugins.tageditor.preset.Presets;
-
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
 
 public class PresetsTableModel extends AbstractTableModel  {
@@ -16,15 +15,12 @@
 
     private final ArrayList<TableModelListener> listeners = new ArrayList<TableModelListener>();
-    private final ArrayList<Item> items = new ArrayList<Item>();
-    private final ArrayList<Item> visibleItems = new ArrayList<Item>();
-    private Presets presets = null;
+    private final ArrayList<TaggingPreset> items = new ArrayList<TaggingPreset>();
+    private final ArrayList<TaggingPreset> visibleItems = new ArrayList<TaggingPreset>();
 
-    protected void initModelFromPresets(Presets presets) {
-        for(Group group: presets.getGroups()) {
-            for(Item item: group.getItems()) {
-                items.add(item);
-                visibleItems.add(item);
-            }
-        }
+    protected void initModelFromPresets(Collection<TaggingPreset> presets) {
+        items.clear();
+        visibleItems.clear();
+        items.addAll(presets);
+        visibleItems.addAll(presets);
     }
 
@@ -32,15 +28,9 @@
     }
 
-    public PresetsTableModel(Presets presets) {
-        setPresets(presets);
+    public Collection<TaggingPreset> getPresets() {
+        return items;
     }
 
-
-    public Presets getPresets() {
-        return presets;
-    }
-
-    public void setPresets(Presets presets) {
-        this.presets = presets;
+    public void setPresets(Collection<TaggingPreset> presets) {
         initModelFromPresets(presets);
         fireTableDataChanged();
@@ -72,10 +62,9 @@
 
     public Object getValueAt(int rowIndex, int columnIndex) {
-        Item item = visibleItems.get(rowIndex);
+        TaggingPreset item = visibleItems.get(rowIndex);
         switch(columnIndex) {
-        case 0: return item.getParent();
+        case 0: return item.group;
         case 1: return item;
         default: return "unknown";
-
         }
     }
@@ -100,5 +89,5 @@
     }
 
-    public Item getVisibleItem(int idx) {
+    public TaggingPreset getVisibleItem(int idx) {
         if (idx < 0 || idx >= this.visibleItems.size())
             throw new IndexOutOfBoundsException("index out of bounds. idx=" + idx);
@@ -110,5 +99,5 @@
             if (filter == null || filter.trim().equals("")) {
                 visibleItems.clear();
-                for(Item item: items) {
+                for(TaggingPreset item: items) {
                     visibleItems.add(item);
                 }
@@ -116,7 +105,7 @@
                 visibleItems.clear();
                 filter = filter.toLowerCase();
-                for(Item item: items) {
-                    if (    (item.getName() != null && item.getName().toLowerCase().trim().startsWith(filter))
-                            || (item.getParent().getName() != null && item.getParent().getName().toLowerCase().trim().startsWith(filter))) {
+                for(TaggingPreset item: items) {
+                    if ((item.getName() != null && item.getName().toLowerCase().trim().contains(filter))
+                            || (item.group != null && item.group.getName() != null && item.group.getName().toLowerCase().trim().contains(filter))) {
                         visibleItems.add(item);
                     }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.preset.ui;
 
@@ -15,4 +16,5 @@
 import java.awt.event.MouseEvent;
 import java.util.ArrayList;
+import java.util.Collection;
 
 import javax.swing.AbstractAction;
@@ -31,7 +33,6 @@
 import javax.swing.event.ListSelectionListener;
 
-import org.openstreetmap.josm.plugins.tageditor.preset.Item;
-import org.openstreetmap.josm.plugins.tageditor.preset.Presets;
-
+import org.openstreetmap.josm.gui.tagging.TaggingPreset;
+import org.openstreetmap.josm.gui.tagging.TaggingPresets;
 
 public class TabularPresetSelector extends JPanel {
@@ -42,5 +43,4 @@
     private JScrollPane scrollPane;
     private JButton btnApply;
-
 
     protected JPanel buildFilterPanel() {
@@ -51,15 +51,5 @@
         pnl.add(lbl);
         pnl.add(tfFilter,BorderLayout.CENTER);
-        JButton btn = new JButton(tr("Filter"));
-        pnl.add(btn);
-        btn.addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        filter(tfFilter.getText());
-                    }
-
-                }
-        );
-        btn = new JButton(tr("Clear"));
+        JButton btn = new JButton(tr("Clear"));
         pnl.add(btn);
         btn.addActionListener(
@@ -74,6 +64,4 @@
     }
 
-
-
     protected JScrollPane buildPresetGrid() {
 
@@ -110,6 +98,5 @@
                 int rowNum = presetsTable.getSelectedRow();
                 if (rowNum >= 0) {
-                    Item item = getModel().getVisibleItem(rowNum);
-                    fireItemSelected(item);
+                    fireItemSelected(getModel().getVisibleItem(rowNum));
                 }
             }
@@ -136,6 +123,5 @@
                         int row = presetsTable.getSelectedRow();
                         if (row >=0) {
-                            Item item = getModel().getVisibleItem(row);
-                            fireItemSelected(item);
+                            fireItemSelected(getModel().getVisibleItem(row));
                         }
                     }
@@ -151,6 +137,5 @@
         add(buildControlButtonPanel(), BorderLayout.SOUTH);
 
-        // wire the text field for filter expressions to the prests
-        // table
+        // wire the text field for filter expressions to the preset table
         //
         tfFilter.getDocument().addDocumentListener(
@@ -192,15 +177,12 @@
         );
 
-
         // load the set of presets and bind them to the preset table
         //
-        Presets.initPresets();
-        bindTo(Presets.getPresets());
+        bindTo(TaggingPresets.getTaggingPresets());
         presetsTable.getSelectionModel().clearSelection();
         btnApply.setEnabled(false);
-
-    }
-
-    public void bindTo(Presets presets) {
+    }
+
+    public void bindTo(Collection<TaggingPreset> presets) {
         PresetsTableModel model = (PresetsTableModel)presetsTable.getModel();
         model.setPresets(presets);
@@ -227,5 +209,5 @@
     }
 
-    protected void fireItemSelected(Item item) {
+    protected void fireItemSelected(TaggingPreset item) {
         synchronized(this.listeners) {
             for(IPresetSelectorListener listener: listeners) {
@@ -234,7 +216,4 @@
         }
     }
-
-
-
 
     private class DoubleClickAdapter extends MouseAdapter {
@@ -243,10 +222,8 @@
             if (e.getClickCount() == 2) {
                 int rowNum = presetsTable.rowAtPoint(e.getPoint());
-                Item item = getModel().getVisibleItem(rowNum);
-                fireItemSelected(item);
-            }
-        }
-    }
-
+                fireItemSelected(getModel().getVisibleItem(rowNum));
+            }
+        }
+    }
 
     public void filter(String filter) {
@@ -271,5 +248,4 @@
     }
 
-
     protected PresetsTableModel getModel() {
         return (PresetsTableModel)presetsTable.getModel();
@@ -279,6 +255,4 @@
         getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)a.getValue(AbstractAction.ACCELERATOR_KEY), a.getValue(AbstractAction.NAME));
         getActionMap().put(a.getValue(AbstractAction.NAME), a);
-
-    }
-
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LabelSpecification.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LabelSpecification.java	(revision 30488)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LabelSpecification.java	(revision 30488)
@@ -0,0 +1,69 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.tageditor.tagspec;
+
+import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext;
+
+public class LabelSpecification {
+
+    /** the key of the tag */
+    private String value;
+        
+    
+    private boolean applicableToNode = true;
+    private boolean applicableToWay = true;
+    private boolean applicableToRelation = true;
+    
+    /**
+     * constructor 
+     */
+    public LabelSpecification() {
+    }
+
+    public boolean isApplicable(AutoCompletionContext context) {
+        boolean ret = false;
+        if (context.isSelectionEmpty()) {
+            ret = true;
+        } else {
+            ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
+            ret = ret || (applicableToWay && context.isSelectionIncludesWays());
+            ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
+        }
+        return ret;
+    }
+
+    /* --------------------------------------------------------------------------- */
+    /* setters/getters                                                             */
+    /* --------------------------------------------------------------------------- */
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public boolean isApplicableToNode() {
+        return applicableToNode;
+    }
+
+    public void setApplicableToNode(boolean applicableToNode) {
+        this.applicableToNode = applicableToNode;
+    }
+
+    public boolean isApplicableToWay() {
+        return applicableToWay;
+    }
+
+    public void setApplicableToWay(boolean applicableToWay) {
+        this.applicableToWay = applicableToWay;
+    }
+
+    public boolean isApplicableToRelation() {
+        return applicableToRelation;
+    }
+
+    public void setApplicableToRelation(boolean applicableToRelation) {
+        this.applicableToRelation = applicableToRelation;
+    }
+}
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LableSpecification.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LableSpecification.java	(revision 30487)
+++ 	(revision )
@@ -1,72 +1,0 @@
-package org.openstreetmap.josm.plugins.tageditor.tagspec;
-
-import org.openstreetmap.josm.plugins.tageditor.ac.AutoCompletionContext;
-
-public class LableSpecification {
-
-    /** the key of the tag */
-    private String value;
-        
-    
-    private boolean applicableToNode = true;
-    private boolean applicableToWay = true;
-    private boolean applicableToRelation = true;
-    
-    /**
-     * constructor 
-     */
-    public LableSpecification() {
-    }
-
-    public boolean isApplicable(AutoCompletionContext context) {
-        boolean ret = false;
-        if (context.isSelectionEmpty()) {
-            ret = true;
-        } else {
-            ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
-            ret = ret || (applicableToWay && context.isSelectionIncludesWays());
-            ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
-        }
-        return ret;
-    }
-
-    /* --------------------------------------------------------------------------- */
-    /* setters/getters                                                             */
-    /* --------------------------------------------------------------------------- */
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public boolean isApplicableToNode() {
-        return applicableToNode;
-    }
-
-    public void setApplicableToNode(boolean applicableToNode) {
-        this.applicableToNode = applicableToNode;
-    }
-
-    public boolean isApplicableToWay() {
-        return applicableToWay;
-    }
-
-    public void setApplicableToWay(boolean applicableToWay) {
-        this.applicableToWay = applicableToWay;
-    }
-
-    public boolean isApplicableToRelation() {
-        return applicableToRelation;
-    }
-
-    public void setApplicableToRelation(boolean applicableToRelation) {
-        this.applicableToRelation = applicableToRelation;
-    }
-    
-
-    
-    
-}
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec;
 
@@ -31,5 +32,5 @@
     private boolean applicableToRelation = true;
 
-    private ArrayList<LableSpecification> lables = null;
+    private ArrayList<LabelSpecification> lables = null;
 
 
@@ -38,5 +39,5 @@
      */
     public TagSpecification() {
-        lables = new ArrayList<LableSpecification>();
+        lables = new ArrayList<LabelSpecification>();
     }
 
@@ -58,5 +59,5 @@
      *   labels are defined
      */
-    public List<LableSpecification> getLables() {
+    public List<LabelSpecification> getLables() {
         return lables;
     }
@@ -68,9 +69,9 @@
      * @exception IllegalArgumentException thrown, if lables is null
      */
-    public void setLables(List<LableSpecification> lables) throws IllegalArgumentException {
+    public void setLables(List<LabelSpecification> lables) throws IllegalArgumentException {
         if (lables == null)
             throw new IllegalArgumentException("argument 'lables' must not be null");
         this.lables.clear();
-        for (LableSpecification l : lables) {
+        for (LabelSpecification l : lables) {
             this.lables.add(l);
         }
@@ -84,5 +85,5 @@
      * @exception IllegalArgumentException thrown, if lable is null
      */
-    public void addLable(LableSpecification lable) throws IllegalArgumentException  {
+    public void addLable(LabelSpecification lable) throws IllegalArgumentException  {
         if (lable == null)
             throw new IllegalArgumentException("argument 'lable' must not be null");
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec;
 
@@ -23,5 +24,4 @@
 import org.xml.sax.helpers.XMLReaderFactory;
 
-
 /**
  * This class manages a list of {@link TagSpecification}s.
@@ -110,5 +110,5 @@
             parser.setErrorHandler(handler);
             parser.setEntityResolver(new ResourceEntityResolver());
-            parser.setFeature( "http://xml.org/sax/features/validation", true);
+            parser.setFeature("http://xml.org/sax/features/validation", true);
             parser.setFeature("http://xml.org/sax/features/namespaces", true);
             parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
@@ -116,5 +116,6 @@
 
         } catch (Exception e) {
-            logger.log(Level.SEVERE, "failed to load tag specificatoin file", e);
+            logger.log(Level.SEVERE, "failed to load tag specification file", e);
+            e.getCause().printStackTrace();
             throw e;
         } finally {
@@ -141,6 +142,6 @@
         for (TagSpecification spec : tagSpecifications) {
             if (spec.getKey().equals(forKey)) {
-                List<LableSpecification> lables = spec.getLables();
-                for (LableSpecification l : lables) {
+                List<LabelSpecification> lables = spec.getLables();
+                for (LabelSpecification l : lables) {
                     if (!l.isApplicable(context)) {
                         continue;
@@ -166,5 +167,5 @@
 
         for (TagSpecification s : tagSpecifications) {
-            for (LableSpecification l : s.getLables()) {
+            for (LabelSpecification l : s.getLables()) {
                 entries.add(new KeyValuePair(s.getKey(), l.getValue()));
             }
@@ -188,5 +189,4 @@
         private TagSpecification currentTagSpecification  = null;
 
-
         @Override
         public void endDocument() throws SAXException {
@@ -194,6 +194,4 @@
         }
 
-
-
         @Override
         public void error(SAXParseException e) throws SAXException {
@@ -210,5 +208,4 @@
             logger.log(Level.FINE,"START");
         }
-
 
         /**
@@ -293,5 +290,5 @@
          */
         protected void startElementLabel(Attributes atts) throws SAXException {
-            LableSpecification ls = new LableSpecification();
+            LabelSpecification ls = new LabelSpecification();
             for (int i=0; i< atts.getLength(); i++) {
                 String name = atts.getQName(i);
@@ -349,25 +346,21 @@
         @Override
         public void warning(SAXParseException e) throws SAXException {
-            // TODO Auto-generated method stub
             logger.log(Level.WARNING, "XML parsing warning", e);
         }
     }
 
-    /**
-     *
-     *
-     */
     class ResourceEntityResolver implements EntityResolver {
 
-        public InputSource resolveEntity(String publicId, String systemId)
-        throws SAXException, IOException {
-            if (systemId != null && systemId.endsWith(DTD))
-                return new InputSource(
-                        TagSpecifications.class.getResourceAsStream(DTD)
-                );
-            else
+        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+            if (systemId != null && systemId.endsWith(DTD)) {
+                InputStream stream = TagSpecifications.class.getResourceAsStream("/resources/"+DTD);
+                if (stream == null) {
+                    logger.log(Level.WARNING, "Unable to find DTD: "+DTD);
+                }
+                return stream != null ? new InputSource(stream) : null;
+            } else {
                 throw new SAXException("couldn't load external DTD '" + systemId + "'");
-        }
-
+            }
+        }
     }
 
Index: plications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/osm-tag-definitions.dtd
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/osm-tag-definitions.dtd	(revision 30487)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<!ELEMENT osm-tag-definitions (tag*)>
-<!ATTLIST osm-tag-definitions
-     version CDATA #FIXED '0.9'
-     xmlns:xs CDATA #FIXED 'http://www.w3.org/2001/XMLSchema-datatypes'
->
-<!ELEMENT tag (label*) >
-<!ATTLIST tag
-     key CDATA #REQUIRED
-     type CDATA #REQUIRED
-     for-way (yes|no) 'no' 
-     for-node (yes|no) 'no' 
-     for-relation (yes|no) 'no'
->
-<!ELEMENT label EMPTY>
-<!ATTLIST label
-     value CDATA #REQUIRED 
-     for-way (yes|no) 'no' 
-     for-node (yes|no) 'no' 
-     for-relation (yes|no) 'no'
->
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
 
@@ -46,15 +47,5 @@
         pnl.add(lbl);
         pnl.add(tfFilter,BorderLayout.CENTER);
-        JButton btn = new JButton(tr("Filter"));
-        pnl.add(btn);
-        btn.addActionListener(
-                new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        filter(tfFilter.getText());
-                    }
-
-                }
-        );
-        btn = new JButton(tr("Clear"));
+        JButton btn = new JButton(tr("Clear"));
         pnl.add(btn);
         btn.addActionListener(
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java	(revision 30488)
@@ -1,2 +1,3 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
 
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java	(revision 30487)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java	(revision 30488)
@@ -1,3 +1,5 @@
+// License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins.tageditor.tagspec.ui;
+
 import static org.openstreetmap.josm.tools.I18n.tr;
 
