Class LOGIN Generic login (input username and password) component.
(defgeneric check-credentials (login) (:documentation "Returns T if LOGIN is valid."))
(defaction login-successful ((l login)) (answer t))
(defaction try-login ((l login)) (if (check-credentials l) (login-successful l) (setf (login.message l) "Bad username/password.")))
Class ERROR-MESSAGE Generic component for showing server side error messages.
Class ERROR-COMPONENT Generic component for showing server side error conditions.
Class INFO-MESSAGE Component for showing a message to the user.
Class OPTION-DIALOG Component for querying the user.
(defaction respond ((dialog option-dialog) value) (if (confirm dialog) (if (call 'option-dialog :message (format nil "Are you sure you want to answer ~S to the question ~S?" (cdr (assoc value (options dialog))) (message dialog)) :options '((t . "Yes") (nil . "No"))) (answer value) ;; repeat the question nil) (answer value)))
Class RANGE-VIEW Component for showing the user a set of data one "window" at a time.
Method (RANGE-VIEW.HAVE-PREVIOUS-P RANGE-VIEW) Returns true if VIEW has a window before the current one.
Method (RANGE-VIEW.HAVE-NEXT-P RANGE-VIEW) Returns true if VIEW has a window after the current one.
(defgeneric render-range-view-item (response range-view item) (:documentation "Render a single element of a range-view.") (:method ((response response) (range-view range-view) (item t)) "Standard implementaion of RENDER-RANGE-VIEW-ITEM. Simply applies ITEM to princ (via <:as-html)." (declare (ignore response range-view)) (<:as-html item)))
(defaction scroll-start ((range range-view)) (setf (range-view.offset range) 0))
(defaction scroll-end ((range range-view)) (setf (range-view.offset range) (1- (length (range-view.windows range)))))
(defaction scroll-forward ((view range-view) &optional (n 1)) (with-slots (offset windows) view (incf offset n) (when (<= (length windows) offset) (scroll-end view))))
(defaction scroll-backward ((range range-view) &optional (n 1)) (with-slots (offset) range (decf offset n) (when (minusp offset) (setf offset 0))))
(defaction scroll-to-page ((range range-view) window-number) (setf (range-view.offset range) window-number))
Class REDIRECT-COMPONENT Send a client redirect.
Class TABBED-PANE Component for providing the user with a standard "tabbed pane" GUI widget.
Class TASK-COMPONENT A controller for a single task or operation to be performed by the user.
(defgeneric/cc start (task) (:documentation "action which gets called automatically when task-component is active. Use defaction to define your own \"start\" action"))
Class UCW-INSPECTOR Component for inspecting random lisp values.
(defaction call-action ((inspector ucw-inspector) action) "Call an inspector action." (funcall action))
(defaction call-inspector ((component component) datum) "Call an inspector for DATUM on the component COMPONENT." (call 'ucw-inspector :datum datum))