protected Component buildMainPanel() {
   JList list = SwingComponentFactory.buildList(this.primaryKeysModel);
   list.setSelectionModel(this.primaryKeysSelectionModel);
   list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   list.setCellRenderer(this.buildListCellRenderer());
   list.addMouseListener(buildListMouseListener());
   return new JScrollPane(list);
 }
  private JTable buildTable() {
    JTable table = SwingComponentFactory.buildTable(tableModel, rowSelectionModel);
    int rowHeight = 20; // start with minimum of 20

    table.setRowHeight(rowHeight);

    return table;
  }
    private JTable buildValuePairsTable() {
      CollectionValueModel valuePairsHolder = buildValuePairsHolder();
      JTable table =
          SwingComponentFactory.buildTable(
              this.buildValuePairsTableModel(valuePairsHolder),
              this.buildValuePairsSelectionModel(valuePairsHolder));

      this.addPropertyChangeListener(
          "enabled" /* stupid hard-coded property name */, this.buildTableEnabler(table));

      return table;
    }
  protected Component buildPage() {
    JTable table = SwingComponentFactory.buildTable(this.tableModel);

    TableColumn javaTypeColumn =
        table.getColumnModel().getColumn(MappingColumnAdapter.JAVA_TYPE_COLUMN);
    javaTypeColumn.setCellRenderer(this.buildJavaTypeRenderer());

    TableColumn jdbcTypeColumn =
        table.getColumnModel().getColumn(MappingColumnAdapter.JDBC_TYPE_COLUMN);
    jdbcTypeColumn.setCellRenderer(this.buildJDBCTypeRenderer());

    return table;
  }
    protected Component buildPage() {
      JList listBox = SwingComponentFactory.buildList(this.buildSelectedNodesListModel());
      listBox.setBorder(BorderFactory.createEmptyBorder());
      listBox.setCellRenderer(new DisplayableListCellRenderer());

      listBox.setBackground(UIManager.getColor("Panel.background"));
      listBox.setForeground(UIManager.getColor("List.foreground"));
      listBox.setSelectionBackground(UIManager.getColor("ScrollPane.background"));
      listBox.setSelectionForeground(listBox.getForeground());

      JScrollPane scrollPane = new JScrollPane(listBox);
      scrollPane.setBorder(new EmptyBorder(5, 0, 0, 0));
      scrollPane.getVerticalScrollBar().setUnitIncrement(10);
      scrollPane.setViewportBorder(BorderFactory.createEmptyBorder());

      return scrollPane;
    }
  private JTable buildTable() {
    JTable table = SwingComponentFactory.buildTable(tableModel, rowSelectionModel);
    int rowHeight = 20; // start with minimum of 20

    // Name column
    TableColumn column =
        table.getColumnModel().getColumn(InsertFieldColumnAdapter.INSERT_FIELD_COLUMN);
    TableCellRenderer fieldRenderer = this.buildFieldColumnCellRenderer();
    column.setCellRenderer(fieldRenderer);

    // Return-only column (check box)
    column = table.getColumnModel().getColumn(InsertFieldColumnAdapter.RETURN_ONLY_COLUMN);
    CheckBoxTableCellRenderer returnOnlyRenderer = new CheckBoxTableCellRenderer();
    column.setCellRenderer(returnOnlyRenderer);
    column.setCellEditor(new TableCellEditorAdapter(new CheckBoxTableCellRenderer()));
    rowHeight = Math.max(rowHeight, returnOnlyRenderer.getPreferredHeight());

    table.setRowHeight(rowHeight);

    return table;
  }
  private JTable buildFieldPairsTable() {
    ListValueModel listValue = this.buildFieldPairsValue();
    TableModel tableModel = this.buildFieldPairsTableModel(listValue);
    this.fieldPairsSelectionModel = this.buildFieldPairSelectionModel(listValue);

    JTable table = SwingComponentFactory.buildTable(tableModel, this.fieldPairsSelectionModel);

    TableColumn column;

    // source field column
    column = table.getColumnModel().getColumn(FieldPairsTableColumnAdapter.SOURCE_XPATH_COLUMN);
    column.setCellRenderer(this.buildXpathColumnCellRenderer());

    // target field column
    column = table.getColumnModel().getColumn(FieldPairsTableColumnAdapter.TARGET_XPATH_COLUMN);
    column.setCellRenderer(this.buildXpathColumnCellRenderer());

    this.addPropertyChangeListener(
        "enabled" /* stupid hard-coded property name */, this.buildTableEnabler(table));

    return table;
  }
  private AddRemoveListPanel buildPrimaryKeysList() {
    AddRemoveListPanel listPanel =
        new AddRemoveListPanel(
            getApplicationContext(),
            this.buildPrimaryKeysAddRemoveAdapter(),
            this.buildSortedPrimaryKeysHolder(),
            AddRemovePanel.RIGHT,
            "PRIMARY_KEYS_PANEL.TITLE",
            RelationalMappingComponentFactory.buildColumnNodeSelector(
                getWorkbenchContextHolder())) {
          protected String addButtonKey() {
            return "PRIMARY_KEYS_PANEL_ADD_BUTTON";
          }

          protected String removeButtonKey() {
            return "PRIMARY_KEYS_PANEL_REMOVE_BUTTON";
          }
        };

    listPanel.setBorder(SwingComponentFactory.buildStandardEmptyBorder());
    listPanel.setCellRenderer(buildPrimaryKeysListCellRenderer());
    return listPanel;
  }
  protected Component buildMainPanel() {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();

    //    reference name
    JLabel referenceNameLabel =
        SwingComponentFactory.buildLabel("enterNameOfNewReference", resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 0, 0, 0);
    panel.add(referenceNameLabel, constraints);

    this.referenceNameTextField = buildReferenceNameTextField();
    helpManager().addTopicID(this.referenceNameTextField, helpTopicId() + ".name");
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(1, 0, 0, 0);
    panel.add(this.referenceNameTextField, constraints);
    referenceNameLabel.setLabelFor(this.referenceNameTextField);

    //    source table
    JLabel sourceTableLabel =
        SwingComponentFactory.buildLabel("selectTheSourceTable", resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(10, 0, 0, 0);
    panel.add(sourceTableLabel, constraints);

    JComboBox sourceTableComboBox = buildSourceTableComboBox();
    helpManager().addTopicID(sourceTableComboBox, helpTopicId() + ".sourceTable");
    sourceTableLabel.setLabelFor(sourceTableComboBox);
    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(1, 0, 0, 0);
    panel.add(sourceTableComboBox, constraints);

    //    target table
    JLabel targetTableLabel =
        SwingComponentFactory.buildLabel("selectTheTargetTable", resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(10, 0, 0, 0);
    panel.add(targetTableLabel, constraints);

    JComboBox targetTableComboBox = buildTargetTableComboBox();
    helpManager().addTopicID(targetTableComboBox, helpTopicId() + ".targetTable");
    targetTableLabel.setLabelFor(targetTableComboBox);
    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(1, 0, 0, 0);
    panel.add(targetTableComboBox, constraints);

    // on database check box
    JCheckBox onDatabaseCheckBox = buildOnDatabaseCheckBox();
    helpManager().addTopicID(onDatabaseCheckBox, helpTopicId() + ".onDatabase");
    constraints.gridx = 0;
    constraints.gridy = 6;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    panel.add(onDatabaseCheckBox, constraints);

    return panel;
  }
  @Override
  protected void buildPageWithTypeSelector() {
    GridBagConstraints constraints = new GridBagConstraints();
    Insets offset = BorderFactory.createTitledBorder("m").getBorderInsets(this.mainPanel);
    offset.left += 5;
    offset.right += 5;

    // xml field panel
    AbstractPanel pane = this.buildXmlFieldPanel();
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 0, 0, 0);
    this.mainPanel.add(pane, constraints);
    this.addPaneForAlignment(pane);

    // reference descriptor chooser
    Component referenceDescriptorChooser = this.buildReferenceDescriptorPanel();
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.FIRST_LINE_START;
    constraints.insets = new Insets(5, offset.left, 0, offset.right);
    this.mainPanel.add(referenceDescriptorChooser, constraints);
    this.addHelpTopicId(referenceDescriptorChooser, "mapping.eis.referenceDescriptor");

    // method accessing panel
    pane = this.buildMethodAccessingPanel();
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    this.mainPanel.add(pane, constraints);
    this.addPaneForAlignment(pane);

    // container accessor panel
    pane = this.buildContainerAccessorPanel();
    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    this.mainPanel.add(pane, constraints);
    this.addPaneForAlignment(pane);

    // read only check box
    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(5, 5, 0, 0);
    this.mainPanel.add(this.buildReadOnlyCheckBox(), constraints);

    // comment
    JComponent commentPanel =
        SwingComponentFactory.buildCommentPanel(getSelectionHolder(), resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.PAGE_START;
    constraints.insets = new Insets(5, offset.left, 0, offset.right);
    this.mainPanel.add(commentPanel, constraints);
    this.addHelpTopicId(commentPanel, "mapping.comment");

    this.addHelpTopicId(this.mainPanel, "mapping.compositeObject");
  }
  /**
   * Initializes the layout of this pane.
   *
   * @return The container with all its widgets
   */
  protected void initializeLayout() {
    GridBagConstraints constraints = new GridBagConstraints();
    selectionModel = buildPropertySelectionModel();

    // Property table
    table =
        SwingComponentFactory.buildTable(
            this.buildPropertyTableAdapter(), this.buildTableColumnModel(), this.selectionModel);
    table.setAutoCreateColumnsFromModel(false);
    table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    table.setAutoscrolls(true);
    table.setSurrendersFocusOnKeystroke(true);
    table.getTableHeader().setReorderingAllowed(false);
    table.addPropertyChangeListener("enabled", new PropertyChangeHandler());

    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 3;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 0, 0, 0);

    scrollPane = new JScrollPane(table);
    scrollPane.setMinimumSize(new Dimension(0, 0));
    scrollPane.setPreferredSize(new Dimension(0, 0));
    scrollPane.getViewport().setBackground(table.getBackground());

    add(scrollPane, constraints);

    // Add button
    addButton = buildButton("LOGIN_PROPERTY_ADD_BUTTON");
    addButton.addActionListener(buildAddActionListener());

    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, 5, 0, 0);

    add(addButton, constraints);

    // Edit button
    editButton = buildButton("LOGIN_PROPERTY_EDIT_BUTTON");
    editButton.addActionListener(buildEditActionListener());
    editButton.setEnabled(false);

    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 5, 0, 0);

    add(editButton, constraints);
    buildEditButtonEnabler();

    // Remove button
    removeButton = buildButton("LOGIN_PROPERTY_REMOVE_BUTTON");
    removeButton.addActionListener(buildRemoveActionListener(selectionModel));
    removeButton.setEnabled(false);

    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.PAGE_START;
    constraints.insets = new Insets(5, 5, 0, 0);

    add(removeButton, constraints);
    buildRemoveButtonEnabler();

    addHelpTopicId(this, "session.login.properties");
  }
  protected Component buildPage() {
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    GridBagConstraints constraints = new GridBagConstraints();
    Insets offset = BorderFactory.createTitledBorder("m").getBorderInsets(panel);
    offset.left += 5;
    offset.right += 5;

    // Reference Descriptor chooser
    JComponent referenceDescriptorWidgets =
        buildLabeledComponent(
            "REFERENCE_DESCRIPTOR_CHOOSER_LABEL", buildReferenceDescriptorChooser());

    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, offset.left, 0, offset.right);

    panel.add(referenceDescriptorWidgets, constraints);
    addHelpTopicId(referenceDescriptorWidgets, "mapping.referenceDescriptor");

    // Foreign Keys sub-pane
    ForeignKeysSubPane foreignKeysSubPane = new ForeignKeysSubPane();

    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);

    panel.add(foreignKeysSubPane, constraints);
    addPaneForAlignment(foreignKeysSubPane);

    // Maintain Bidirectionality Relationship
    MaintainsBidirectionalRelationshipPanel maintainBidiRelationshipWidget =
        new MaintainsBidirectionalRelationshipPanel(
            getSelectionHolder(), getWorkbenchContextHolder());

    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);

    panel.add(maintainBidiRelationshipWidget, constraints);
    addPaneForAlignment(maintainBidiRelationshipWidget);

    // Use Method accessing widgets
    MethodAccessingPanel methodAccessingPanel =
        new MethodAccessingPanel(getSelectionHolder(), getWorkbenchContextHolder());

    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    panel.add(methodAccessingPanel, constraints);
    addPaneForAlignment(methodAccessingPanel);

    // Read Only
    JCheckBox readOnlyCheckBox =
        MappingComponentFactory.buildReadOnlyCheckBox(
            this.getSelectionHolder(), this.getApplicationContext());

    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(5, 5, 0, 0);

    panel.add(readOnlyCheckBox, constraints);

    // Private Owned
    JCheckBox privateOwnedCheckBox =
        MappingComponentFactory.buildPrivateOwnedCheckBox(
            this.getSelectionHolder(), this.resourceRepository(), this.helpManager());
    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 5, 0, 0);
    panel.add(privateOwnedCheckBox, constraints);

    // Indirectable
    IndirectableContainerMappingPanel indirectablePanel =
        new IndirectableContainerMappingPanel(getSelectionHolder(), getApplicationContext());
    constraints.gridx = 0;
    constraints.gridy = 6;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.BOTH;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    panel.add(indirectablePanel, constraints);

    // Collection Options Advanced button
    JPanel advancedPanel =
        MappingComponentFactory.buildContainerPolicyOptionsBrowser(
            getWorkbenchContextHolder(), getSelectionHolder(), "mapping.collectionOptions");
    constraints.gridx = 0;
    constraints.gridy = 7;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(5, 5, 0, 0);
    panel.add(advancedPanel, constraints);

    // comment
    JComponent commentPanel =
        SwingComponentFactory.buildCommentPanel(getSelectionHolder(), resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 8;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.PAGE_START;
    constraints.insets = new Insets(5, offset.left, 0, offset.right);
    panel.add(commentPanel, constraints);
    this.addHelpTopicId(commentPanel, "mapping.comment");

    addHelpTopicId(panel, "mapping.oneToMany.general");
    return panel;
  }
 protected final JComponent buildCommentPanel() {
   return SwingComponentFactory.buildCommentPanel(
       this.getSelectionHolder(), this.resourceRepository());
 }
  /**
   * Creates the sub-panel that will contains the following widgets:
   *
   * <pre>
   * __________________________________________
   * |                    ___________________ |  ____________
   * |   Batch Writing:   |               |v| |<-| None     |
   * |                    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |  | JDBC     |
   * |                          _____________ |  | Buffered |
   * | x String Binding   Size: |         |I| |  ¯¯¯¯¯¯¯¯¯¯¯¯
   * |                          ¯¯¯¯¯¯¯¯¯¯¯¯¯ |
   * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯</pre>
   *
   * @return The fully initializes sub-pane with its widgets
   */
  private JComponent buildBatchWritingStringBindingPane() {
    GridBagConstraints constraints = new GridBagConstraints();
    int space = SwingTools.checkBoxIconWidth();

    // Create the container
    JPanel container = new JPanel(new GridBagLayout());
    container
        .getAccessibleContext()
        .setAccessibleName(resourceRepository().getString("LOGIN_JDBC_OPTIONS_TITLE"));

    // Batch Writing label
    JLabel batchWritingLabel = buildLabel("LOGIN_BATCH_WRITING_COMBO_BOX");

    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(2, space, 0, 0);

    container.add(batchWritingLabel, constraints);

    // Batch Writing combo box
    JComboBox batchWritingComboBox = new JComboBox(buildBatchWritingComboBoxAdapter());
    batchWritingComboBox.setRenderer(
        new AdaptableListCellRenderer(buildBatchWritingLabelDecorator()));
    batchWritingComboBox.setName("LOGIN_BATCH_WRITING_COMBO_BOX");

    constraints.gridx = 1;
    constraints.gridy = 0;
    constraints.gridwidth = 2;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(2, 20, 0, 0);

    container.add(batchWritingComboBox, constraints);
    batchWritingLabel.setLabelFor(batchWritingComboBox);

    // String size label
    JLabel stringSizeLabel = buildLabel("LOGIN_MAX_BATCH_WRITING_SIZE_SPINNER");

    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LAST_LINE_START;
    constraints.insets = new Insets(2, 40, 0, 0);

    container.add(stringSizeLabel, constraints);

    // String size spinner
    JSpinner stringSizeSpinner =
        SwingComponentFactory.buildSpinnerNumber(buildStringSizeSpinnerAdapter());
    stringSizeSpinner.setName("LOGIN_MAX_BATCH_WRITING_SIZE_SPINNER");

    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.gridwidth = 2;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(2, 5, 0, 0);

    container.add(stringSizeSpinner, constraints);
    stringSizeLabel.setLabelFor(stringSizeSpinner);

    // String Binding check box
    JCheckBox stringBindingCheckBox =
        buildCheckBox("LOGIN_STRING_BINDING_CHECK_BOX", buildStringBindingCheckBoxAdapter());

    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(4, 0, 0, 0);

    container.add(stringBindingCheckBox, constraints);

    return container;
  }
  protected Component buildPage() {
    GridBagConstraints constraints = new GridBagConstraints();
    Insets offset = BorderFactory.createTitledBorder("m").getBorderInsets(this);
    offset.left += 5;
    offset.right += 5;

    JPanel container = new JPanel(new GridBagLayout());
    container.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));

    // Reference Descriptor chooser
    JComponent referenceDescriptorWidgets =
        buildLabeledComponent(
            "REFERENCE_DESCRIPTOR_CHOOSER_LABEL", buildReferenceDescriptorChooser());
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, offset.left, 0, offset.right);
    container.add(referenceDescriptorWidgets, constraints);
    addHelpTopicId(referenceDescriptorWidgets, "mapping.referenceDescriptor");

    // Use Method accessing widgets
    MethodAccessingPanel methodAccessingPanel =
        new MethodAccessingPanel(getSelectionHolder(), getWorkbenchContextHolder());
    constraints.gridx = 0;
    constraints.gridy = 2;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    container.add(methodAccessingPanel, constraints);
    addPaneForAlignment(methodAccessingPanel);

    // Read Only
    JCheckBox readOnlyCheckBox =
        RelationalMappingComponentFactory.buildReadOnlyCheckBox(
            this.getSelectionHolder(), this.getApplicationContext());
    constraints.gridx = 0;
    constraints.gridy = 3;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(5, 5, 0, 0);
    container.add(readOnlyCheckBox, constraints);

    // Private Owned
    JCheckBox privateOwnedCheckBox =
        RelationalMappingComponentFactory.buildPrivateOwnedCheckBox(
            this.getSelectionHolder(), this.resourceRepository(), this.helpManager());
    constraints.gridx = 0;
    constraints.gridy = 4;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 5, 0, 0);
    container.add(privateOwnedCheckBox, constraints);

    // Use Batch Reading
    JCheckBox useBatchReadingCheckBox =
        RelationalMappingComponentFactory.buildBatchReadingCheckBox(
            getSelectionHolder(), resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 5;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 0;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.NONE;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 5, 0, 0);
    container.add(useBatchReadingCheckBox, constraints);
    addHelpTopicId(useBatchReadingCheckBox, "mapping.useBatchReading");

    // join fetching
    JComponent joinFetchWidgets =
        buildLabeledComponent(
            "JOIN_FETCHING_CHOOSER_LABEL",
            RelationalMappingComponentFactory.buildJoinFetchingCombobox(
                getSelectionHolder(), getWorkbenchContextHolder()));
    constraints.gridx = 0;
    constraints.gridy = 6;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(0, offset.left, 0, offset.right);
    container.add(joinFetchWidgets, constraints);
    addHelpTopicId(joinFetchWidgets, "mapping.joinFetch");

    // indirection
    ProxyIndirectionPanel indirectionPanel =
        new ProxyIndirectionPanel(getSelectionHolder(), getApplicationContext());
    constraints.gridx = 0;
    constraints.gridy = 7;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.LINE_START;
    constraints.insets = new Insets(0, 0, 0, 0);
    container.add(indirectionPanel, constraints);

    // Maintain Bidirectionality Relationship
    MaintainsBidirectionalRelationshipPanel maintainBidiRelationshipWidget =
        new MaintainsBidirectionalRelationshipPanel(
            getSelectionHolder(), getWorkbenchContextHolder());
    constraints.gridx = 0;
    constraints.gridy = 8;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 0;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.CENTER;
    constraints.insets = new Insets(5, 0, 0, 0);
    container.add(maintainBidiRelationshipWidget, constraints);
    addPaneForAlignment(maintainBidiRelationshipWidget);

    // comment
    JComponent commentPanel =
        SwingComponentFactory.buildCommentPanel(
            this.getSelectionHolder(), this.resourceRepository());
    constraints.gridx = 0;
    constraints.gridy = 9;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;
    constraints.weightx = 1;
    constraints.weighty = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.anchor = GridBagConstraints.FIRST_LINE_START;
    constraints.insets = new Insets(5, 5, 0, 5);
    container.add(commentPanel, constraints);
    addHelpTopicId(commentPanel, "mapping.comment");

    addHelpTopicId(container, "mapping.oneToOne");
    return container;
  }