| | |
| | | |
| | | import javax.swing.Box; |
| | | import javax.swing.ButtonGroup; |
| | | import javax.swing.DefaultComboBoxModel; |
| | | import javax.swing.JButton; |
| | | import javax.swing.JComboBox; |
| | | import javax.swing.JLabel; |
| | | import javax.swing.JPanel; |
| | | import javax.swing.JRadioButton; |
| | |
| | | import org.opends.quicksetup.ui.QuickSetupStepPanel; |
| | | import org.opends.quicksetup.ui.UIFactory; |
| | | import org.opends.quicksetup.ui.Utilities; |
| | | import org.opends.server.tools.BackendTypeHelper; |
| | | |
| | | /** |
| | | * This is the panel that contains the Data Options: the suffix dn, whether to |
| | |
| | | |
| | | private JButton ldifBrowseButton; |
| | | |
| | | private JComboBox backendTypeComboBox; |
| | | |
| | | /** |
| | | * Constructor of the panel. |
| | | * |
| | |
| | | super(application); |
| | | this.defaultUserData = application.getUserData(); |
| | | populateComponentMaps(); |
| | | createBackendTypeComboBox(); |
| | | addDocumentListeners(); |
| | | addFocusListeners(); |
| | | addActionListeners(); |
| | |
| | | return type; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (FieldName.BACKEND_TYPE == fieldName) |
| | | { |
| | | return backendTypeComboBox.getSelectedItem().toString(); |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | GridBagConstraints gbc = new GridBagConstraints(); |
| | | // Add the server location widgets |
| | | addBackendTypeSection(panel, gbc); |
| | | addBaseDNSection(panel, gbc); |
| | | |
| | | int h1 = getLabel(FieldName.DATA_OPTIONS).getPreferredSize().height; |
| | |
| | | return panel; |
| | | } |
| | | |
| | | private void addBaseDNSection(final JPanel panel, final GridBagConstraints gbc) |
| | | private void addBackendTypeSection(final JPanel panel, final GridBagConstraints gbc) |
| | | { |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | gbc.weightx = 0.0; |
| | | gbc.insets.top = 0; |
| | | gbc.insets.left = 0; |
| | | gbc.anchor = GridBagConstraints.WEST; |
| | | panel.add(getLabel(FieldName.DIRECTORY_BASE_DN), gbc); |
| | | panel.add(getLabel(FieldName.BACKEND_TYPE), gbc); |
| | | |
| | | JPanel auxPanel = new JPanel(new GridBagLayout()); |
| | | auxPanel.setOpaque(false); |
| | |
| | | gbc.insets = UIFactory.getEmptyInsets(); |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | | gbc.weightx = 0.0; |
| | | auxPanel.add(getField(FieldName.DIRECTORY_BASE_DN), gbc); |
| | | auxPanel.add(backendTypeComboBox, gbc); |
| | | |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | gbc.insets.left = UIFactory.LEFT_INSET_BROWSE; |
| | |
| | | gbc.insets.left = UIFactory.LEFT_INSET_PRIMARY_FIELD; |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | panel.add(auxPanel, gbc); |
| | | } |
| | | |
| | | private void addBaseDNSection(final JPanel panel, final GridBagConstraints gbc) |
| | | { |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | gbc.weightx = 0.0; |
| | | gbc.insets.top = UIFactory.TOP_INSET_PRIMARY_FIELD; |
| | | gbc.insets.left = 0; |
| | | gbc.anchor = GridBagConstraints.WEST; |
| | | panel.add(getLabel(FieldName.DIRECTORY_BASE_DN), gbc); |
| | | |
| | | final JPanel auxPanel = new JPanel(new GridBagLayout()); |
| | | auxPanel.setOpaque(false); |
| | | gbc.weightx = 1.0; |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | | gbc.insets.top = UIFactory.TOP_INSET_PRIMARY_FIELD; |
| | | gbc.insets.left = UIFactory.LEFT_INSET_PRIMARY_FIELD; |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | panel.add(auxPanel, gbc); |
| | | |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | gbc.insets = UIFactory.getEmptyInsets(); |
| | | gbc.weightx = 0.0; |
| | | auxPanel.add(getField(FieldName.DIRECTORY_BASE_DN), gbc); |
| | | |
| | | gbc.gridwidth = GridBagConstraints.REMAINDER; |
| | | gbc.weightx = 1.0; |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | | auxPanel.add(Box.createHorizontalGlue(), gbc); |
| | | |
| | | gbc.gridwidth = GridBagConstraints.RELATIVE; |
| | | gbc.weightx = 0.0; |
| | |
| | | final JLabel dataLabel = UIFactory.makeJLabel(UIFactory.IconType.NO_ICON, INFO_DIRECTORY_DATA_LABEL.get(), |
| | | UIFactory.TextStyle.PRIMARY_FIELD_VALID); |
| | | hmLabels.put(FieldName.DATA_OPTIONS, dataLabel); |
| | | |
| | | final JLabel backendTypeLabel = UIFactory.makeJLabel(UIFactory.IconType.NO_ICON, INFO_BACKEND_TYPE_LABEL.get(), |
| | | UIFactory.TextStyle.PRIMARY_FIELD_VALID); |
| | | hmLabels.put(FieldName.BACKEND_TYPE, backendTypeLabel); |
| | | createDirectoryDataChoiceRadioButton(dataLabel); |
| | | checkEnablingState(); |
| | | } |
| | | |
| | | private void createBackendTypeComboBox() |
| | | { |
| | | final BackendTypeHelper backendTypeHelper = new BackendTypeHelper(); |
| | | backendTypeComboBox = new JComboBox(new DefaultComboBoxModel(backendTypeHelper.getBackendTypeNames().toArray())); |
| | | } |
| | | |
| | | private void createDirectoryDataChoiceRadioButton(final JLabel dataLabel) |
| | | { |
| | | final JRadioButton createBaseEntryRB = UIFactory.makeJRadioButton( |