       :char-start 0 :char-end 1
       :message \"Dynamically created, how cool is that?\"})"
   [resource marker-map]
+  #_(e/info-dialog "ccw.api.markers" (str "create-marker! " resource ", " marker-map))
   (let [type-id (eclipse-type-id (:type-id marker-map))
         attrs (java.util.HashMap.)]
-     (doseq [[k v] (dissoc marker-map :type-id)]
-       (let [f (keyword-to-attr-key k)]
-         (f attrs v)))
+     (doseq [[k v] (dissoc marker-map :type-id)
+             :let [f (keyword-to-attr-key k)]]
+       (f attrs v))
+     #_(e/info-dialog "markers" (str "type id:" type-id))
+     #_(e/info-dialog "markers" (str "attrs:" (str attrs)))
      (MarkerUtilities/createMarker
        (e/resource resource)
        attrs
        type-id)))
+
+(defn marker-map
+  "Retrieves the marker map from an eclipse marker."
+  [marker]
+  (let [m {:type-id (MarkerUtilities/getMarkerType marker)}
+        attrs (.getAttributes marker)]
+    (into m (map (fn [[k v]] ((attr-key-to-keyword k) v)) attrs))))
+
+(defn marker-into!
+  "Adds all attributes in attrs-map to the eclipse marker.
+   It's not possible to change the type id. If it is set, it will be ignored
+   Returns the eclipse marker."
+  [marker attrs-map]
+  (let [attrs (java.util.HashMap.)]
+     (doseq [[k v] (dissoc attrs-map :type-id)
+             :let [f (keyword-to-attr-key k)]]
+       (f attrs v))
+     (doto marker
+       (.setAttributes (into-array String (keys attrs)) (into-array Object (vals attrs))))))
 
 (defn delete-markers!
   "Delete markers for the resource.

  {:error   IMarker/SEVERITY_ERROR
   :warning IMarker/SEVERITY_WARNING
   :info    IMarker/SEVERITY_INFO})

(def keyword-to-attr-key
  "Standard marker attributes recoginzed by Eclipse.

   :char-end    (fn [m v] (MarkerUtilities/setCharEnd m v))
   :message     (fn [m v] (MarkerUtilities/setMessage m v))
   :severity    (fn [m v] (.put m IMarker/SEVERITY (severity v v)))})

(def attr-key-to-keyword
  "Standard marker attributes recoginzed by Eclipse.
   :line-number is mutually exclusive with :char-start + :char-end
   :line-number considers first line number is 1
   :char-start / :char-end consider first char is at index 0
   :message must be a string
   :severity must be a keyword from the severity map keys, or a String"
  {IMarker/LINE_NUMBER (fn [v] [:line-number v])
   IMarker/CHAR_START  (fn [v] [:char-start v])
   IMarker/CHAR_END    (fn [v] [:char-end v])
   IMarker/MESSAGE     (fn [v] [:message v])
   IMarker/SEVERITY    (fn [v] [:severity (severity-invert v v)])})

(def ^:private type-ids
  "Map containing standard eclipse marker types, as well as those provided
