1 package jp.ymir.taskReporter.ui
2 import com.toedter.calendar._
4 import jp.ymir.taskReporter.core._
7 class TaskEditor extends GridBagPanel {
8 import GridBagPanel.Anchor._
9 import GridBagPanel.Fill._
11 val commonInsets = new Insets(2, 3, 2, 3)
15 new Constraints { gridx = 0; gridy = 0 })
17 Component.wrap(new JDateChooser() {
18 setDateFormatString("yyyy-MM-dd")
19 getJCalendar().setTodayButtonVisible(true)
20 getJCalendar().setWeekOfYearVisible(false)
23 gridx = 1; gridy = 0; anchor = West
24 ipadx = 3; ipady = 3; insets = commonInsets
29 new Constraints { gridx = 0; gridy = 1 })
32 val isDigit = (c : Char) => c >= '0' && c <= '9'
33 inputVerifier = _ => wrapString(text).forall(isDigit)
34 peer.setMargin(commonInsets)
37 gridx = 1; gridy = 1; anchor = West; insets = commonInsets
42 new Constraints { gridx = 0; gridy = 2 })
45 peer.setMargin(commonInsets)
48 gridx = 1; gridy = 2; fill = Horizontal; weightx = 1.0
53 new Label("作業完了予定年月日"),
54 new Constraints { gridx = 0; gridy = 3 })
56 Component.wrap(new JDateChooser() {
57 setDateFormatString("yyyy-MM-dd")
58 getJCalendar().setTodayButtonVisible(true)
59 getJCalendar().setWeekOfYearVisible(false)
62 gridx = 1; gridy = 3; anchor = West
63 ipadx = 3; ipady = 3; insets = commonInsets
68 new Constraints { gridx = 0; gridy = 4 })
70 Component.wrap(new JDateChooser() {
71 setDateFormatString("yyyy-MM-dd")
72 getJCalendar().setTodayButtonVisible(true)
73 getJCalendar().setNullDateButtonVisible(true)
74 getJCalendar().setWeekOfYearVisible(false)
77 gridx = 1; gridy = 4; anchor = West
78 ipadx = 3; ipady = 3; insets = commonInsets
83 new Constraints { gridx = 0; gridy = 5 })
85 new ComboBox[Task.Status](Task.Status.all),
87 gridx = 1; gridy = 5; anchor = West
88 ipadx = 3; ipady = 3; insets = commonInsets
93 new Constraints { gridx = 0; gridy = 6 })
98 peer.setMargin(commonInsets)
101 gridx = 1; gridy = 6; fill = Horizontal; weightx = 1.0
102 insets = commonInsets