X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=task-reporter.git;a=blobdiff_plain;f=src%2Fmain%2Fscala%2Fjp%2Fymir%2FtaskReporter%2Fui%2FMainFrame.scala;fp=src%2Fmain%2Fscala%2Fjp%2Fymir%2FtaskReporter%2Fui%2FMainFrame.scala;h=1807a064d3535292c20dee4fb8493d57b2492022;hp=94897af964a7dd3920c1286603d7eca46034705f;hb=100ec0110d33876011bbd191da7e614445b627a5;hpb=79bcb816daaaa042ec7f1855c8307d9143f61956 diff --git a/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala b/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala index 94897af..1807a06 100644 --- a/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala +++ b/src/main/scala/jp/ymir/taskReporter/ui/MainFrame.scala @@ -44,6 +44,7 @@ class MainFrame(reportFile: Option[File]) extends Frame { if (r == FileChooser.Result.Approve) { Preferences.lastChosenDir() = chooser.selectedFile.getParentFile reportSet.load(chooser.selectedFile) + // FIXME: select the last report } } }) @@ -78,26 +79,53 @@ class MainFrame(reportFile: Option[File]) extends Frame { } } - val rootSplit = new SplitPane { + contents = new SplitPane { peer.setOrientation(JSplitPane.HORIZONTAL_SPLIT) continuousLayout = true oneTouchExpandable = true - resizeWeight = 0.3 + resizeWeight = 0 // Let the left pane be fixed + + rightComponent = new SplitPane { + peer.setOrientation(JSplitPane.VERTICAL_SPLIT) + continuousLayout = true + oneTouchExpandable = true + resizeWeight = 0.5 + + leftComponent = new ScrollPane( + new Table() { + peer.setModel(new Report()) // Empty report + }) + } leftComponent = new BorderPanel { border = BorderFactory.createEmptyBorder(5, 5, 5, 5) - val scroll = new ScrollPane( + val reportsScroll = new ScrollPane( new Table() { peer.setModel(reportSet) + if (rowCount > 0) { + selection.rows += rowCount - 1 // Select the last report + } + selection.reactions += { + case TableRowsSelected(_, _, false) => + // FIXME + } }) - layout(scroll) = BorderPanel.Position.Center + layout(reportsScroll) = BorderPanel.Position.Center + + val buttons = new FlowPanel(FlowPanel.Alignment.Left)() { + contents += new Button(new Action("Add") { + def apply = {} // FIXME + }) + contents += new Button(new Action("Delete...") { + def apply = {} // FIXME + }) + } + layout(buttons) = BorderPanel.Position.South + + preferredSize = minimumSize } } - contents = rootSplit - - // This can only be done after putting the pane on the frame. - rootSplit.dividerLocation = 0.3 centerOnScreen visible = true