1 package jp.ymir.taskReporter.ui
2 import com.toedter.calendar._
6 class TaskEditor extends GridBagPanel {
7 import GridBagPanel.Anchor._
8 import GridBagPanel.Fill._
10 val commonInsets = new Insets(2, 3, 2, 3)
14 new Constraints() { gridx = 0; gridy = 0 })
16 Component.wrap(new JDateChooser() {
17 setDateFormatString("yyyy-MM-dd")
18 getJCalendar().setTodayButtonVisible(true)
19 getJCalendar().setWeekOfYearVisible(false)
22 gridx = 1; gridy = 0; anchor = West
23 ipadx = 3; ipady = 3; insets = commonInsets
28 new Constraints() { gridx = 0; gridy = 1 })
31 val isDigit = (c : Char) => c >= '0' && c <= '9'
32 inputVerifier = _ => wrapString(text).forall(isDigit)
33 peer.setMargin(commonInsets)
36 gridx = 1; gridy = 1; anchor = West; insets = commonInsets
41 new Constraints() { gridx = 0; gridy = 2 })
44 peer.setMargin(commonInsets)
47 gridx = 1; gridy = 2; fill = Horizontal; weightx = 1.0