X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fjp%2Fymir%2FtaskReporter%2Fui%2FTaskEditor.scala;h=c0761df108636481664315779892a12c233802e8;hb=fc149e355937c9206e3a3c388b182ee5a1b81205;hp=95a3a6777cd0827f88803516167db2441005c60a;hpb=f6a51dbcc510104994344140fccdeaab459eb570;p=task-reporter.git diff --git a/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala b/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala index 95a3a67..c0761df 100644 --- a/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala +++ b/src/main/scala/jp/ymir/taskReporter/ui/TaskEditor.scala @@ -1,50 +1,115 @@ package jp.ymir.taskReporter.ui import com.toedter.calendar._ import java.awt.Insets +import jp.ymir.taskReporter.core._ import scala.swing._ class TaskEditor extends GridBagPanel { import GridBagPanel.Anchor._ import GridBagPanel.Fill._ - val commonInsets = new Insets(2, 3, 2, 3) + private val commonInsets = new Insets(2, 3, 2, 3) + val date = Component.wrap(new JDateChooser() { + setDateFormatString("yyyy-MM-dd") + getJCalendar().setTodayButtonVisible(true) + getJCalendar().setWeekOfYearVisible(false) + }) add( new Label("報告日"), - new Constraints() { gridx = 0; gridy = 0 }) + new Constraints { gridx = 0; gridy = 0 }) add( - Component.wrap(new JDateChooser() { - setDateFormatString("yyyy-MM-dd") - getJCalendar().setTodayButtonVisible(true) - getJCalendar().setWeekOfYearVisible(false) - }), + date, new Constraints() { gridx = 1; gridy = 0; anchor = West ipadx = 3; ipady = 3; insets = commonInsets }) + date.minimumSize = date.preferredSize + val ticketID = new TextField(6) { + val isDigit = (c : Char) => c >= '0' && c <= '9' + inputVerifier = _ => wrapString(text).forall(isDigit) + peer.setMargin(commonInsets) + } add( new Label("チケットID"), - new Constraints() { gridx = 0; gridy = 1 }) + new Constraints { gridx = 0; gridy = 1 }) add( - new TextField(6) { - val isDigit = (c : Char) => c >= '0' && c <= '9' - inputVerifier = _ => wrapString(text).forall(isDigit) - peer.setMargin(commonInsets) - }, + ticketID, new Constraints() { gridx = 1; gridy = 1; anchor = West; insets = commonInsets }) + ticketID.minimumSize = ticketID.preferredSize + val title = new TextField() { + peer.setMargin(commonInsets) + } add( new Label("作業名"), - new Constraints() { gridx = 0; gridy = 2 }) + new Constraints { gridx = 0; gridy = 2 }) add( - new TextField() { - peer.setMargin(commonInsets) - }, + title, new Constraints() { gridx = 1; gridy = 2; fill = Horizontal; weightx = 1.0 insets = commonInsets }) + + val expectedCompletionDate = Component.wrap(new JDateChooser() { + setDateFormatString("yyyy-MM-dd") + getJCalendar().setTodayButtonVisible(true) + getJCalendar().setWeekOfYearVisible(false) + }) + add( + new Label("作業完了予定年月日"), + new Constraints { gridx = 0; gridy = 3 }) + add( + expectedCompletionDate, + new Constraints() { + gridx = 1; gridy = 3; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + expectedCompletionDate.minimumSize = expectedCompletionDate.preferredSize + + val deadline = Component.wrap(new JDateChooser() { + setDateFormatString("yyyy-MM-dd") + getJCalendar().setTodayButtonVisible(true) + getJCalendar().setNullDateButtonVisible(true) + getJCalendar().setWeekOfYearVisible(false) + }) + add( + new Label("タスク期限"), + new Constraints { gridx = 0; gridy = 4 }) + add( + deadline, + new Constraints() { + gridx = 1; gridy = 4; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + deadline.minimumSize = deadline.preferredSize + + val status = new ComboBox[Task.Status](Task.Status.all) + add( + new Label("状態"), + new Constraints { gridx = 0; gridy = 5 }) + add( + status, + new Constraints { + gridx = 1; gridy = 5; anchor = West + ipadx = 3; ipady = 3; insets = commonInsets + }) + + val description = new ScrollPane(new TextArea() { + rows = 5 + peer.setMargin(commonInsets) + }) + add( + new Label("説明"), + new Constraints { gridx = 0; gridy = 6 }) + add( + description, + new Constraints() { + gridx = 1; gridy = 6; fill = Horizontal; weightx = 1.0 + insets = commonInsets + }) + description.minimumSize = description.preferredSize }