Mercurial > hg > ConflictEditor
changeset 13:e99bb691f7ce
add button panel
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 13 Sep 2011 08:24:35 +0200 |
parents | 18e126f0070b |
children | f2daf738299f |
files | conflict-editor/src/main/java/de/codedo/conflicteditor/gui/ConflictEditorFrame.java |
diffstat | 1 files changed, 45 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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;