/** handler for convertAll Sql Button pressed */ void convertAllSqlPressed() { for (int i = 0; i < bindingList.size(); i++) { Binding binding = bindingList.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(); } } // Refresh tableViewer.refresh(true); updateRowColors(); updateMessageArea(); selectFirstBinding(); }
/** 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); // Refresh table and message area tableViewer.refresh(true); updateRowColors(); updateMessageArea(); selectBinding(binding); }
/** Update the Symbol Conversion Panel button enabled states. */ private void updateSymbolConversionPanelButtons(Binding binding) { // ------------------------------------------ // Set the Apply Button Enabled State // ------------------------------------------ boolean enableApply = false; if (binding != null) { // Enable Apply Button if current Binding has Conflict enableApply = binding.canConvertSqlSymbol(); } // Set Apply Button enabled state convertSelectedSqlButton.setEnabled(enableApply); // ------------------------------------------ // Set the ConvertAll Button Enabled State // ------------------------------------------ // If any binding has conflict, enable boolean enableConvertAll = false; if (bindingList.hasTypeConflict()) { enableConvertAll = true; } // Set ConvertAll Enabled State convertAllSqlButton.setEnabled(enableConvertAll); }