gt:         constraints.insets = new Insets(5, 5, 0, 5);
context: /*******************************************************************************
   * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved.
   * This program and the accompanying materials are made available under the
   * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
   * which accompanies this distribution.
   * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
   * and the Eclipse Distribution License is available at
   * http://www.eclipse.org/org/documents/edl-v10.php.
   *
   * Contributors:
   *     Oracle - initial API and implementation from Oracle TopLink
  ******************************************************************************/
  package org.eclipse.persistence.tools.workbench.mappingsplugin.ui.query.xml;
  
  import java.awt.Dimension;
  import java.awt.GridBagConstraints;
  import java.awt.GridBagLayout;
  import java.awt.GridLayout;
  import java.awt.Insets;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.ListIterator;
  import javax.swing.BorderFactory;
  import javax.swing.JButton;
  import javax.swing.JComboBox;
  import javax.swing.JComponent;
  import javax.swing.JLabel;
  import javax.swing.JScrollPane;
  import javax.swing.JTable;
  import javax.swing.JTextField;
  import javax.swing.event.ListSelectionEvent;
  import javax.swing.event.ListSelectionListener;
  import javax.swing.table.TableColumn;
  import javax.swing.table.TableModel;
  
  import org.eclipse.persistence.tools.workbench.framework.context.ApplicationContext;
  import org.eclipse.persistence.tools.workbench.framework.resources.ResourceRepository;
  import org.eclipse.persistence.tools.workbench.framework.ui.view.AbstractPanel;
  import org.eclipse.persistence.tools.workbench.framework.uitools.Pane;
  import org.eclipse.persistence.tools.workbench.framework.uitools.SwingComponentFactory;
  import org.eclipse.persistence.tools.workbench.mappingsmodel.query.xml.MWEisInteraction;
  import org.eclipse.persistence.tools.workbench.uitools.ComponentEnabler;
  import org.eclipse.persistence.tools.workbench.uitools.app.ListAspectAdapter;
  import org.eclipse.persistence.tools.workbench.uitools.app.ListValueModel;
  import org.eclipse.persistence.tools.workbench.uitools.app.PropertyAspectAdapter;
  import org.eclipse.persistence.tools.workbench.uitools.app.PropertyValueModel;
  import org.eclipse.persistence.tools.workbench.uitools.app.swing.ColumnAdapter;
  import org.eclipse.persistence.tools.workbench.uitools.app.swing.DocumentAdapter;
  import org.eclipse.persistence.tools.workbench.uitools.app.swing.TableModelAdapter;
  import org.eclipse.persistence.tools.workbench.utility.CollectionTools;
  
  
  
  public final class InteractionPanel extends AbstractPanel {
  
      private PropertyValueModel eisInteractionHolder;
  
      private String helpTopicId;
  
      private JTable inputArgumentsTable;
      private JTable outputArgumentsTable;
      private JTable propertiesTable;
  
      private JButton addInputArgumentButton;
      private JButton removeInputArgumentButton;
  
      private JButton addPropertyButton;
      private JButton removePropertyButton;
  
      private JButton addOutputArgumentButton;
      private JButton removeOutputArgumentButton;
  
      public InteractionPanel(ApplicationContext context, PropertyValueModel interactionHolder, PropertyValueModel enabledBooleanHolder, String helpTopicId) {
          super(context);
          initialize(interactionHolder, enabledBooleanHolder, helpTopicId);
      }
  
      public InteractionPanel(ApplicationContext context, PropertyValueModel interactionHolder, String helpTopicId) {
          this(context, interactionHolder, null, helpTopicId);
      }
  
      public InteractionPanel(ApplicationContext context, PropertyValueModel interactionHolder, PropertyValueModel enabledBooleanHolder) {
          this(context, interactionHolder, enabledBooleanHolder, "descriptor.queryManager.customCalls");
      }
  
      public InteractionPanel(ApplicationContext context, PropertyValueModel interactionHolder) {
          this(context, interactionHolder, null, "descriptor.queryManager.customCalls");
      }
  
  
      protected void initialize(PropertyValueModel interactionModel, PropertyValueModel enabledBooleanHolder, String helpTopicId) {
          this.helpTopicId = helpTopicId;
          this.eisInteractionHolder = interactionModel;
          initializeLayout(enabledBooleanHolder);
      }
  
      public void initializeLayout(PropertyValueModel enabledBooleanHolder){
          Collection components = new ArrayList();
          GridBagConstraints constraints = new GridBagConstraints();
  
          Pane mainPage = new Pane(new GridBagLayout());
          constraints.gridx = 0;
          constraints.gridy = 0;
          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(0, 0, 0, 0);
          this.add(mainPage, constraints);
  
          JComboBox interactionTypeCombo = new JComboBox(new String[] {resourceRepository().getString("XML_INTERACTION")});
          constraints.gridx = 0;
          constraints.gridy = 0;
          constraints.gridwidth = 3;
          constraints.gridheight = 1;
          constraints.weightx = 1;
          constraints.weighty = 0;
          constraints.fill = GridBagConstraints.HORIZONTAL;
          constraints.anchor = GridBagConstraints.PAGE_START;
          constraints.insets = new Insets(5, 5, 0, 5);
          mainPage.add(interactionTypeCombo, constraints);
  
          JComponent functionNameComponent = buildLabeledTextField("FUNCTION_NAME", buildFunctionNameDocument(buildFunctionNameHolder()));
          CollectionTools.addAll(components, functionNameComponent.getComponents());
          constraints.gridx = 0;
          constraints.gridy = 1;
          constraints.gridwidth = 3;
          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, 5);
          mainPage.add(functionNameComponent, constraints);
  
          JComponent inputRecordNameComponent = buildLabeledTextField("INPUT_RECORD_NAME", buildInputRecordDocument(buildInputRecordNameHolder()));
          CollectionTools.addAll(components, inputRecordNameComponent.getComponents());
          constraints.gridx = 0;
          constraints.gridy = 2;
          constraints.gridwidth = 3;
          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, 5);
          mainPage.add(inputRecordNameComponent, constraints);
  
          JComponent inputRootElementNameComponent = buildLabeledTextField("INPUT_ROOT_ELEMENT_NAME", buildInputRootElementNameDocument(buildInputRootElementNameHolder()));
          CollectionTools.addAll(components, inputRootElementNameComponent.getComponents());
          constraints.gridx = 0;
          constraints.gridy = 3;
          constraints.gridwidth = 3;
          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, 5);
          mainPage.add(inputRootElementNameComponent, constraints);
  
  
          //////////////Input Arg table
          JLabel inputArgumentsLabel = buildLabel("INPUT_ARGUMENTS");
          components.add(inputArgumentsLabel);
          constraints.gridx = 0;
          constraints.gridy = 4;
          constraints.gridwidth = 1;
          constraints.gridheight = 2;
          constraints.weightx = 0;
          constraints.weighty = 0;
          constraints.fill = GridBagConstraints.NONE;
          constraints.anchor = GridBagConstraints.FIRST_LINE_START;
          constraints.insets = new Insets(5, 5, 0, 0);
          mainPage.add(inputArgumentsLabel, constraints);
          addAlignLeft(inputArgumentsLabel);
  
  
          // Create the parameter table
          inputArgumentsTable = buildInputArgumentsTable();
          components.add(inputArgumentsTable);
          constraints.gridx = 1;
          constraints.gridy = 4;
          constraints.gridwidth = 2;
          constraints.gridheight = 1;
          constraints.weightx = 1;
          constraints.weighty = 1;
          constraints.fill = GridBagConstraints.BOTH;
          constraints.anchor = GridBagConstraints.LINE_END;
          constraints.insets = new Insets(5, 5, 0, 5);
          inputArgumentsTable.setPreferredScrollableViewportSize(new Dimension(25, 50));
          JScrollPane scrollPane = new JScrollPane(inputArgumentsTable);
          scrollPane.getViewport().setBackground(inputArgumentsTable.getBackground());
          mainPage.add(scrollPane, constraints);
  
              // Create the Add button
              this.addInputArgumentButton = buildButton("ADD_ARGUMENT_BUTTON");
              this.addInputArgumentButton.addActionListener(this.buildAddArgumentAction());
  
              // Create the Remove button
              this.removeInputArgumentButton = buildButton("REMOVE_ARGUMENT_BUTTON");
              this.removeInputArgumentButton.addActionListener(this.buildRemoveArgumentAction());
              this.removeInputArgumentButton.setEnabled(false);
  
          // Create the button panel
          Pane inputButtonPanel = new ButtonPane(inputArgumentsTable, addInputArgumentButton, removeInputArgumentButton);
          components.add(inputButtonPanel);
  
          constraints.gridx = 2;
          constraints.gridy = 5;
          constraints.gridwidth = 1;
          constraints.gridheight = 1;
          constraints.weightx = 0;
          constraints.weighty = 0;
          constraints.fill = GridBagConstraints.NONE;
          constraints.anchor = GridBagConstraints.LINE_END;
          constraints.insets = new Insets(2, 5, 5, 5);
          mainPage.add(inputButtonPanel, constraints);
  
          /////////////Output arg table
          JLabel outputArgumentsLabel = buildLabel("OUTPUT_ARGUMENTS");
          components.add(outputArgumentsLabel);
          constraints.gridx = 0;
          constraints.gridy = 6;
          constraints.gridwidth = 1;
          constraints.gridheight = 2;
          constraints.weightx = 0;
          constraints.weighty = 0;
          constraints.fill = GridBagConstraints.NONE;
          constraints.anchor = GridBagConstraints.FIRST_LINE_START;
          constraints.insets = new Insets(5, 5, 0, 0);
          mainPage.add(outputArgumentsLabel, constraints);
          addAlignLeft(outputArgumentsLabel);
  
  
          // Create the parameter table
          outputArgumentsTable = buildOutputArgumentsTable();
          components.add(outputArgumentsTable);
          constraints.gridx = 1;
          constraints.gridy = 6;
          constraints.gridwidth = 2;
          constraints.gridheight = 1;
          constraints.weightx = 1;
          constraints.weighty = 1;
          constraints.fill = GridBagConstraints.BOTH;
          constraints.anchor = GridBagConstraints.CENTER;
  