+ def task_=(t: Task) = {
+ ticketID.text = t.ticketID.fold("")(_.toString)
+ title.text = t.title
+ expectedCompletionDate.calendar = Some(t.expectedCompletionDate)
+ deadline.calendar = t.deadline
+ status.selection.item = t.status
+ description.text = t.description.getOrElse("")
+ }
+
+ private val commonInsets = new Insets(2, 3, 2, 3)
+
+ private def noneIfEmpty[T <% StringLike[_]](str: T): Option[T] = str match {
+ case "" => None
+ case _ => Some(str)
+ }
+
+ private val ticketID = new TextField(6) {
+ def isDigit(c : Char) = c >= '0' && c <= '9'
+ inputVerifier = _ => wrapString(text).forall(isDigit)
+ horizontalAlignment = Alignment.Right
+ peer.setMargin(commonInsets)
+ }