コード例 #1
0
ファイル: CamelSQLComposite.java プロジェクト: punkhorn/tools
 @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();
 }
コード例 #2
0
ファイル: CamelSQLComposite.java プロジェクト: punkhorn/tools
 private void updateCamelOperationSelectorFeature(String featureId, Object value) {
   if (CamelBindingUtil.getFirstOperationSelector(_binding) != null) {
     OperationSelectorType opSelect = CamelBindingUtil.getFirstOperationSelector(_binding);
     Object oldValue = getFeatureValue(opSelect, featureId);
     // don't do anything if the value is the same
     if (oldValue == null && value == null) {
       return;
     } else if (oldValue != null && oldValue.equals(value)) {
       return;
     } else if (value != null && value.equals(oldValue)) {
       return;
     }
   }
   ArrayList<ModelOperation> ops = new ArrayList<ModelOperation>();
   if (featureId.equals("operationName")
       && value instanceof String
       && ((String) value).trim().isEmpty()) {
     ops.add(new RemoveOperationSelectorOp(this._binding));
   } else {
     ops.add(new CamelOperationSelectorGroupOp(this._binding));
     ops.add(new OperationSelectorOp(this._binding, featureId, value));
   }
   wrapOperation(ops);
 }
コード例 #3
0
ファイル: CamelSQLComposite.java プロジェクト: punkhorn/tools
 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);
 }