remove unused comment... this is why we don't comment.
[clinton/lisp-on-lines.git] / src / standard-display.lisp
index 0fe6df5..35d57e1 100644 (file)
@@ -10,7 +10,8 @@
 (defdisplay
     :in-layer editor :around (description object)
   "It is useful to remove the viewer layer when in the editing layer.
-This allows us to dispatch to a subclasses editor."
+This allows us to dispatch to a subclasses editor.
+"
   (with-inactive-layers (viewer)
     (call-next-method)))
 
@@ -41,6 +42,9 @@ This allows us to dispatch to a subclasses editor."
 (defdisplay (description (object string))
   (<:as-html object))
 
+(defdisplay (description (object symbol))
+  (<:as-html object))
+
 (defdisplay (description object (component t))
   "The default display for CLOS objects"
   (print (class-name (class-of object)))
@@ -105,7 +109,11 @@ This allows us to dispatch to a subclasses editor."
 
 (define-layered-class description
   :in-layer list-display-layer ()
-  ((list-item :initarg :list-item :initform nil :special t :accessor list-item)))
+  ((list-item :initarg :list-item
+             :initarg :table-item
+             :initform nil
+             :special t
+             :accessor list-item)))
 
 (defdisplay (desc (list list))
  (with-active-layers (list-display-layer)
@@ -113,6 +121,23 @@ This allows us to dispatch to a subclasses editor."
     (dolist* (item list)
       (<:li  (apply #'display* item (list-item desc)))))))
 
+(defdisplay :in-layer as-table (description (list list))
+  (with-active-layers (list-display-layer)
+    (let ((item-description (find-occurence (first list))))
+      (<:table
+       (funcall
+        (apply #'lol::make-display-function self (first list)
+               (list-item description))
+        (lambda (desc item component)
+          (<:tr
+           (do-attributes (a desc)
+             (<:th (<:as-html (label a)))))
+          
+          (dolist* (obj list)
+            (<:tr 
+             (do-attributes (a desc)
+               (<:td (display-attribute a obj)))))))))))
+
 ;;;; Attributes 
 (defdisplay
     :in-layer editor