private void createFilePreviewOptionsGroup(Composite parent) {
    Group theGroup =
        WidgetFactory.createGroup(
            parent, getString("filePreviewOptionsGroup"), SWT.NONE, 1, 5); // $NON-NLS-1$
    theGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label numberLinesInFileLabel = new Label(theGroup, SWT.NONE);
    numberLinesInFileLabel.setText(getString("numberOfLinesLabel")); // $NON-NLS-1$

    numberLinesInFileText = WidgetFactory.createTextField(theGroup, SWT.NONE);
    numberLinesInFileText.setEditable(false);
    numberLinesInFileText.setBackground(
        Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
    GridData gd = new GridData();
    gd.minimumWidth = 50;

    Label spacer = new Label(theGroup, SWT.NONE);
    spacer.setText("                    "); // $NON-NLS-1$

    Label prefixLabel = new Label(theGroup, SWT.NONE);
    prefixLabel.setText(getString("numberOfPreviewLines")); // $NON-NLS-1$
    prefixLabel.setLayoutData(new GridData()); // new GridData(GridData.FILL_HORIZONTAL));

    this.numberPreviewLinesText = WidgetFactory.createTextField(theGroup, SWT.NONE);
    gd = new GridData();
    gd.minimumWidth = 50;

    this.numberPreviewLinesText.setLayoutData(gd);
    this.numberPreviewLinesText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(final ModifyEvent event) {
            if (!synchronizing) {
              if (!numberPreviewLinesText.getText().isEmpty()) {
                try {
                  int nLines = Integer.parseInt(numberPreviewLinesText.getText());
                  if (nLines == 0) {
                    setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$
                    return;
                  }
                  if (nLines != dataFileInfo.getNumberOfCachedFileLines()) {
                    dataFileInfo.setNumberOfCachedFileLines(nLines);
                    handleInfoChanged(true);
                  }
                  setErrorMessage(null);
                } catch (NumberFormatException ex) {
                  setErrorMessage(
                      getString(
                          "numberOfLinesMustBeInteger",
                          numberPreviewLinesText.getText())); // $NON-NLS-1$
                  return;
                }
              } else {
                setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$
                return;
              }
            }
          }
        });
  }
  private void createFileContentsGroup(Composite parent) {
    Group theGroup =
        WidgetFactory.createGroup(
            parent, getString("fileContentsGroup"), SWT.NONE, 1, 4); // $NON-NLS-1$
    GridData groupGD = new GridData(GridData.FILL_BOTH);
    groupGD.heightHint = GROUP_HEIGHT_190;
    groupGD.widthHint = 400;
    theGroup.setLayoutData(groupGD);

    this.fileContentsViewer = new ListViewer(theGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 4;
    this.fileContentsViewer.getControl().setFont(JFaceResources.getTextFont());
    this.fileContentsViewer.getControl().setLayoutData(data);

    if (this.dataFileInfo != null) {
      for (String row : this.dataFileInfo.getCachedFirstLines()) {
        if (row != null) {
          this.fileContentsViewer.add(row);
        }
      }
    }

    // Add a Context Menu
    final MenuManager columnMenuManager = new MenuManager();
    this.fileContentsViewer.getControl().setMenu(columnMenuManager.createContextMenu(parent));
  }
  /**
   * {@inheritDoc}
   *
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);

    GridData compositeGridData = new GridData(GridData.FILL_HORIZONTAL);
    composite.setLayoutData(compositeGridData);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    composite.setLayout(layout);

    // -----------------------------------------------
    // Message Label
    // -----------------------------------------------
    Label messageLabel = new Label(composite, SWT.NULL);
    messageLabel.setText(Messages.availableMedsDialogMsg);

    // -----------------------------------------------
    // Table
    // -----------------------------------------------
    Group tableGroup = WidgetFactory.createGroup(composite, Messages.availableMedsDialogTableLabel);
    tableGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    this.tableViewer = createTableViewer(tableGroup);

    return composite;
  }
  private void createControlsPanel(Composite theParent) {
    ScrolledComposite scroller =
        new ScrolledComposite(theParent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);

    GridLayout scrolledLayout = new GridLayout();
    scrolledLayout.marginLeft = 5;
    scrolledLayout.marginRight = 5;
    scroller.setLayout(scrolledLayout);

    scroller.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    scroller.setExpandHorizontal(true);
    scroller.setExpandVertical(true);
    scroller.setMinWidth(900);
    scroller.setMinHeight(270);

    Group controlsGroup = WidgetFactory.createGroup(scroller, EDIT_TXT);
    GridLayout controlsLayout = new GridLayout();
    controlsLayout.marginLeft = 0;
    controlsLayout.marginRight = 0;
    controlsGroup.setLayout(controlsLayout);
    controlsGroup.setLayoutData(new GridData(GridData.FILL_BOTH));

    createResolveAttributePanel(controlsGroup);
    createResolveSqlPanel(controlsGroup);

    scroller.setContent(controlsGroup);
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite pnlOuter = (Composite) super.createDialogArea(parent);
    Composite composite = new Composite(pnlOuter, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    composite.setLayout(gridLayout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    setTitle(UTIL.getString(PREFIX + "header")); // $NON-NLS-1$

    Composite paramGroup =
        WidgetFactory.createGroup(
            composite, UTIL.getString(PREFIX + "inputParameters"), 0, 1, 3); // $NON-NLS-1$
    paramGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    this.pnlParams = new PreviewParameterPanel(paramGroup, this.parameters);
    this.pnlParams.addChangeListener(this);

    return composite;
  }
  private void createColumnOptionsRadioGroup(Composite parent) {
    Group theGroup =
        WidgetFactory.createGroup(
            parent, getString("columnsFormatGroup"), SWT.NONE, 1, 2); // $NON-NLS-1$
    theGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // delimitedColumnsRB, fixedWidthColumnsRB;
    this.delimitedColumnsRB =
        WidgetFactory.createRadioButton(theGroup, getString("characterDelimited")); // $NON-NLS-1$

    this.delimitedColumnsRB.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(final SelectionEvent event) {
            if (!synchronizing && !creatingControl) {
              if (event.getSource() == delimitedColumnsRB) {
                if (delimitedColumnsRB.getSelection() != dataFileInfo.doUseDelimitedColumns()) {
                  dataFileInfo.setUseDelimitedColumns(delimitedColumnsRB.getSelection());
                  dataFileInfo.setFixedWidthColumns(!delimitedColumnsRB.getSelection());
                  if (dataFileInfo.getColumnInfoList().size() > 0) {
                    boolean result =
                        MessageDialog.openQuestion(
                            getShell(),
                            getString("formatChangedTitle"), // $NON-NLS-1$
                            getString("formateChangedMessage")); // $NON-NLS-1$
                    if (result) {
                      dataFileInfo.clearColumns();
                    }
                  }
                  handleInfoChanged(false);
                }
              }
            }
          }
        });

    this.fixedWidthColumnsRB =
        WidgetFactory.createRadioButton(theGroup, getString("fixedWidth")); // $NON-NLS-1$

    this.fixedWidthColumnsRB.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(final SelectionEvent event) {
            if (!synchronizing && !creatingControl) {
              if (event.getSource() == fixedWidthColumnsRB) {
                if (fixedWidthColumnsRB.getSelection() != dataFileInfo.isFixedWidthColumns()) {
                  dataFileInfo.setFixedWidthColumns(fixedWidthColumnsRB.getSelection());
                  dataFileInfo.setUseDelimitedColumns(!fixedWidthColumnsRB.getSelection());
                  if (dataFileInfo.getColumnInfoList().size() > 0) {
                    boolean result =
                        MessageDialog.openQuestion(
                            getShell(),
                            getString("formatChangedTitle"), // $NON-NLS-1$
                            getString("formateChangedMessage")); // $NON-NLS-1$
                    if (result) {
                      dataFileInfo.clearColumns();
                    }
                  }
                  handleInfoChanged(false);
                }
              }
            }
          }
        });

    this.delimitedColumnsRB.setSelection(true);
  }
    /*
     * create the panel
     * @param parent the parent composite
     */
    private void createPanel(Composite parent) {
      Composite panel =
          WidgetFactory.createGroup(
              parent,
              UTIL.getString("ExtraPropertiesPanel_groupTitle"),
              SWT.FILL,
              2,
              1); //$NON-NLS-1$
      // GridDataFactory.swtDefaults().grab(true, true).applyTo(panel);
      GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
      gd.horizontalSpan = 2;
      panel.setLayoutData(gd);

      propertiesViewer =
          new TableViewer(panel, (SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER));
      ColumnViewerToolTipSupport.enableFor(propertiesViewer);
      propertiesViewer.setContentProvider(
          new IStructuredContentProvider() {
            /**
             * {@inheritDoc}
             *
             * @see org.eclipse.jface.viewers.IContentProvider#dispose()
             */
            @Override
            public void dispose() {
              // nothing to do
            }

            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
             */
            @Override
            public Object[] getElements(Object inputElement) {
              Properties props = extraProperties;

              if (props.isEmpty()) {
                return new Object[0];
              }

              List<SimpleProperty> properties = new ArrayList<SimpleProperty>();

              for (Object key : props.keySet()) {
                String keyStr = (String) key;
                properties.add(new SimpleProperty(keyStr, (String) props.get(keyStr)));
              }
              return properties.toArray(new SimpleProperty[0]);
            }

            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
             *     java.lang.Object, java.lang.Object)
             */
            @Override
            public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
              // nothing to do
            }
          });

      // sort the table rows by display name
      propertiesViewer.setComparator(
          new ViewerComparator() {
            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer,
             *     java.lang.Object, java.lang.Object)
             */
            @Override
            public int compare(Viewer viewer, Object e1, Object e2) {
              SimpleProperty prop1 = (SimpleProperty) e1;
              SimpleProperty prop2 = (SimpleProperty) e2;

              return super.compare(viewer, prop1.getName(), prop2.getName());
            }
          });

      Table table = propertiesViewer.getTable();
      table.setHeaderVisible(true);
      table.setLinesVisible(true);
      table.setLayout(new TableLayout());
      table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
      ((GridData) table.getLayoutData()).horizontalSpan = 2;
      ((GridData) table.getLayoutData()).heightHint = table.getItemHeight() * 6;

      // create columns
      TableViewerColumn column = new TableViewerColumn(propertiesViewer, SWT.LEFT);
      column
          .getColumn()
          .setText(
              UTIL.getString("ExtraPropertiesPanel_name")
                  + "                   "); //$NON-NLS-1$ //$NON-NLS-2$
      column.setLabelProvider(new PropertyLabelProvider(0));
      // column.setEditingSupport(new PropertyNameEditingSupport(propertiesViewer, 0));
      column.getColumn().pack();

      column = new TableViewerColumn(propertiesViewer, SWT.LEFT);
      column.getColumn().setText(UTIL.getString("ExtraPropertiesPanel_value")); // $NON-NLS-1$
      column.setLabelProvider(new PropertyLabelProvider(1));
      column.setEditingSupport(new PropertyNameEditingSupport(propertiesViewer, 1));
      column.getColumn().pack();

      propertiesViewer.addSelectionChangedListener(
          new ISelectionChangedListener() {
            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
             */
            @Override
            public void selectionChanged(SelectionChangedEvent event) {
              handlePropertySelected();
            }
          });

      //
      // add toolbar below the table
      //

      Composite toolbarPanel =
          WidgetFactory.createPanel(panel, SWT.NONE, GridData.VERTICAL_ALIGN_BEGINNING, 1, 2);

      this.addPropertyButton = WidgetFactory.createButton(toolbarPanel, GridData.FILL);
      this.addPropertyButton.setImage(
          DatatoolsUiPlugin.getDefault().getImage(Images.ADD_PROPERTY_ICON));
      this.addPropertyButton.setToolTipText(
          UTIL.getString("HeaderPropertiesPanel_addNewPropertyButton_tooltip")); // $NON-NLS-1$
      this.addPropertyButton.addSelectionListener(
          new SelectionListener() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              handleAddProperty();
            }

            @Override
            public void widgetDefaultSelected(SelectionEvent e) {}
          });

      this.removePropertyButton = WidgetFactory.createButton(toolbarPanel, GridData.FILL);
      this.removePropertyButton.setImage(
          DatatoolsUiPlugin.getDefault().getImage(Images.REMOVE_PROPERTY_ICON));
      this.removePropertyButton.setToolTipText(
          UTIL.getString("HeaderPropertiesPanel_removePropertyButton_tooltip")); // $NON-NLS-1$
      this.removePropertyButton.addSelectionListener(
          new SelectionListener() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              handleRemoveProperty();
            }

            @Override
            public void widgetDefaultSelected(SelectionEvent e) {}
          });
      this.removePropertyButton.setEnabled(false);

      propertiesViewer.setInput(this);
    }
  /** Create the Panel for resolving sql symbols */
  private void createResolveSqlPanel(Composite parent) {
    Group newGroup = WidgetFactory.createGroup(parent, RESOLVE_SQL_GROUP_NAME);
    GridLayout gridLayout = new GridLayout();
    newGroup.setLayout(gridLayout);
    gridLayout.numColumns = 3;
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginLeft = 5;
    gridLayout.marginBottom = 5;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    newGroup.setLayoutData(gridData);
    newGroup.setText(SQL_SYMBOL_TXT);
    // SQL Symbol Label
    // --------------------------------------
    sqlSymbolLabel =
        WidgetFactory.createLabel(newGroup, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); // $NON-NLS-1$
    GridData gdSSL =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_FILL, false, false, 3, 1);
    sqlSymbolLabel.setLayoutData(gdSSL);
    sqlSymbolLabel.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLUE));

    // Symbol RuntimeType Label
    // --------------------------------------
    Label rtTypeLabel = WidgetFactory.createLabel(newGroup, RUNTIME_TYPE_TXT);
    GridData gdRT =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_FILL, false, false, 2, 1);
    rtTypeLabel.setLayoutData(gdRT);
    // WidgetFactory.createLabel(newGroup, "");

    Binding binding = bindingList.get(0);
    Object symbol = binding.getCurrentSymbol();
    String text = getLabelText(symbol);
    symbolRuntimeTypeLabel =
        WidgetFactory.createLabel(
            newGroup, text, GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL);

    // Available Conversion Title Label
    // --------------------------------------
    Label cvLabel =
        WidgetFactory.createLabel(
            newGroup, GridData.HORIZONTAL_ALIGN_BEGINNING, CONVERTED_SYMBOL_TXT);
    GridData gdCV =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_FILL, false, false, 2, 1);
    cvLabel.setLayoutData(gdCV);

    // Available Sql Conversion Text
    // --------------------------------------

    String convertedSymbol = binding.getSqlConversionText();
    int lossOfPrecIndex = convertedSymbol.indexOf('\n');
    String warningText = CoreStringUtil.Constants.EMPTY_STRING;
    if (lossOfPrecIndex > -1) {
      warningText = convertedSymbol.substring(lossOfPrecIndex + 1, convertedSymbol.length());
      convertedSymbol = convertedSymbol.substring(0, lossOfPrecIndex);
    }

    symbolConversionLabel =
        WidgetFactory.createLabel(newGroup, convertedSymbol, GridData.FILL_BOTH);

    symbolWarningLabel = WidgetFactory.createLabel(newGroup, warningText, GridData.FILL_BOTH);
    GridData gdWarning =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_FILL, false, false, 3, 1);
    symbolWarningLabel.setLayoutData(gdWarning);

    // Conversion Buttons Panel
    // --------------------------------------

    // Create the changeSelectedSql Button
    this.convertSelectedSqlButton =
        WidgetFactory.createButton(
            newGroup, CONVERT_SELECTED_SQL_BUTTON, GridData.HORIZONTAL_ALIGN_BEGINNING);
    this.convertSelectedSqlButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            convertSelectedSqlPressed();
          }
        });

    // Create the changeAllSql Button
    this.convertAllSqlButton =
        WidgetFactory.createButton(
            newGroup, CONVERT_ALL_SQL_BUTTON, GridData.HORIZONTAL_ALIGN_BEGINNING);
    this.convertAllSqlButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            convertAllSqlPressed();
          }
        });
    sqlGroup = newGroup;
  }
  private void createResolveAttributePanel(Composite parent) {
    if (this.targetLocked) {
      attrGroup = WidgetFactory.createGroup(parent, RESOLVE_ATTR_GROUP_LOCKED_NAME);
    } else {
      attrGroup = WidgetFactory.createGroup(parent, RESOLVE_ATTR_GROUP_NAME);
    }
    GridLayout gridLayout = new GridLayout();
    attrGroup.setLayout(gridLayout);
    gridLayout.numColumns = 4;
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginLeft = 5;
    gridLayout.marginBottom = 5;
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    attrGroup.setLayoutData(gridData);

    Binding binding = bindingList.get(0);
    Object attr = binding.getAttribute();
    // Attribute Datatype Label
    EObject datatype = null;
    attr = binding.getAttribute();
    if (TransformationHelper.isSqlColumn(attr)) {
      datatype = TransformationHelper.getSqlColumnDatatype((EObject) attr);
    }
    String datatypeText = getDatatypeText(datatype);
    Image datatypeImage = getDatatypeImage(datatype);

    attrGroup.setText(VIRTUAL_TARGET_ATTRIBUTE_TXT);

    // --------------------------------------
    // SQL Symbol Label
    // --------------------------------------
    attributeLabel =
        WidgetFactory.createLabel(attrGroup, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); // $NON-NLS-1$
    GridData attrGD =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_FILL, false, false, 4, 1);
    attributeLabel.setLayoutData(attrGD);
    attributeLabel.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLUE));

    Label rtTypeLabel = WidgetFactory.createLabel(attrGroup, RUNTIME_TYPE_TXT);
    GridData gdRT =
        new GridData(
            GridData.HORIZONTAL_ALIGN_BEGINNING,
            GridData.VERTICAL_ALIGN_BEGINNING,
            false,
            false,
            2,
            1);
    rtTypeLabel.setLayoutData(gdRT);
    WidgetFactory.createLabel(attrGroup, CoreStringUtil.Constants.EMPTY_STRING);

    // --------------------------------------
    // Attribute RuntimeType Label
    // --------------------------------------
    attrRuntimeTypeLabel =
        WidgetFactory.createLabel(
            attrGroup,
            datatypeText,
            datatypeImage,
            GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL);

    // --------------------------------------
    // Attribute Type Chooser Panel
    // --------------------------------------
    // Create the changeSelectedAttribute Button
    this.convertSelectedAttrButton =
        WidgetFactory.createButton(
            attrGroup, CONVERT_SELECTED_ATTR_BUTTON, GridData.HORIZONTAL_ALIGN_BEGINNING);
    this.convertSelectedAttrButton.setEnabled(false);
    this.convertSelectedAttrButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            convertSelectedAttrPressed();
          }
        });

    // Create the changeAllAttributes Button
    this.convertAllAttrsButton =
        WidgetFactory.createButton(
            attrGroup, CONVERT_ALL_ATTR_BUTTON, GridData.HORIZONTAL_ALIGN_BEGINNING);
    this.convertAllAttrsButton.setEnabled(false);
    this.convertAllAttrsButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            convertAllAttrsPressed();
          }
        });

    // Create the showDatatypeDialog Button
    this.showDatatypeDialogButton =
        WidgetFactory.createButton(
            attrGroup, "Change", GridData.HORIZONTAL_ALIGN_END); // $NON-NLS-1$
    this.showDatatypeDialogButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            showDatatypeDialogPressed();
          }
        });

    attrDatatypeLabel =
        WidgetFactory.createLabel(
            attrGroup,
            "xxxxxxxxxxxxxxxxxxxxxxx",
            datatypeImage, //$NON-NLS-1$
            GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.GRAB_HORIZONTAL);
    if (this.targetLocked) {
      this.showDatatypeDialogButton.setEnabled(false);
    } else {
      this.showDatatypeDialogButton.setEnabled(true);
    }
  }
  @SuppressWarnings("unused")
  @Override
  protected Control createDialogArea(Composite parent) {
    creatingContents = true;
    if (isEdit) {
      setTitle(EDIT_TITLE);
    } else {
      setTitle(CREATE_TITLE);
    }

    Composite dialogComposite = (Composite) super.createDialogArea(parent);

    Composite composite = WidgetFactory.createPanel(dialogComposite);
    // ------------------------------
    // Set layout for the Composite
    // ------------------------------
    GridLayout gridLayout = new GridLayout();
    composite.setLayout(gridLayout);
    gridLayout.numColumns = 2;
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.grabExcessHorizontalSpace = true;
    gridData.widthHint = 500;
    composite.setLayoutData(gridData);

    Label label = new Label(composite, SWT.NONE | SWT.RIGHT);
    label.setText(UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.NAME));
    label.setLayoutData(new GridData());

    final Text indexNameText = new Text(composite, SWT.BORDER | SWT.SINGLE);
    indexNameText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
    indexNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    indexNameText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(final ModifyEvent event) {
            String value = indexNameText.getText();
            if (value == null) {
              value = EMPTY_STRING;
            }
            editedIndex.setName(value);
            validate();
          }
        });

    label = new Label(composite, SWT.NONE | SWT.RIGHT);
    label.setText(Messages.nameInSourceLabel);
    label.setLayoutData(new GridData());

    final Text indexNISText = new Text(composite, SWT.BORDER | SWT.SINGLE);
    indexNISText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
    indexNISText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    indexNISText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(final ModifyEvent event) {
            String value = indexNISText.getText();
            if (value == null) {
              value = EMPTY_STRING;
            }
            editedIndex.setNameInSource(value);
            validate();
          }
        });

    // Group to present properties widgets
    PROPERTIES_GROUP:
    {
      this.autoUpdateCB = new Button(composite, SWT.CHECK | SWT.RIGHT);
      this.autoUpdateCB.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
      this.autoUpdateCB.setText(Messages.autoUpdateLabel);
      this.autoUpdateCB.addSelectionListener(
          new SelectionAdapter() {
            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
            @Override
            public void widgetSelected(SelectionEvent e) {
              editedIndex.setAutoUpdate(autoUpdateCB.getSelection());
              validate();
            }
          });
      new Label(composite, SWT.NONE);

      this.nullableCB = new Button(composite, SWT.CHECK | SWT.RIGHT);
      this.nullableCB.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
      this.nullableCB.setText(Messages.nullableLabel);
      this.nullableCB.addSelectionListener(
          new SelectionAdapter() {
            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
            @Override
            public void widgetSelected(SelectionEvent e) {
              editedIndex.setNullable(nullableCB.getSelection());
              validate();
            }
          });
      new Label(composite, SWT.NONE);

      this.uniqueCB = new Button(composite, SWT.CHECK | SWT.RIGHT);
      this.uniqueCB.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
      this.uniqueCB.setText(Messages.uniqueLabel);
      this.uniqueCB.addSelectionListener(
          new SelectionAdapter() {
            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
             */
            @Override
            public void widgetSelected(SelectionEvent e) {
              editedIndex.setUnique(uniqueCB.getSelection());
              validate();
            }
          });
      new Label(composite, SWT.NONE);

      label = new Label(composite, SWT.NONE | SWT.RIGHT);
      label.setText(Messages.filterConditionLabel);
      label.setLayoutData(new GridData());

      filterConditionText = new Text(composite, SWT.BORDER | SWT.SINGLE);
      filterConditionText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
      filterConditionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      filterConditionText.addModifyListener(
          new ModifyListener() {
            @Override
            public void modifyText(final ModifyEvent event) {
              String value = filterConditionText.getText();
              if (value == null) {
                value = EMPTY_STRING;
              }
              editedIndex.setFilterCondition(value);
              validate();
            }
          });
    }

    Group theColumnsGroup =
        WidgetFactory.createGroup(
            dialogComposite, Messages.selectColumnReferencesForIndex, SWT.NONE, 1, 1);
    theColumnsGroup.setLayout(new GridLayout(1, false));
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 120;
    gd.widthHint = 500;
    theColumnsGroup.setLayoutData(gd);

    Table tableWidget =
        new Table(
            theColumnsGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.CHECK);
    tableWidget.setHeaderVisible(false);
    tableWidget.setLinesVisible(true);
    tableWidget.setLayout(new TableLayout());
    tableWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    theColumnDataViewer = new TableViewer(tableWidget);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 160;
    gd.horizontalSpan = 2;
    theColumnDataViewer.getControl().setLayoutData(gd);
    theColumnDataViewer.setContentProvider(
        new ITreeContentProvider() {

          @Override
          public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
            // TODO Auto-generated method stub
          }

          @Override
          public void dispose() {
            // TODO Auto-generated method stub
          }

          @Override
          public boolean hasChildren(Object element) {
            return !theTable.getColumns().isEmpty();
          }

          @Override
          public Object getParent(Object element) {
            return null;
          }

          @Override
          public Object[] getElements(Object inputElement) {
            if (inputElement instanceof RelationalTable) {
              return theTable.getColumns().toArray(new Object[0]);
            }
            return new Object[0];
          }

          @Override
          public Object[] getChildren(Object parentElement) {
            // TODO Auto-generated method stub
            return new Object[0];
          }
        });

    this.theColumnDataViewer
        .getTable()
        .addSelectionListener(
            new SelectionListener() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                editedIndex.getColumns().clear();
                for (TableItem item : theColumnDataViewer.getTable().getItems()) {

                  if (item.getChecked()) {
                    editedIndex.addColumn((RelationalColumn) item.getData());
                  }
                }
                validate();
              }

              @Override
              public void widgetDefaultSelected(SelectionEvent e) {}
            });

    theColumnDataViewer.setLabelProvider(new ColumnDataLabelProvider(0));

    theColumnDataViewer.setInput(this.theTable);

    for (RelationalColumn col : this.editedIndex.getColumns()) {
      for (TableItem item : theColumnDataViewer.getTable().getItems()) {
        if (item.getData() == col) {
          item.setChecked(true);
        }
      }
    }

    DESCRIPTION_GROUP:
    {
      final Group descGroup =
          WidgetFactory.createGroup(
              dialogComposite,
              UILabelUtil.getLabel(UiLabelConstants.LABEL_IDS.DESCRIPTION),
              GridData.FILL_BOTH,
              3);
      descriptionTextEditor =
          new StyledTextEditor(
              descGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER);
      final GridData descGridData = new GridData(GridData.FILL_BOTH);
      descGridData.horizontalSpan = 1;
      descGridData.heightHint = 120;
      //            descGridData.minimumHeight = 30;
      descGridData.grabExcessVerticalSpace = true;
      descriptionTextEditor.setLayoutData(descGridData);
      descriptionTextEditor.setText(""); // $NON-NLS-1$
      descriptionTextEditor
          .getTextWidget()
          .addModifyListener(
              new ModifyListener() {

                @Override
                public void modifyText(ModifyEvent e) {
                  editedIndex.setDescription(descriptionTextEditor.getText());
                }
              });
    }

    setMessage(Messages.newIndexMessage);
    if (editedIndex.getName() != null) {
      indexNameText.setText(editedIndex.getName());
    }
    if (editedIndex.getNameInSource() != null) {
      indexNISText.setText(editedIndex.getNameInSource());
    }
    this.autoUpdateCB.setSelection(editedIndex.isAutoUpdate());
    this.nullableCB.setSelection(editedIndex.isNullable());
    this.uniqueCB.setSelection(editedIndex.isUnique());
    if (editedIndex.getFilterCondition() != null) {
      filterConditionText.setText(editedIndex.getFilterCondition());
    }
    if (editedIndex.getDescription() != null) {
      descriptionTextEditor.setText(editedIndex.getDescription());
    }

    creatingContents = false;

    return composite;
  }
  @SuppressWarnings("unused")
  private void init(Composite parent) {

    this.connectionInfoHelper = new ConnectionInfoHelper();

    SOURCE_MODEL_INFO:
    {
      Group group =
          WidgetFactory.createGroup(
              parent, Messages.SourceModelDefinition, GridData.FILL_HORIZONTAL, 1);

      group.setLayout(new GridLayout(3, false));

      Label locationLabel = new Label(group, SWT.NULL);
      locationLabel.setText(Messages.Location);

      this.sourceModelContainerText = new Text(group, SWT.BORDER | SWT.SINGLE);
      GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
      this.sourceModelContainerText.setLayoutData(gridData);
      WidgetUtil.colorizeWidget(this.sourceModelContainerText, WidgetUtil.TEXT_COLOR_BLUE, true);
      this.sourceModelContainerText.setEditable(false);

      Button browseButton = new Button(group, SWT.PUSH);
      gridData = new GridData();

      browseButton.setLayoutData(gridData);
      browseButton.setText(Messages.BrowseElipsis);
      browseButton.setToolTipText(
          NLS.bind(Messages.BrowseToSelectModelsLocation, Messages.Source_lower));
      browseButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              handleSourceModelLocationBrowse();
            }
          });

      Label fileLabel = new Label(group, SWT.NULL);
      fileLabel.setText(Messages.Name);
      fileLabel.setToolTipText(Messages.SourceNameTooltip);

      this.sourceModelFileText = new Text(group, SWT.BORDER | SWT.SINGLE);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.widthHint = 200;
      this.sourceModelFileText.setLayoutData(gridData);
      this.sourceModelFileText.setToolTipText(Messages.SourceNameTooltip);
      WidgetUtil.colorizeWidget(this.sourceModelFileText, WidgetUtil.TEXT_COLOR_BLUE, false);
      this.sourceModelFileText.addModifyListener(
          new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {
              // Check view file name for existing if "location" is already
              // set
              handleSourceModelTextChanged();
            }
          });

      browseButton = new Button(group, SWT.PUSH);
      gridData = new GridData();
      browseButton.setLayoutData(gridData);
      browseButton.setText(Messages.BrowseElipsis);
      browseButton.setToolTipText(NLS.bind(Messages.BrowseToSelect_0_Model, Messages.Source_lower));
      browseButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              handleSourceModelBrowse();
            }
          });

      SOURCE_HELP:
      {
        Group helpGroup =
            WidgetFactory.createGroup(group, Messages.Status, SWT.NONE | SWT.BORDER_DASH, 3);
        helpGroup.setLayout(new GridLayout(1, false));
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 3;
        helpGroup.setLayoutData(gd);

        sourceModelHelpText = new Text(helpGroup, SWT.WRAP | SWT.READ_ONLY);
        WidgetUtil.colorizeWidget(this.sourceModelHelpText, WidgetUtil.TEXT_COLOR_BLUE, true);
        gd = new GridData(GridData.FILL_BOTH);
        gd.heightHint = 40;
        gd.widthHint = 600;
        sourceModelHelpText.setLayoutData(gd);
      }
    }

    VIEW_MODEL_INFO:
    {
      Group group =
          WidgetFactory.createGroup(
              parent, Messages.ViewModelDefinition, GridData.FILL_HORIZONTAL, 1);

      group.setLayout(new GridLayout(3, false));

      Label locationLabel = new Label(group, SWT.NULL);
      locationLabel.setText(Messages.Location);

      this.viewModelContainerText = new Text(group, SWT.BORDER | SWT.SINGLE);
      GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
      this.viewModelContainerText.setLayoutData(gridData);
      WidgetUtil.colorizeWidget(this.viewModelContainerText, WidgetUtil.TEXT_COLOR_BLUE, true);
      this.viewModelContainerText.setEditable(false);

      Button browseButton = new Button(group, SWT.PUSH);
      gridData = new GridData();
      // buttonGridData.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
      browseButton.setLayoutData(gridData);
      browseButton.setText(Messages.BrowseElipsis);
      browseButton.setToolTipText(
          NLS.bind(Messages.BrowseToSelectModelsLocation, Messages.Source_lower));
      browseButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              handleViewModelLocationBrowse();
            }
          });

      Label fileLabel = new Label(group, SWT.NULL);
      fileLabel.setText(Messages.Name);
      fileLabel.setToolTipText(Messages.ViewNameTooltip);

      this.viewModelFileText = new Text(group, SWT.BORDER | SWT.SINGLE);
      gridData = new GridData(GridData.FILL_HORIZONTAL);
      this.viewModelFileText.setLayoutData(gridData);
      this.viewModelFileText.setToolTipText(Messages.ViewNameTooltip);
      WidgetUtil.colorizeWidget(this.viewModelFileText, WidgetUtil.TEXT_COLOR_BLUE, false);
      this.viewModelFileText.setForeground(WidgetUtil.getDarkBlueColor());
      this.viewModelFileText.addModifyListener(
          new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {
              // Check view file name for existing if "location" is already
              // set
              handleViewModelTextChanged();
            }
          });

      browseButton = new Button(group, SWT.PUSH);
      gridData = new GridData();
      browseButton.setLayoutData(gridData);
      browseButton.setText(Messages.BrowseElipsis);
      browseButton.setToolTipText(NLS.bind(Messages.BrowseToSelect_0_Model, Messages.View_lower));
      browseButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              handleViewModelBrowse();
            }
          });

      VIEW_HELP:
      {
        Group helpGroup =
            WidgetFactory.createGroup(group, Messages.Status, SWT.NONE | SWT.BORDER_DASH, 3);
        helpGroup.setLayout(new GridLayout(1, false));
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 3;
        helpGroup.setLayoutData(gd);

        viewModelHelpText = new Text(helpGroup, SWT.WRAP | SWT.READ_ONLY);
        WidgetUtil.colorizeWidget(this.viewModelHelpText, WidgetUtil.TEXT_COLOR_BLUE, true);
        gd = new GridData(GridData.FILL_BOTH);
        gd.heightHint = 40;
        gd.widthHint = 600;
        viewModelHelpText.setLayoutData(gd);
      }
    }
  }
  /**
   * @param parent
   * @return composite the page
   * @since 4.0
   */
  @SuppressWarnings({"unused", "unchecked"})
  Composite createPageControl(final Composite parent) {
    // Create page
    final Composite mainPanel = new Composite(parent, SWT.NONE);
    mainPanel.setLayout(new GridLayout(COLUMN_COUNT, false));
    // Add widgets to page
    WidgetFactory.createLabel(mainPanel, FOLDER_LABEL);
    final String name =
        (this.folder == null ? null : this.folder.getFullPath().makeRelative().toString());
    this.folderText =
        WidgetFactory.createTextField(mainPanel, GridData.FILL_HORIZONTAL, 1, name, SWT.READ_ONLY);
    this.folderText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(final ModifyEvent event) {
            folderModified();
          }
        });
    btnBrowse = WidgetFactory.createButton(mainPanel, BROWSE_BUTTON);
    btnBrowse.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            browseButtonSelected();
          }
        });
    WidgetFactory.createLabel(mainPanel, NAME_LABEL);
    this.nameText =
        WidgetFactory.createTextField(mainPanel, GridData.HORIZONTAL_ALIGN_FILL, COLUMN_COUNT - 1);
    this.nameText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(final ModifyEvent event) {
            nameModified();
          }
        });

    // set focus to browse button if no folder selected. otherwise set focus to text field
    if (folder == null) {
      btnBrowse.setFocus();
    } else {
      nameText.setFocus();
    }

    DESCRIPTION_GROUP:
    {
      final Group descGroup =
          WidgetFactory.createGroup(
              mainPanel, getString("description"), GridData.FILL_HORIZONTAL, 3); // $NON-NLS-1$
      descriptionTextEditor =
          new StyledTextEditor(
              descGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER);
      final GridData descGridData = new GridData(GridData.FILL_BOTH);
      descGridData.horizontalSpan = 1;
      descGridData.heightHint = 50;
      descGridData.minimumHeight = 30;
      descGridData.grabExcessVerticalSpace = true;
      descriptionTextEditor.setLayoutData(descGridData);
      descriptionTextEditor.setText(""); // $NON-NLS-1$
    }

    MODELS_GROUP:
    {
      Group group =
          WidgetFactory.createGroup(
              mainPanel,
              getString("selectedModelsGroupTitle"),
              GridData.FILL_BOTH,
              COLUMN_COUNT,
              COLUMN_COUNT); //$NON-NLS-1$
      group.setLayout(new GridLayout(2, false));
      GridData gd = new GridData(GridData.FILL_BOTH);
      gd.heightHint = 200;
      gd.horizontalSpan = 3;
      group.setLayoutData(gd);

      Composite leftToolbarPanel = new Composite(group, SWT.NONE);
      leftToolbarPanel.setLayout(new GridLayout());
      GridData ltpGD = new GridData(GridData.FILL_VERTICAL);
      ltpGD.heightHint = 120;
      leftToolbarPanel.setLayoutData(ltpGD);

      addModelsButton = new Button(leftToolbarPanel, SWT.PUSH);
      addModelsButton.setText(getString("add")); // $NON-NLS-1$
      addModelsButton.setToolTipText(getString("addModelsTooltip")); // $NON-NLS-1$
      addModelsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      addModelsButton.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              handleAddModelsSelected();
              if (!modelsViewer.getSelection().isEmpty()) {
                removeModelsButton.setEnabled(true);
              }
            }
          });

      removeModelsButton = new Button(leftToolbarPanel, SWT.PUSH);
      removeModelsButton.setText(getString("remove")); // $NON-NLS-1$
      removeModelsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      removeModelsButton.setEnabled(false);
      removeModelsButton.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              Collection<IResource> models = new ArrayList<IResource>();

              IStructuredSelection selection = (IStructuredSelection) modelsViewer.getSelection();
              for (Object obj : selection.toArray()) {
                if (obj instanceof IResource) {
                  models.add((IResource) obj);
                }
              }
              removeModels(models);
              removeModelsButton.setEnabled(false);
            }
          });

      this.modelsViewer = new TableViewer(group);
      GridData gdv = new GridData(GridData.FILL_BOTH);
      // gdv.horizontalSpan = COLUMN_COUNT;
      modelsViewer.getControl().setLayoutData(gdv);
      modelsViewer.setContentProvider(new ListContentProvider());
      modelsViewer.setLabelProvider(new ModelExplorerLabelProvider());
      // Add Models from properties if available
      if (this.designerProperties != null && !this.designerProperties.isEmpty()) {
        IFile sourceMdl = DesignerPropertiesUtil.getSourceModel(this.designerProperties);
        IFile viewMdl = DesignerPropertiesUtil.getViewModel(this.designerProperties);
        if (sourceMdl != null) this.modelsForVdb.add(sourceMdl);
        if (viewMdl != null) this.modelsForVdb.add(viewMdl);
      } else {
        this.modelsForVdb.addAll(SelectionUtilities.getSelectedIResourceObjects(initialSelection));
      }
      modelsViewer.setInput(this.modelsForVdb);
      modelsViewer.addSelectionChangedListener(
          new ISelectionChangedListener() {

            @Override
            public void selectionChanged(SelectionChangedEvent event) {
              removeModelsButton.setEnabled(!event.getSelection().isEmpty());
            }
          });
    }

    updateForProperties();
    return mainPanel;
  }
  /** Create the tableViewer Panel */
  @SuppressWarnings("unused")
  private void createTableViewerPanel(Composite theParent) {
    Composite tablePanel = new Composite(theParent, SWT.NONE);

    // Set the layout
    GridLayout gridLayout = new GridLayout();
    tablePanel.setLayout(gridLayout);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    tablePanel.setLayoutData(gridData);

    // Add header panel

    HEADER_PANEL:
    {
      Composite headerPanel = WidgetFactory.createPanel(tablePanel);
      // ------------------------------
      // Set layout for the Composite
      // ------------------------------
      headerPanel.setLayout(new GridLayout());
      ((GridLayout) headerPanel.getLayout()).numColumns = 3;
      headerPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
      ((GridData) headerPanel.getLayoutData()).minimumHeight = 80;
      // ((GridData)headerPanel.getLayoutData()).grabExcessHorizontalSpace = true;

      // Add general info/instructions text box
      {
        helpText = new Text(headerPanel, SWT.WRAP | SWT.READ_ONLY);
        helpText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
        helpText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
        helpText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        ((GridData) helpText.getLayoutData()).horizontalSpan = 3;
        ((GridData) helpText.getLayoutData()).heightHint = 40;
        ((GridData) helpText.getLayoutData()).widthHint = 360;

        helpText.setText(Messages.datatypeReconciler_helpText);
      }

      // Add button bar containing:
      // [CHANGE ALL COLUMN DATATYPES] - or - [CONVERT ALL SQL SYMBOLS]
      this.convertAllSqlSymbolsButton =
          WidgetFactory.createButton(
              headerPanel, Messages.datatypeReconciler_convertAllSqlSymbolsLabel);
      this.convertAllSqlSymbolsButton.setToolTipText(
          Messages.datatypeReconciler_convertAllSqlSymbolsTooltip);
      this.convertAllSqlSymbolsButton.setImage(
          UiPlugin.getDefault().getImage(PluginConstants.Images.ARROW_LEFT_ICON));

      this.convertAllSqlSymbolsButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent event) {
              changeAllColumnDatatypesButtonPressed();
            }
          });

      WidgetFactory.createLabel(headerPanel, "   - or -   "); // $NON-NLS-1$

      this.changeAllColumnDatatypesButton =
          WidgetFactory.createButton(
              headerPanel, Messages.datatypeReconciler_convertAllColumnDatatypesLabel);
      this.changeAllColumnDatatypesButton.setToolTipText(
          Messages.datatypeReconciler_convertAllColumnDatatypesTooltip);
      this.changeAllColumnDatatypesButton.setImage(
          UiPlugin.getDefault().getImage(PluginConstants.Images.ARROW_RIGHT_ICON));
      this.changeAllColumnDatatypesButton.setEnabled(false);
      this.changeAllColumnDatatypesButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent event) {
              changeAllColumnDatatypesPressed();
            }
          });
    }

    BINDING_TABLE:
    {
      table = new Table(tablePanel, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
      table.setHeaderVisible(true);
      table.setLinesVisible(true);
      table.setLayout(new TableLayout());
      GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
      gd.heightHint = 200;
      table.setLayoutData(gd);

      this.bindingTableViewer = new TableViewer(table);
      this.bindingTableViewer.getControl().setLayoutData(gd);

      this.bindingContentProvider = new BindingContentProvider();

      // create columns

      // | status icon | Source SQL Symbol | <-- | Matched Datatype | ->  | Target Column

      // COLUMN 0 :  STATUS ICON Button
      TableViewerColumn column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.setLabelProvider(new TheBindingColumnLabelProvider(0));
      column.getColumn().setText(getSpaces(8));
      column.getColumn().pack();

      // COLUMN 1 : SOURCE SQL SYMBOL
      column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.getColumn().setText(Messages.datatypeReconciler_sourceSqlSymbolLabel + getSpaces(100));
      column.setLabelProvider(new TheBindingColumnLabelProvider(1));
      column.getColumn().pack();

      // COLUMN 2 :  LEFT ARROW Button
      column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.getColumn().setText(getSpaces(8));
      column.setLabelProvider(new TheBindingColumnLabelProvider(2));
      column.setEditingSupport(new ConvertSymbolEditingSupport(this.bindingTableViewer));
      column.getColumn().pack();
      column.getColumn().setToolTipText(Messages.datatypeReconciler_convertSourceDatatypeTooltip);

      // COLUMN 3 : Matched datatype
      column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.getColumn().setText(Messages.datatypeReconciler_matchedTypeLabel + getSpaces(60));
      column.setLabelProvider(new TheBindingColumnLabelProvider(3));
      column.setEditingSupport(new ChangeProposedDatatypeEditingSupport(this.bindingTableViewer));
      column.getColumn().pack();
      column.getColumn().setToolTipText(Messages.datatypeReconciler_matchedDatatypeTooltip);

      // COLUMN 4 : RIGHT ARROW Button
      column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.getColumn().setText(getSpaces(8));
      column.setLabelProvider(new TheBindingColumnLabelProvider(4));
      column.setEditingSupport(new ChangeDatatypeEditingSupport(this.bindingTableViewer));
      column.getColumn().pack();
      column.getColumn().setToolTipText(Messages.datatypeReconciler_changeTargetDatatypeTooltip);

      // COLUMN 5 :  Target Column Definition
      column = new TableViewerColumn(this.bindingTableViewer, SWT.LEFT);
      column.getColumn().setText(Messages.datatypeReconciler_targetColumnLabel + getSpaces(25));
      column.setLabelProvider(new TheBindingColumnLabelProvider(5));
      column.getColumn().pack();

      bindingTableViewer.setUseHashlookup(true);
      bindingTableViewer.setContentProvider(this.bindingContentProvider);
      bindingTableViewer.setInput(this.bindingListInput);

      updateRowColors();
    }

    // Panel to display selection details
    SELECTION_STATUS_PANEL:
    {
      Composite selectionPanel =
          WidgetFactory.createGroup(
              tablePanel, Messages.datatypeReconciler_selectionPanelInfoLabel);
      // ------------------------------
      // Set layout for the Composite
      // ------------------------------
      selectionPanel.setLayout(new GridLayout());
      ((GridLayout) selectionPanel.getLayout()).numColumns = 2;
      selectionPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
      ((GridData) selectionPanel.getLayoutData()).minimumHeight = 80;

      //			Label selectedSymbolLabel = new Label(selectionPanel, SWT.NONE);
      //			selectedSymbolLabel.setText("Selected Symbol: ");

      symbolConversionLabel = new Label(selectionPanel, SWT.NONE);
      symbolConversionLabel.setText(PluginConstants.EMPTY_STRING);
      symbolConversionLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      symbolConversionLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));

      Label messageLabel = new Label(selectionPanel, SWT.NONE);
      //			messageLabel.setText("Status: ");

      symbolWarningLabel = new Label(selectionPanel, SWT.NONE);
      symbolWarningLabel.setText(PluginConstants.EMPTY_STRING);
      symbolWarningLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      symbolWarningLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE));
    }
  }