-(defmethod attribute-editor :around (attribute)
- (flet ((find-editor-class (spec)
- (let ((class (getf spec :class))
- (type (getf spec :type)))
- (or class (when (and type (symbolp type))
- (intern (format nil "~A-~A" type 'attribute-editor)))
- 'string-attribute-editor))))
- (let ((editor? (call-next-method)))
- (if (listp editor?)
- (setf (attribute-editor attribute)
- (apply #'make-instance (find-editor-class editor?)
- editor?))
- (call-next-method)))))
-
+(define-layered-method attribute-setter (object)
+ nil)
+
+(defmethod shared-initialize :after ((object standard-attribute)
+ slots &rest args &key input &allow-other-keys)
+
+ (when input
+ (setf (attribute-editor object)
+ (apply #'make-instance (find-editor-class input)
+ input))))
+
+
+(defun find-editor-class (spec)
+ (let ((class (getf spec :class))
+ (type (getf spec :type)))
+ (or class (when
+ (and type (symbolp type))
+ (let ((name (format nil "~A-~A" type 'attribute-editor)))
+ (or (unless (eq (find-package :cl)
+ (symbol-package type))
+ (find-class (intern name (symbol-package type)) nil))
+ (find-class (intern name) nil)
+ (find-class (intern name :lol) nil)
+ 'string-attribute-editor))))))