Examples of UpdateValueStrategy


Examples of org.eclipse.core.databinding.UpdateValueStrategy

      }
    }
  }

  protected void bindElementType() {
    UpdateValueStrategy elementTypeUpdateStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
    elementTypeUpdateStrategy.setBeforeSetValidator(new IValidator() {
      public IStatus validate(Object value) {
        String newName = (String) value;
        System.out.println(".validate: " + newName);
        IStatus status = Status.OK_STATUS;
        try {
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

      }
    });
  }

  protected void bindElementName(final WodParserCache refactoringParserCache) {
    UpdateValueStrategy elementNameUpdateStrategy = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE);
    elementNameUpdateStrategy.setBeforeSetValidator(new IValidator() {
      public IStatus validate(Object value) {
        String newName = (String) value;
        IStatus status = Status.OK_STATUS;
        try {
          if (newName == null || newName.length() == 0) {
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

        DisplayGroup.CLASS_NAME_INDEX), null, null);

    myBindingContext.bindList(SWTObservables.observeItems(myEntityCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.ENTITY_LIST), null, null);
    myBindingContext.bindValue(SWTObservables.observeEnabled(myMasterDetailGroup), BeansObservables
        .observeValue(myDisplayGroup, DisplayGroup.HAS_MASTER_DETAIL), new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), null);

    UpdateValueStrategy booleanInverse = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE) {
      @Override
      protected IStatus doSet(final IObservableValue observableValue, final Object value) {
        Boolean newValue = !(Boolean) value;
        return super.doSet(observableValue, newValue);
      }
    };

    myBindingContext.bindValue(SWTObservables.observeEnabled(myEntityCombo), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.HAS_MASTER_DETAIL),
        new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), booleanInverse);
    myBindingContext.bindValue(CustomSWTObservables.observeText(myEntityCombo), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.ENTITY_NAME), null,
        null);

    myBindingContext.bindValue(SWTObservables.observeEnabled(myEditingContextText), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.HAS_MASTER_DETAIL), new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), booleanInverse);
    myBindingContext.bindValue(SWTObservables.observeText(myEditingContextText, SWT.Modify), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.EDITING_CONTEXT), null, null);

    myBindingContext.bindValue(SWTObservables.observeSelection(myHasDetailButton), BeansObservables
        .observeValue(myDisplayGroup, DisplayGroup.HAS_MASTER_DETAIL), null, null);

    myBindingContext.bindList(SWTObservables.observeItems(myMasterEntityCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.ENTITY_LIST), null, null);
    myBindingContext.bindValue(CustomSWTObservables.observeText(myMasterEntityCombo), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.MASTER_ENTITY_NAME), null, null);

    myBindingContext.bindList(SWTObservables.observeItems(myDetailKeyCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.DETAIL_KEY_LIST), null, null);

    myBindingContext.bindValue(CustomSWTObservables.observeText(myDetailKeyCombo), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.DETAIL_KEY_NAME),
        null, null);

    myBindingContext.bindValue(SWTObservables.observeSelection(myEntriesPerBatchSpinner), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.ENTRIES_PER_BATCH), null, null);

    myBindingContext.bindValue(SWTObservables.observeSelection(mySelectsFirstObjectButton), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.SELECTS_FIRST_OBJECT), null, null);

    myBindingContext.bindList(SWTObservables.observeItems(myQualificationCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.QUALIFICATION_LIST), null, null);
    myBindingContext.bindValue(SWTObservables.observeSingleSelectionIndex(myQualificationCombo), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.QUALIFICATION_INDEX), null, null);

    myBindingContext.bindValue(SWTObservables.observeSelection(myFetchOnLoadButton), BeansObservables
        .observeValue(myDisplayGroup, DisplayGroup.FETCHES_ON_LOAD), null, null);

    myBindingContext.bindList(SWTObservables.observeItems(mySortAttributeCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.SORT_LIST), null, null);

    myBindingContext.bindValue(CustomSWTObservables.observeSelection(mySortAttributeCombo), BeansObservables.observeValue(myDisplayGroup,
        DisplayGroup.SORT_ORDER_KEY), null, null);

    myBindingContext.bindValue(CustomSWTObservables.observeSelection(mySortRadioGroup), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.SORT_ORDER),
        null, null);

    UpdateValueStrategy fetchSpecEmpty = new UpdateValueStrategy();
    fetchSpecEmpty.setConverter(new IConverter() {
      public Object convert(final Object fromObject) {
        boolean result = fromObject != null && ((List<?>) fromObject).size() > 0;
        if (!myHasDetailButton.getSelection()) {
          return result;
        }
        return false;
      }

      public Object getFromType() {
        return new ArrayList<String>();
      }

      public Object getToType() {
        return true;
      }
    });

    UpdateValueStrategy fetchSpecEnabled = new UpdateValueStrategy(UpdateValueStrategy.POLICY_UPDATE) {
      @Override
      protected IStatus doSet(final IObservableValue observableValue, final Object value) {
        Boolean newValue = false;
        if (myFetchSpecCombo.getItemCount() > 0) {
          newValue = !(Boolean) value;
        }
        return super.doSet(observableValue, newValue);
      }
    };
    myBindingContext.bindValue(SWTObservables.observeEnabled(myFetchSpecCombo), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.HAS_MASTER_DETAIL),
        new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), fetchSpecEnabled);

    myBindingContext.bindValue(SWTObservables.observeEnabled(myFetchSpecCombo), BeansObservables.observeValue(myDisplayGroup, DisplayGroup.FETCH_SPEC_LIST),
        new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), fetchSpecEmpty);

    myBindingContext.bindList(SWTObservables.observeItems(myFetchSpecCombo), BeansObservables.observeList(Realm.getDefault(), myDisplayGroup,
        DisplayGroup.FETCH_SPEC_LIST), null, null);

    UpdateValueStrategy fetchSpecSelection = new UpdateValueStrategy() {
      @Override
      protected IStatus doSet(IObservableValue observableValue, Object value) {
        if (value == null || value.equals("")) {
          value = DisplayGroup.FETCH_SPEC_NONE;
        }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

   * @param model
   * @return binding
   */
  protected Binding createBinding(IObservableValue target,
      IObservableValue model) {
    return dbc.bindValue(target, model, new UpdateValueStrategy(
        UpdateValueStrategy.POLICY_CONVERT), null);
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

        break;
      }
      converter = dataBinding.getConverter();
      validators = dataBinding.getValidators();
    }
    UpdateValueStrategy sourceToTarget = new UpdateValueStrategy(
        sourceToTargetPolicy);
    UpdateValueStrategy targetToSource = new UpdateValueStrategy(
        targetToSourcePolicy);

    bindValidators(validators, sourceToTarget, targetToSource);

    return bind(source, target, sourceToTarget, targetToSource, converter);
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

      UpdateValueStrategy targetToSource,
      IConverter sourceToTargetConvertor,
      IConverter targetToSourceConvertor) {
    if (source != null && target != null) {
      if (sourceToTarget == null) {
        sourceToTarget = new UpdateValueStrategy(
            UpdateValueStrategy.POLICY_UPDATE);
      }
      if (targetToSource == null) {
        targetToSource = new UpdateValueStrategy(
            UpdateValueStrategy.POLICY_UPDATE);
      }

      // Add converter to UpdateValueStrategy.
      IDataProvider sourceDataProvider = XWT.findDataProvider(source);
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    IObservableValue managedConnectionFactoryRepositoryPasswdObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__REPOSITORY_PASSWD)).observe(destinationDataStoreEntry);
    bindingContext.bindValue(observeTextRepositoryPasswordTextObserveWidget, managedConnectionFactoryRepositoryPasswdObserveValue, null, null);
    //
    IObservableValue observeSelectionRespositorySncBtnObserveWidget = WidgetProperties.selection().observe(respositorySncBtn);
    IObservableValue managedConnectionFactoryRepositorySncObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__REPOSITORY_SNC)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_15 = new UpdateValueStrategy();
    strategy_15.setConverter(new Boolean2StringConverter());
    UpdateValueStrategy repositorySncModelStrategy = new UpdateValueStrategy();
    repositorySncModelStrategy.setConverter(new String2BooleanConverter());
    bindingContext.bindValue(observeSelectionRespositorySncBtnObserveWidget, managedConnectionFactoryRepositorySncObserveValue, strategy_15, repositorySncModelStrategy);
    //
    IObservableValue observeSelectionRepositoryRoundtripOptimizationBtnObserveWidget = WidgetProperties.selection().observe(repositoryRoundtripOptimizationBtn);
    IObservableValue managedConnectionFactoryRepositoryRoundtripOptimizationObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__REPOSITORY_ROUNDTRIP_OPTIMIZATION)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_16 = new UpdateValueStrategy();
    strategy_16.setConverter(new Boolean2StringConverter());
    UpdateValueStrategy repositoryRoundtripOptimizationModelStrategy = new UpdateValueStrategy();
    repositoryRoundtripOptimizationModelStrategy.setConverter(new String2BooleanConverter());
    bindingContext.bindValue(observeSelectionRepositoryRoundtripOptimizationBtnObserveWidget, managedConnectionFactoryRepositoryRoundtripOptimizationObserveValue, strategy_16, repositoryRoundtripOptimizationModelStrategy);

    return bindingContext;
 
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    DataBindingContext bindingContext = super.initDataBindings();

    //
    IObservableValue observeTextPeakLimitTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(peakLimitText);
    IObservableValue managedConnectionFactoryPeakLimitObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__PEAK_LIMIT)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_8 = new UpdateValueStrategy();
    strategy_8.setBeforeSetValidator(new NonNegativeIntegerValidator(Messages.PoolPropertySection_PeakLimitValidator));
    peakLimitBinding = bindingContext.bindValue(observeTextPeakLimitTextObserveWidget, managedConnectionFactoryPeakLimitObserveValue, strategy_8, null);
    //
    IObservableValue observeTextPoolCapacityTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(poolCapacityText);
    IObservableValue managedConnectionFactoryPoolCapacityObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__POOL_CAPACITY)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_9 = new UpdateValueStrategy();
    strategy_9.setBeforeSetValidator(new NonNegativeIntegerValidator(Messages.PoolPropertySection_PoolCapacityValidator));
    poolCapacityBinding = bindingContext.bindValue(observeTextPoolCapacityTextObserveWidget, managedConnectionFactoryPoolCapacityObserveValue, strategy_9, null);
    //
    IObservableValue observeTextExpirationTimeTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(expirationTimeText);
    IObservableValue managedConnectionFactoryExpirationTimeObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__EXPIRATION_TIME)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_10 = new UpdateValueStrategy();
    strategy_10.setBeforeSetValidator(new NonNegativeIntegerValidator(Messages.PoolPropertySection_ExpirationTimeValidator));
    expirationTimeBinding = bindingContext.bindValue(observeTextExpirationTimeTextObserveWidget, managedConnectionFactoryExpirationTimeObserveValue, strategy_10, null);
    //
    IObservableValue observeTextExpirationCheckPeriodTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(expirationCheckPeriodText);
    IObservableValue managedConnectionFactoryExpirationPeriodObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__EXPIRATION_PERIOD)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_11 = new UpdateValueStrategy();
    strategy_11.setBeforeSetValidator(new NonNegativeIntegerValidator(Messages.PoolPropertySection_ExpirationCheckPeriodValidator));
    expirationPeriodBinding = bindingContext.bindValue(observeTextExpirationCheckPeriodTextObserveWidget, managedConnectionFactoryExpirationPeriodObserveValue, strategy_11, null);
    //
    IObservableValue observeTextMaxGetClientTimeTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(maxGetClientTimeText);
    IObservableValue managedConnectionFactoryMaxGetTimeObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__MAX_GET_TIME)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_12 = new UpdateValueStrategy();
    strategy_12.setBeforeSetValidator(new NonNegativeIntegerValidator(Messages.PoolPropertySection_MaxGetClientTimeValidator));
    maxGetTimeBinding = bindingContext.bindValue(observeTextMaxGetClientTimeTextObserveWidget, managedConnectionFactoryMaxGetTimeObserveValue, strategy_12, null);
   
    peakLimitDecorator = ControlDecorationSupport.create(peakLimitBinding, SWT.TOP | SWT.LEFT);
    poolCapacityDecorator = ControlDecorationSupport.create(poolCapacityBinding, SWT.TOP | SWT.LEFT);
    expirationTimeDecorator = ControlDecorationSupport.create(expirationTimeBinding, SWT.TOP | SWT.LEFT);
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    DataBindingContext bindingContext = super.initDataBindings();

    //
    IObservableValue observeTextSysnrText2ObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(sysnrText2);
    IObservableValue managedConnectionFactorySysnrObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SYSNR)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_2 = new UpdateValueStrategy();
    strategy_2.setBeforeSetValidator(new SystemNumberValidator());
    sysnrBinding2 = bindingContext.bindValue(observeTextSysnrText2ObserveWidget, managedConnectionFactorySysnrObserveValue, strategy_2, null);
    //
    IObservableValue observeTextSaprouterTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(saprouterText);
    IObservableValue managedConnectionFactorySaprouterObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SAPROUTER)).observe(destinationDataStoreEntry);
    UpdateValueStrategy saprouterStrategy = new UpdateValueStrategy();
    saprouterStrategy.setBeforeSetValidator(new SapRouterStringValidator());
    saprouterBinding = bindingContext.bindValue(observeTextSaprouterTextObserveWidget, managedConnectionFactorySaprouterObserveValue, saprouterStrategy, null);
    //
    IObservableValue observeTextAshostText2ObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(ashostText2);
    IObservableValue managedConnectionFactoryAshostObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__ASHOST)).observe(destinationDataStoreEntry);
    bindingContext.bindValue(observeTextAshostText2ObserveWidget, managedConnectionFactoryAshostObserveValue, null, null);
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    DataBindingContext bindingContext = super.initDataBindings();
   
    //
    IObservableValue observeSelectionSncModeBtnObserveWidget = WidgetProperties.selection().observe(sncModeBtn);
    IObservableValue managedConnectionFactorySncModeObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SNC_MODE)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_13 = new UpdateValueStrategy();
    strategy_13.setConverter(new Boolean2StringConverter());
    UpdateValueStrategy sncModeModelStrategy = new UpdateValueStrategy();
    sncModeModelStrategy.setConverter(new String2BooleanConverter());
    bindingContext.bindValue(observeSelectionSncModeBtnObserveWidget, managedConnectionFactorySncModeObserveValue, strategy_13, sncModeModelStrategy);
    //
    IObservableValue observeTextSncPartnernameTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(sncPartnernameText);
    IObservableValue managedConnectionFactorySncPartnernameObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SNC_PARTNERNAME)).observe(destinationDataStoreEntry);
    bindingContext.bindValue(observeTextSncPartnernameTextObserveWidget, managedConnectionFactorySncPartnernameObserveValue, null, null);
    //
    IObservableValue observeSingleSelectionIndexSncQopComboObserveWidget = WidgetProperties.singleSelectionIndex().observe(sncQopCombo);
    IObservableValue managedConnectionFactorySncQopObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SNC_QOP)).observe(destinationDataStoreEntry);
    UpdateValueStrategy strategy_14 = new UpdateValueStrategy();
    strategy_14.setConverter(new SncQosComboSelection2SncQosConverter());
    UpdateValueStrategy sncQopModelStrategy = new UpdateValueStrategy();
    sncQopModelStrategy.setConverter(new SncQos2SncQosComboSelectionConverter());
    bindingContext.bindValue(observeSingleSelectionIndexSncQopComboObserveWidget, managedConnectionFactorySncQopObserveValue, strategy_14, sncQopModelStrategy);
    //
    IObservableValue observeTextSncMynameTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(sncMynameText);
    IObservableValue managedConnectionFactorySncMynameObserveValue = EMFEditProperties.value(editingDomain, FeaturePath.fromList(Literals.DESTINATION_DATA_STORE_ENTRY__VALUE, Literals.DESTINATION_DATA__SNC_MYNAME)).observe(destinationDataStoreEntry);
    bindingContext.bindValue(observeTextSncMynameTextObserveWidget, managedConnectionFactorySncMynameObserveValue, null, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.