Example #1
0
 @Override
 public void setBinding(Binding impl) {
   if (impl instanceof CamelSqlBindingType) {
     this._binding = (CamelSqlBindingType) impl;
     setInUpdate(true);
     if (this._binding.getQuery() != null) {
       _queryText.setText(this._binding.getQuery());
     }
     if (this._binding.getDataSourceRef() != null) {
       _dataSourceRefText.setText(this._binding.getDataSourceRef());
     }
     if (this._binding.getPlaceholder() != null) {
       _placeholderText.setText(this._binding.getPlaceholder());
     }
     _batchCheckbox.setSelection(this._binding.isBatch());
     populateOperationCombo();
     String opName = CamelBindingUtil.getOperationNameForStaticOperationSelector(this._binding);
     if (opName != null) {
       setTextValue(_operationSelectionCombo, opName);
     }
     super.setTabsBinding(_binding);
     setInUpdate(false);
     validate();
   } else {
     this._binding = null;
     populateOperationCombo();
   }
   addObservableListeners();
 }
Example #2
0
 protected void handleUndo(Control control) {
   if (_binding != null) {
     if (control.equals(_queryText)) {
       _queryText.setText(this._binding.getQuery());
     } else if (control.equals(_dataSourceRefText)) {
       _dataSourceRefText.setText(this._binding.getDataSourceRef());
     } else if (control.equals(_placeholderText)) {
       _placeholderText.setText(this._binding.getPlaceholder());
     } else if (control.equals(_batchCheckbox)) {
       _batchCheckbox.setSelection(this._binding.isBatch());
     } else if (control.equals(_operationSelectionCombo)) {
       String opName = CamelBindingUtil.getOperationNameForStaticOperationSelector(this._binding);
       setTextValue(_operationSelectionCombo, opName);
     } else {
       super.handleUndo(control);
     }
   }
   setHasChanged(false);
 }