/** Update the Attribute Conversion Panel button enabled states. */ private void updateAttributeConversionPanelButtons(Binding binding) { // ------------------------------------------ // Set the Apply Button Enabled State // ------------------------------------------ boolean enableApply = false; if (binding != null && !this.targetLocked) { // Set the Apply button enabled state. Enable if the datatypes are different. EObject chooserDatatype = getChooserDatatype(); EObject bindingDatatype = binding.getCurrentAttrDatatype(); if (chooserDatatype != null && bindingDatatype != null) { if (!chooserDatatype.equals(bindingDatatype)) { enableApply = true; } } } // Set Apply Button enabled state convertSelectedAttrButton.setEnabled(enableApply); // ------------------------------------------ // Set the ConvertAll Button Enabled State // ------------------------------------------ // Enable ConvertAll Button if any Binding has Conflict and target group not locked boolean enableConvertAll = false; // Enable ConvertAll Button if any Binding has Conflict boolean hasTypeConflict = bindingList.hasTypeConflict(); if (hasTypeConflict && !this.targetLocked) { enableConvertAll = true; } convertAllAttrsButton.setEnabled(enableConvertAll); }
public boolean hasConflictsAndCanConvert() { if (bindingList.hasTypeConflict()) { for (Object obj : bindingList.getAll().toArray()) { Binding binding = (Binding) obj; if (canConvert(binding)) { return true; } } } return false; }
/** 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); }