protected void handleUndo(Control control) { if (_binding != null) { if (control.equals(_entityClassNameText)) { _entityClassNameText.setText(this._binding.getEntityClassName()); } else if (control.equals(_persistenceUnitText)) { _persistenceUnitText.setText(this._binding.getPersistenceUnit().toString()); } else if (control.equals(_transcationManagerText)) { _transcationManagerText.setText(this._binding.getTransactionManager()); } else if (control.equals(_deleteCheckbox)) { _deleteCheckbox.setSelection(this._binding.getConsume().isConsumeDelete()); } else if (control.equals(_lockEntityCheckbox)) { _lockEntityCheckbox.setSelection(this._binding.getConsume().isConsumeLockEntity()); } else if (control.equals(_maximumResultsText)) { setTextValue( _maximumResultsText, PropTypeUtil.getPropValueString(this._binding.getConsume().getMaximumResults())); } else if (control.equals(_queryText)) { _queryText.setText(this._binding.getConsume().getConsumerQuery()); } else if (control.equals(_namedQueryText)) { _namedQueryText.setText(this._binding.getConsume().getConsumerNamedQuery()); } else if (control.equals(_nativeQueryText)) { _nativeQueryText.setText(this._binding.getConsume().getConsumerNativeQuery()); } else if (control.equals(_transactedCheckbox)) { _transactedCheckbox.setSelection(this._binding.getConsume().isConsumerTransacted()); } else { super.handleUndo(control); } } setHasChanged(false); }
protected void handleModify(final Control control) { if (control.equals(_entityClassNameText)) { updateFeature(_binding, "entityClassName", _entityClassNameText.getText().trim()); } else if (control.equals(_persistenceUnitText)) { updateFeature(_binding, "persistenceUnit", _persistenceUnitText.getText().trim()); } else if (control.equals(_transcationManagerText)) { updateFeature(_binding, "transactionManager", _transcationManagerText.getText().trim()); } else if (control.equals(_deleteCheckbox)) { updateConsumeFeature("consumeDelete", _deleteCheckbox.getSelection()); } else if (control.equals(_lockEntityCheckbox)) { updateConsumeFeature("consumeLockEntity", _lockEntityCheckbox.getSelection()); } else if (control.equals(_maximumResultsText)) { try { Integer port = new Integer(_maximumResultsText.getText().trim()); updateConsumeFeature("maximumResults", port.intValue()); } catch (NumberFormatException nfe) { updateConsumeFeature("maximumResults", _maximumResultsText.getText().trim()); } } else if (control.equals(_queryText)) { updateConsumeFeature("consumerQuery", _queryText.getText().trim()); } else if (control.equals(_namedQueryText)) { updateConsumeFeature("consumerNamedQuery", _namedQueryText.getText().trim()); } else if (control.equals(_nativeQueryText)) { updateConsumeFeature("consumerNativeQuery", _nativeQueryText.getText().trim()); } else if (control.equals(_transactedCheckbox)) { updateConsumeFeature("consumerTransacted", _transactedCheckbox.getSelection()); } else { super.handleModify(control); } validate(); setHasChanged(false); setDidSomething(true); }
protected void handleUndo(Control control) { if (_binding != null) { if (control.equals(_configURIText)) { _configURIText.setText(this._binding.getConfigURI()); } else if (control.equals(_nameText)) { _nameText.setText(_binding.getName() == null ? "" : _binding.getName()); // $NON-NLS-1$ } else { super.handleUndo(control); } } setHasChanged(false); }
protected void handleModify(final Control control) { if (control.equals(_configURIText)) { updateFeature(_binding, "configURI", _configURIText.getText().trim()); // $NON-NLS-1$ } else if (control.equals(_opSelectorComposite)) { int opType = _opSelectorComposite.getSelectedOperationSelectorType(); updateOperationSelectorFeature( opType, _opSelectorComposite.getSelectedOperationSelectorValue()); fireChangedEvent(_opSelectorComposite); } else if (control.equals(_nameText)) { super.updateFeature(_binding, "name", _nameText.getText().trim()); // $NON-NLS-1$ } super.handleModify(control); setHasChanged(false); setDidSomething(true); }
protected void handleModify(final Control control) { // at this point, this is the only control we can't do with strict // databinding if (control.equals(_opSelectorComposite)) { fireChangedEvent(_opSelectorComposite); } setHasChanged(false); setDidSomething(true); }
protected void handleModify(final Control control) { if (control.equals(_queryText)) { updateFeature(_binding, "query", _queryText.getText().trim()); } else if (control.equals(_dataSourceRefText)) { updateFeature(_binding, "dataSourceRef", _dataSourceRefText.getText().trim()); } else if (control.equals(_placeholderText)) { updateFeature(_binding, "placeholder", _placeholderText.getText().trim()); } else if (control.equals(_batchCheckbox)) { boolean value = _batchCheckbox.getSelection(); updateFeature(_binding, "batch", value); } else if (control.equals(_operationSelectionCombo)) { updateCamelOperationSelectorFeature( "operationName", _operationSelectionCombo.getText().trim()); } super.handleModify(control); validate(); setHasChanged(false); }
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); }
/** 其他导航条按钮还原 */ public void otherNavBtnToNormal(Widget widget) { Control[] btns = winToolbar.getChildren(); for (Control btn : btns) { if (btn instanceof TabButton) { if (!btn.equals(widget)) { ((TabButton) btn).toNoraml(); } } } }
private void undo(Control control) { if (control.equals(_targetNamespaceText)) { if (_targetNamespaceText != null && !_targetNamespaceText.isDisposed()) { // update TNS text box based on SY/composite settings if (_businessObject instanceof org.eclipse.soa.sca.sca1_1.model.sca.Composite) { final org.eclipse.soa.sca.sca1_1.model.sca.Composite composite = (org.eclipse.soa.sca.sca1_1.model.sca.Composite) _businessObject; _targetNamespaceText.setText(composite.getTargetNamespace()); } } } }
public Command createCommand(SelectionEvent selectionEvent) { Set<String> elementsName; Control ctrl; elementsName = hashCurControls.keySet(); for (String name : elementsName) { Object o = hashCurControls.get(name); if (o instanceof Control) { ctrl = (Control) o; if (ctrl == null) { hashCurControls.remove(name); return null; } if (ctrl.equals(selectionEvent.getSource()) && ctrl instanceof CCombo) { boolean isDisposed = ((CCombo) ctrl).isDisposed(); if (!isDisposed && (!elem.getPropertyValue(name).equals(((CCombo) ctrl).getText()))) { String value = new String(""); // $NON-NLS-1$ for (int i = 0; i < elem.getElementParameters().size(); i++) { IElementParameter param = elem.getElementParameters().get(i); if (param.getName().equals(name)) { for (int j = 0; j < param.getListItemsValue().length; j++) { if (((CCombo) ctrl).getText().equals(param.getListItemsDisplayName()[j])) { value = (String) param.getListItemsValue()[j]; } } } } if (value.equals(elem.getPropertyValue(name))) { // same // value so // no // need to do // anything return null; } CorePlugin.getDefault().getLibrariesService().resetModulesNeeded(); return new PropertyChangeCommand(elem, name, value); } } } } return null; }