1 (in-package :lisp-on-lines
)
3 ;;;; The Standard Layers
7 (define-layered-method label
(anything)
11 :in-layer editor
:around
(description object
)
12 "It is useful to remove the viewer layer when in the editing layer.
13 This allows us to dispatch to a subclasses editor."
14 (with-inactive-layers (viewer)
17 ;;;; These layers affect the layout of the object
23 :in-layer as-string
(d o
)
24 (with-inactive-layers (editor viewer one-line as-table show-attribute-labels
)
26 (display-attribute a o
)
29 (defmethod list-slots (thing)
32 ;;;; * Object displays.
36 ;;;; TODO: all lisp types should have occurences and attributes defined for them.
38 (defdisplay ((description t
) lisp-value
)
39 (<:as-html lisp-value
))
41 (defdisplay (description (object string
))
44 (defdisplay (description (object symbol
))
47 (defdisplay (description object
(component t
))
48 "The default display for CLOS objects"
49 (print (class-name (class-of object
)))
50 (dolist* (slot-name (list-slots object
))
52 (let ((boundp (slot-boundp object slot-name
)))
53 (format t
"~A~A : ~A" (strcat slot-name
)
58 (slot-value object slot-name
) "")))))
60 (defdisplay ((description t
) object
)
61 "The default display for CLOS objects in UCW components"
62 (dolist* (slot-name (list-slots object
))
64 (let ((boundp (slot-boundp object slot-name
)))
65 (<:label
:class
"lol-label"
66 (display-attribute 'label
(strcat slot-name
))
72 (slot-value object slot-name
) "")))))
74 ;;;; ** The default displays for objects with a MEWA occurence
76 (defdisplay (description object
)
79 (when (label description
)
82 (<:as-html
(label description
))))
83 (do-attributes (attribute description
)
86 (display-attribute attribute object
)))))
90 :in-layer one-line
(description object
)
91 "The one line presentation just displays the attributes with a #\Space between them"
92 (do-attributes (attribute description
)
93 (display-attribute attribute object
)
98 (defdisplay :in-layer as-table
(description object
)
100 (do-attributes (a description
)
102 (<:td
:class
"lol-label" (<:as-html
(label a
)))
103 (<:td
(display-attribute a object
))))))
107 (deflayer list-display-layer
)
109 (define-layered-class description
110 :in-layer list-display-layer
()
111 ((list-item :initarg
:list-item
:initform nil
:special t
:accessor list-item
)))
113 (defdisplay (desc (list list
))
114 (with-active-layers (list-display-layer)
117 (<:li
(apply #'display
* item
(list-item desc
)))))))
122 ((attribute standard-attribute
) object
)
125 (define-layered-method display-using-description
126 ((attribute standard-attribute
) object component
)
127 (with-component (component)
128 (<ucw
:a
:action
(call 'info-message
:message
(strcat (symbol-package (description.type attribute
))":/::" (description.type attribute
)))
130 (<:as-html
(attribute-value object attribute
)))