# HG changeset patch # User Dirk Olmes # Date 1315835400 -7200 # Node ID ad2b4949967eb801dd60102b1853fd91868da4f3 # Parent c396004a4e554253a8c3a4472ba99b71d6e26586 group the conflicts list and the differences table in a split view diff -r c396004a4e55 -r ad2b4949967e conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java --- 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()