# HG changeset patch # User Dirk Olmes # Date 1315895075 -7200 # Node ID e99bb691f7ce404e13dafc20b03b0ce025893c7c # Parent 18e126f0070bf6dff6574454f6d533b78ae8eeed add button panel diff -r 18e126f0070b -r e99bb691f7ce conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java --- a/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Tue Sep 13 04:10:29 2011 +0200 +++ b/conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java Tue Sep 13 08:24:35 2011 +0200 @@ -23,12 +23,17 @@ private JButton _findConflictsButton; private JList _conflictsList; private JTable _differencesTable; + private JButton _originalValueButton; + private JButton _conflictValueButton; + private JButton _previewButton; + private JButton _saveButton; public ConflictEditorFrame() throws HeadlessException { super(); + setLayout(new GridBagLayout()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setLayout(new GridBagLayout()); + setTitle("Conflict Editor"); createGui(); } @@ -36,6 +41,7 @@ { createDatabasePanel(); createConflictsListAndDifferencesTable(); + createButtonPanel(); } private void createDatabasePanel() @@ -128,6 +134,44 @@ getContentPane().add(splitPane, constraints); } + private void createButtonPanel() + { + JPanel buttonPanel = buildButtonPanel(); + addButtonPanel(buttonPanel); + } + + private JPanel buildButtonPanel() + { + JPanel buttonPanel = new JPanel(); + buttonPanel.setLayout(new FlowLayout()); + + _originalValueButton = new JButton("original"); + _originalValueButton.setEnabled(false); + buttonPanel.add(_originalValueButton); + + _conflictValueButton = new JButton("conflict"); + _conflictValueButton.setEnabled(false); + buttonPanel.add(_conflictValueButton); + + _previewButton = new JButton("preview"); + _previewButton.setEnabled(false); + buttonPanel.add(_previewButton); + + _saveButton = new JButton("save"); + _saveButton.setEnabled(false); + buttonPanel.add(_saveButton); + + return buttonPanel; + } + + private void addButtonPanel(JPanel buttonPanel) + { + GridBagConstraints constraints = new GridBagConstraints(); + constraints.gridx = 0; + constraints.gridy = 2; + getContentPane().add(buttonPanel, constraints); + } + public JTextField getDatabaseUrlTextField() { return _databaseUrlTextField;