From 65792e79770b7808542f483a6e8b0af320d55704 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Mon, 1 Aug 2005 16:44:14 -0700 Subject: [PATCH 1/1] Cleanud up some defaults and made slots accessable by name. darcs-hash:20050801234414-5417e-77cc383fe78efd13f58240aceed8effae0842959.gz --- src/mewa/mewa.lisp | 25 ++++++++++++++++--------- src/mewa/presentations.lisp | 3 ++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/mewa/mewa.lisp b/src/mewa/mewa.lisp index c6f14a3..7cdb073 100644 --- a/src/mewa/mewa.lisp +++ b/src/mewa/mewa.lisp @@ -169,6 +169,10 @@ attributes is an alist keyed on the attribute name." (modifications :accessor modifications :initform nil))) + + + + (defmethod attributes :around ((self mewa)) (let ((a (call-next-method))) (or a (funcall (attributes-getter self) self)))) @@ -251,12 +255,13 @@ attributes is an alist keyed on the attribute name." (cdr (assoc attribute (attribute-slot-map self)))) (defmethod initialize-slots ((self mewa)) - (when (use-instance-class-p self) - (setf (classes self) - (append (find-instance-classes self) - (classes self)))) - (setf (attribute-slot-map self) (find-slot-presentations self)) - (setf (slots self) (mapcar #'(lambda (x)(cdr x)) (attribute-slot-map self )))) + (when (instance self) + (when (use-instance-class-p self) + (setf (classes self) + (append (find-instance-classes self) + (classes self)))) + (setf (attribute-slot-map self) (find-slot-presentations self)) + (setf (slots self) (mapcar #'(lambda (x)(cdr x)) (attribute-slot-map self ))))) (defmethod make-presentation ((object t) &key (type :viewer) (initargs nil)) @@ -372,11 +377,13 @@ attributes is an alist keyed on the attribute name." '(mewa-object-presentation :global-properties (:editablep nil)) (find-attribute t :editor) '(mewa-object-presentation :global-properties (:editablep t)) + (find-attribute t :creator) + '(mewa-object-presentation :global-properties (:editablep t)) (find-attribute t :one-line) - '(mewa::mewa-one-line-presentation) + '(mewa-one-line-presentation) (find-attribute t :listing) - '(mewa::mewa-list-presentation :global-properties (:editablep nil) :editablep t) - (find-attribute t :search-presentation) + '(mewa-list-presentation :global-properties (:editablep nil) :editablep t) + (find-attribute t :search-model) '(mewa-object-presentation)) diff --git a/src/mewa/presentations.lisp b/src/mewa/presentations.lisp index 53942b1..62e93d1 100644 --- a/src/mewa/presentations.lisp +++ b/src/mewa/presentations.lisp @@ -12,7 +12,8 @@ (or (meta-model:list-keys (instance self)))) ;;;objects -(defcomponent mewa-object-presentation (mewa ucw:object-presentation) ()) +(defcomponent mewa-object-presentation (mewa ucw:object-presentation) + ((ucw::instance :accessor instance :initarg :instance :initform nil))) (defcomponent two-column-presentation (mewa-object-presentation) ()) -- 2.20.1