add more files for new description code
[clinton/lisp-on-lines.git] / src / mao / display / display-attribute.lisp
1 (in-package :lisp-on-lines)
2
3 (define-layered-class display-attribute (standard-attribute)
4 ((label
5 :layered-accessor attribute-label
6 :initarg :label
7 :initform nil
8 :layered t
9 :special t)
10 (label-formatter
11 :layered-accessor attribute-label-formatter
12 :initarg :label-formatter
13 :initform nil
14 :layered t
15 :special t)
16 (value-formatter
17 :layered-accessor attribute-value-formatter
18 :initarg :value-formatter
19 :initform nil
20 :layered t
21 :special t)
22
23 ))
24
25 (define-layered-method attribute-label-formatter :around (attribute)
26 (or (slot-value attribute 'label-formatter)
27 (attribute-value (find-attribute (attribute-description attribute) 'label-formatter))
28 (error "No Formatter .. fool!")))
29
30 (define-layered-method attribute-value-formatter :around (attribute)
31
32 (or (slot-value attribute 'value-formatter)
33 (attribute-value (find-attribute (attribute-description attribute) 'value-formatter))
34 (error "No Formatter .. fool!")))