コード例 #1
0
  /** Initialize the panel. */
  private void init() {
    // ------------------------------
    // Set layout for the SashForm
    // ------------------------------
    GridLayout gridLayout = new GridLayout();
    this.setLayout(gridLayout);
    gridLayout.numColumns = 1;
    gridLayout.marginLeft = 20;
    GridData gridData = new GridData(GridData.FILL_BOTH);
    this.setLayoutData(gridData);

    // Init the symbol arrays from bindings
    this.bindingListInput = new BindingTableInput(createBindingList(originalBindingList));

    // ----------------------------------
    // Create the Table Viewer Panel
    // ----------------------------------
    createTableViewerPanel(this);

    // Initialize the message area at the top of the dialog
    datatypeReconcilerDialog.setTitle(Messages.datatypeReconciler_statusTitle);
    updateMessageArea();

    // Listen for TableSelection from the Tables
    bindingTableViewer.addSelectionChangedListener(this);
    selectFirstTypeConflict();
    bindingListInput.datatypeChanged();
  }
コード例 #2
0
  /** handler for convert Selected Sql Button pressed */
  void convertSelectedSqlPressed() {
    // Get the selected binding
    Binding binding = getSelectedBinding();
    // accept the available Sql Conversion
    if (binding.canConvertSqlSymbol()) {
      binding.acceptSqlConversion();
    }
    // Update the SqlConversion Panel
    updateSymbolConversionPanel(binding);

    bindingListInput.datatypeChanged();
    // Refresh table and message area
    bindingTableViewer.refresh(true);
    updateRowColors();
    updateMessageArea();

    selectBinding(binding);
  }
コード例 #3
0
  /** handler for convert Selected Attribute Button pressed */
  void convertSelectedAttrPressed() {
    // Get the selected binding - table only allows single select
    Binding binding = getSelectedBinding();
    // Set datatype on the binding
    binding.setNewAttrDatatype(bindingListInput.getTargetDatatype(binding));

    // Update the AttrConversion Panel
    updateAttributeConversionPanel(binding);

    bindingListInput.datatypeChanged();

    // Refresh
    bindingTableViewer.refresh(true);
    updateRowColors();
    updateMessageArea();

    selectBinding(binding);
  }
コード例 #4
0
  /** handler for convertAll Attributes Button pressed */
  void changeAllColumnDatatypesPressed() {
    for (int i = 0; i < bindingListInput.getBindingList().size(); i++) {
      Binding binding = bindingListInput.getBindingList().get(i);
      if (binding.hasTypeConflict() && binding.hasAttributeConversion()) {
        // accept the default attribute type
        binding.acceptAttributeConversion();
      }
    }

    bindingListInput.datatypeChanged();

    // Refresh
    bindingTableViewer.refresh(true);
    updateRowColors();
    updateMessageArea();

    selectFirstBinding();
  }
コード例 #5
0
  /** handler for convertAll Sql Button pressed */
  void changeAllColumnDatatypesButtonPressed() {
    for (int i = 0; i < bindingListInput.getBindingList().size(); i++) {
      Binding binding = bindingListInput.getBindingList().get(i);
      // If there is a type conflict, and available conversion, use it
      if (binding.hasTypeConflict() && binding.canConvertSqlSymbol()) {
        // accept the available Sql Conversion
        binding.acceptSqlConversion();
      }
    }

    bindingListInput.datatypeChanged();

    // Refresh
    bindingTableViewer.refresh(true);
    updateRowColors();
    updateMessageArea();

    selectFirstBinding();
  }