1 56 package org.objectstyle.cayenne.modeler.dialog.pref; 57 58 import java.awt.BorderLayout ; 59 import java.awt.CardLayout ; 60 import java.awt.Container ; 61 import java.awt.FlowLayout ; 62 63 import javax.swing.JButton ; 64 import javax.swing.JDialog ; 65 import javax.swing.JList ; 66 import javax.swing.JPanel ; 67 import javax.swing.JScrollPane ; 68 import javax.swing.JSplitPane ; 69 70 73 public class PreferenceDialogView extends JDialog { 74 75 protected JSplitPane split; 76 protected JList list; 77 protected CardLayout detailLayout; 78 protected Container detailPanel; 79 protected JButton cancelButton; 80 protected JButton saveButton; 81 82 public PreferenceDialogView() { 83 this.split = new JSplitPane (JSplitPane.HORIZONTAL_SPLIT); 84 this.list = new JList (); 85 this.detailLayout = new CardLayout (); 86 this.detailPanel = new JPanel (detailLayout); 87 this.saveButton = new JButton ("Save"); 88 this.cancelButton = new JButton ("Cancel"); 89 90 92 Container leftContainer = new JPanel (new BorderLayout ()); 93 leftContainer.add(new JScrollPane (list)); 94 95 JPanel buttons = new JPanel (new FlowLayout (FlowLayout.RIGHT)); 96 buttons.add(cancelButton); 97 buttons.add(saveButton); 98 99 Container rightContainer = new JPanel (new BorderLayout ()); 100 rightContainer.add(detailPanel, BorderLayout.CENTER); 101 rightContainer.add(buttons, BorderLayout.SOUTH); 102 103 split.setLeftComponent(leftContainer); 104 split.setRightComponent(rightContainer); 105 106 getContentPane().setLayout(new BorderLayout ()); 107 getContentPane().add(split, BorderLayout.CENTER); 108 setTitle("Edit Preferences"); 109 } 110 111 public JList getList() { 112 return list; 113 } 114 115 public JSplitPane getSplit() { 116 return split; 117 } 118 119 public Container getDetailPanel() { 120 return detailPanel; 121 } 122 123 public CardLayout getDetailLayout() { 124 return detailLayout; 125 } 126 127 public JButton getCancelButton() { 128 return cancelButton; 129 } 130 131 public JButton getSaveButton() { 132 return saveButton; 133 } 134 } | Popular Tags |