Mercurial > hg > ConflictEditor
changeset 5:ad2b4949967e
group the conflicts list and the differences table in a split view
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 12 Sep 2011 15:50:00 +0200 |
parents | c396004a4e55 |
children | 001511e41f96 |
files | conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java |
diffstat | 1 files changed, 16 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Mon Sep 12 14:27:04 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Mon Sep 12 15:50:00 2011 +0200 @@ -11,6 +11,7 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.JTable; import javax.swing.JTextField; import javax.swing.table.TableModel; @@ -33,8 +34,7 @@ private void buildGui() { buildDatabaseUrlPanel(); - buildConflictsList(); - buildDifferencesTable(); + buildConflictsListAndDifferencesTable(); } private void buildDatabaseUrlPanel() @@ -52,12 +52,23 @@ getContentPane().add(databaseUrlPanel, BorderLayout.NORTH); } + private void buildConflictsListAndDifferencesTable() + { + buildConflictsList(); + buildDifferencesTable(); + + JScrollPane conflictsScrollPane = new JScrollPane(_conflictsList); + JScrollPane differencesScrollPane = new JScrollPane(_differencesTable); + + JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + splitPane.add(conflictsScrollPane); + splitPane.add(differencesScrollPane); + getContentPane().add(splitPane, BorderLayout.CENTER); + } + private void buildConflictsList() { _conflictsList = new JList(); - - JScrollPane scrollPane = new JScrollPane(_conflictsList); - getContentPane().add(scrollPane, BorderLayout.CENTER); } private void buildDifferencesTable() @@ -66,8 +77,6 @@ TableModel model = new DifferenceTableModel(); _differencesTable.setModel(model); - JScrollPane scrollPane = new JScrollPane(_differencesTable); - getContentPane().add(scrollPane, BorderLayout.SOUTH); } public String getDatabaseUrl()