Examples of UpdateValueStrategy


Examples of org.eclipse.core.databinding.UpdateValueStrategy

    lblSelectExportLocation.setText(Messages.SapConnectionConfigurationExportPage_ExportLocation);
   
    textSelectExportLocation = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textSelectExportLocation.setMessage(Messages.SapConnectionConfigurationExportPage_ExportLocation);
    textSelectExportLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    binding = context.bindValue(SWTObservables.observeText(textSelectExportLocation, SWT.Modify), BeansObservables.observeValue(exportSettings, "exportLocation"), new UpdateValueStrategy()  , new UpdateValueStrategy()); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
   
   
    btnSelectJCo3Archive = new Button(top, SWT.NONE);
    btnSelectJCo3Archive.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        getExportDirectory();
      }
    });
    btnSelectJCo3Archive.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    btnSelectJCo3Archive.setText(Messages.SapConnectionConfigurationExportPage_Browse);
   
    Label lblSelectExportType = new Label(top, SWT.NONE);
    GridData gd_lblSelectExportType = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblSelectExportType.horizontalIndent = 10;
    lblSelectExportType.setLayoutData(gd_lblSelectExportType);
    lblSelectExportType.setText(Messages.SapConnectionConfigurationExportPage_ExportFileType);

    exportFileTypeCombo = new CCombo(top, SWT.READ_ONLY);
    exportFileTypeCombo.setToolTipText(Messages.SapConnectionConfigurationExportPage_ExportFileType);
    exportFileTypeCombo.setItems(new String[] {ExportFileType.BLUEPRINT.getDisplay(), ExportFileType.SPRING.getDisplay()});
    exportFileTypeCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    exportFileTypeCombo.select(0);

    IObservableValue observeSingleSelectionExportFileTypeComboObserveWidget = WidgetProperties.singleSelectionIndex().observe(exportFileTypeCombo);
    IObservableValue exportFileTypeObserveValue = BeansObservables.observeValue(exportSettings, "exportFileType"); //$NON-NLS-1$
    UpdateValueStrategy combo2ExportFileTypeStrategy = new UpdateValueStrategy();
    combo2ExportFileTypeStrategy.setConverter(new ExportFileTypeComboSelection2ExportFileTypeConverter());
    UpdateValueStrategy exportFileType2ComboStrategy = new UpdateValueStrategy();
    exportFileType2ComboStrategy.setConverter(new ExportFileType2ExportFileTypeComboSelectionConverter());
    context.bindValue(observeSingleSelectionExportFileTypeComboObserveWidget, exportFileTypeObserveValue, combo2ExportFileTypeStrategy, exportFileType2ComboStrategy);
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    lblSelectJCo3Archive.setText(Messages.IDoc3ArchiveSelectionPage_SelectIDoc3Archive);
   
    textSelectIDoc3Archive = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textSelectIDoc3Archive.setMessage(Messages.IDoc3ArchiveSelectionPage_IDoc3ArchivePath);
    textSelectIDoc3Archive.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    binding = context.bindValue(SWTObservables.observeText(textSelectIDoc3Archive, SWT.Modify), BeansObservables.observeValue(idoc3ImportSettings, IDoc3ImportSettings.IDOC3_ARCHIVE_FILENAME), new UpdateValueStrategy().setAfterConvertValidator(new ArchiveNameValidator())  , new UpdateValueStrategy());
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
   
   
    btnSelectIDoc3Archive = new Button(top, SWT.NONE);
    btnSelectIDoc3Archive.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        getJCo3ArchiveFile();
      }
    });
    btnSelectIDoc3Archive.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    btnSelectIDoc3Archive.setText(Messages.ArchiveSelectionPage_Browse_text);
   
    lblArchiveVersion = new Label(top, SWT.NONE);
    GridData gd_lblArchiveVersion = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblArchiveVersion.horizontalIndent = 10;
    lblArchiveVersion.setLayoutData(gd_lblArchiveVersion);
    lblArchiveVersion.setText(Messages.ArchiveSelectionPage_lblArchiveVersion_text);
   
    textArchiveVersion = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textArchiveVersion.setEnabled(false);
    textArchiveVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    context.bindValue(SWTObservables.observeText(textArchiveVersion, SWT.Modify), BeansObservables.observeValue(idoc3ImportSettings, IDoc3ImportSettings.ARCHIVE_VERSION), new UpdateValueStrategy(), new UpdateValueStrategy());
   
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    lblSelectJCo3Archive.setText(Messages.BundleDeployPage_SelectJCo3BundlesExportLocationColon);
   
    textSelectJCo3BundleExportLocation = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textSelectJCo3BundleExportLocation.setMessage(Messages.ArchiveSelectionPage_JCo3ArchivePath_text_message);
    textSelectJCo3BundleExportLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    binding = context.bindValue(SWTObservables.observeText(textSelectJCo3BundleExportLocation, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "jco3BundlesExportLocation"), new UpdateValueStrategy().setAfterConvertValidator(new BundleLocationValidator())  , new UpdateValueStrategy());
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
    textSelectJCo3BundleExportLocation.setText(ImportUtils.getDefaultDeployLocation());
   
   
    btnSelectJCo3Archive = new Button(top, SWT.NONE);
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    lblSelectJCo3Archive.setText(Messages.ArchiveSelectionPage_JCo3SelectLable);
   
    textSelectJCo3Archive = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textSelectJCo3Archive.setMessage(Messages.ArchiveSelectionPage_JCo3ArchivePath_text_message);
    textSelectJCo3Archive.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    binding = context.bindValue(SWTObservables.observeText(textSelectJCo3Archive, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "jco3ArchiveFilename"), new UpdateValueStrategy().setAfterConvertValidator(new ArchiveNameValidator())  , new UpdateValueStrategy()); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
   
   
    btnSelectJCo3Archive = new Button(top, SWT.NONE);
    btnSelectJCo3Archive.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        getJCo3ArchiveFile();
      }
    });
    btnSelectJCo3Archive.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    btnSelectJCo3Archive.setText(Messages.ArchiveSelectionPage_Browse_text);
   
    lblArchiveOsPlatform = new Label(top, SWT.NONE);
    GridData gd_lblArchiveOsPlatform = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblArchiveOsPlatform.horizontalIndent = 10;
    lblArchiveOsPlatform.setLayoutData(gd_lblArchiveOsPlatform);
    lblArchiveOsPlatform.setText(Messages.ArchiveSelectionPage_lblArchiveOsPlatform_text);
   
    textArchiveOs = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textArchiveOs.setEnabled(false);
    textArchiveOs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    context.bindValue(SWTObservables.observeText(textArchiveOs, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "archiveOs"), new UpdateValueStrategy(), new UpdateValueStrategy()); //$NON-NLS-1$
   
    lblArchiveVersion = new Label(top, SWT.NONE);
    GridData gd_lblArchiveVersion = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblArchiveVersion.horizontalIndent = 10;
    lblArchiveVersion.setLayoutData(gd_lblArchiveVersion);
    lblArchiveVersion.setText(Messages.ArchiveSelectionPage_lblArchiveVersion_text);
   
    textArchiveVersion = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textArchiveVersion.setEnabled(false);
    textArchiveVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    context.bindValue(SWTObservables.observeText(textArchiveVersion, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "archiveVersion"), new UpdateValueStrategy(), new UpdateValueStrategy()); //$NON-NLS-1$
   
    Label lblEnterBundleName = new Label(top, SWT.NONE);
    lblEnterBundleName.setText(Messages.ArchiveSelectionPage_lblEnterBundleName_text);
   
    textEnterBundleName = new Text(top, SWT.BORDER);
    textEnterBundleName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    binding = context.bindValue(SWTObservables.observeText(textEnterBundleName, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "bundleName"), new UpdateValueStrategy().setAfterConvertValidator(new BundleNameValidator()), new UpdateValueStrategy()); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
    textEnterBundleName.setText(Messages.ArchiveSelectionPage_BundleNameDefault);
   
    Label lblEnterBundleVersion = new Label(top, SWT.NONE);
    lblEnterBundleVersion.setText(Messages.ArchiveSelectionPage_lblEnterBundleVersion_text);
   
    textEnterBundleVersion = new Text(top, SWT.BORDER);
    textEnterBundleVersion.setMessage(Messages.ArchiveSelectionPage_textEnterBundleVersion_message);
    textEnterBundleVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    binding = context.bindValue(SWTObservables.observeText(textEnterBundleVersion, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "bundleVersion"), new UpdateValueStrategy().setAfterConvertValidator(new BundleVersionValidator()), new UpdateValueStrategy().setAfterConvertValidator(new BundleVersionValidator())); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
   
    Label lblEnterBundleVendor = new Label(top, SWT.NONE);
    lblEnterBundleVendor.setText(Messages.ArchiveSelectionPage_lblEnterVendorName_text);
   
    textEnterBundleVendor = new Text(top, SWT.BORDER);
    textEnterBundleVendor.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    binding = context.bindValue(SWTObservables.observeText(textEnterBundleVendor, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, "bundleVendor"), new UpdateValueStrategy().setAfterConvertValidator(new BundleVendorValidator()), new UpdateValueStrategy()); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
    textEnterBundleVendor.setText(Messages.ArchiveSelectionPage_BundleVendorDefault);
   
    lblSelectRequiredExecution = new Label(top, SWT.NONE);
    lblSelectRequiredExecution.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblSelectRequiredExecution.setText(Messages.ArchiveSelectionPage_lblSelectRequiredExecution_text);
   
    comboSelectRequiredExectionEnvironment = new Combo(top, SWT.READ_ONLY);
    comboSelectRequiredExectionEnvironment.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    comboSelectRequiredExectionEnvironment.setItems(ImportUtils.getExecutionEnvironments());
    binding = context.bindValue(SWTObservables.observeSingleSelectionIndex(comboSelectRequiredExectionEnvironment), BeansObservables.observeValue(jcoImportSettings, "requiredExecutionEnvironment"), new UpdateValueStrategy().setAfterConvertValidator(new RequiredExecutionEnvironmentValidator())new UpdateValueStrategy()); //$NON-NLS-1$
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

    lblSelectJCo3Archive.setText(Messages.ArchiveSelectionPage_JCo3SelectLable);
   
    textSelectJCo3Archive = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textSelectJCo3Archive.setMessage(Messages.ArchiveSelectionPage_JCo3ArchivePath_text_message);
    textSelectJCo3Archive.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    binding = context.bindValue(SWTObservables.observeText(textSelectJCo3Archive, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, JCo3ImportSettings.JCO3_ARCHIVE_FILENAME), new UpdateValueStrategy().setAfterConvertValidator(new ArchiveNameValidator())  , new UpdateValueStrategy());
    ControlDecorationSupport.create(binding, SWT.TOP | SWT.LEFT);
   
   
    btnSelectJCo3Archive = new Button(top, SWT.NONE);
    btnSelectJCo3Archive.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        getJCo3ArchiveFile();
      }
    });
    btnSelectJCo3Archive.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    btnSelectJCo3Archive.setText(Messages.ArchiveSelectionPage_Browse_text);
   
    lblArchiveOsPlatform = new Label(top, SWT.NONE);
    GridData gd_lblArchiveOsPlatform = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblArchiveOsPlatform.horizontalIndent = 10;
    lblArchiveOsPlatform.setLayoutData(gd_lblArchiveOsPlatform);
    lblArchiveOsPlatform.setText(Messages.ArchiveSelectionPage_lblArchiveOsPlatform_text);
   
    textArchiveOs = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textArchiveOs.setEnabled(false);
    textArchiveOs.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    context.bindValue(SWTObservables.observeText(textArchiveOs, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, JCo3ImportSettings.ARCHIVE_OS), new UpdateValueStrategy(), new UpdateValueStrategy());
   
    lblArchiveVersion = new Label(top, SWT.NONE);
    GridData gd_lblArchiveVersion = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblArchiveVersion.horizontalIndent = 10;
    lblArchiveVersion.setLayoutData(gd_lblArchiveVersion);
    lblArchiveVersion.setText(Messages.ArchiveSelectionPage_lblArchiveVersion_text);
   
    textArchiveVersion = new Text(top, SWT.BORDER | SWT.READ_ONLY);
    textArchiveVersion.setEnabled(false);
    textArchiveVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    context.bindValue(SWTObservables.observeText(textArchiveVersion, SWT.Modify), BeansObservables.observeValue(jcoImportSettings, JCo3ImportSettings.ARCHIVE_VERSION), new UpdateValueStrategy(), new UpdateValueStrategy());
   
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

   
    //do the binding
    return dataBindingContext.bindValue(
        observedView.getValue(),
        observedValue,
        new UpdateValueStrategy().setConverter(new Converter(IMethod.class, String.class) {
         
          public Object convert(Object fromObject) {
            IField field = (IField)fromObject;
            String value = null;
           
            if (field != null)
              value = field.getElementName();
           
            return value;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has just been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
          }
         
        }),
        new UpdateValueStrategy().setConverter(
            new StringToFieldConverter(
                existingFields,
                observedView.getViewer()
                )
            ));     
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

   
    //do the binding
    return dataBindingContext.bindValue(
        observedView.getValue(),
        observedValue,
        new UpdateValueStrategy().setConverter(new Converter(IMethod.class, String.class) {
         
          public Object convert(Object fromObject) {
            IMethod method = (IMethod)fromObject;
            String value = null;
           
            if (method != null)
              value = method.getElementName();
           
            //remove node if value is set to empty
            if ("".equals(value.toString()) || value == null) {
              Element element = (Element)parent.getValue();
              element.removeAttribute(attrName);
              return null;
            }
           
            return value;
          }

        }).setBeforeSetValidator(new IValidator() {

          public IStatus validate(Object value) {
            //dont set value if it is null. Thus no parent node gets created.
            //The parent node has just been deleted in converter
            return value == null ? Status.CANCEL_STATUS : Status.OK_STATUS;
          }
         
        }),
        new UpdateValueStrategy().setConverter(new StringToMethodConverter(
            existingMethods,
            observedView.getViewer())));   
  }
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

   
    //do the binding
    return dataBindingContext.bindValue(
        observedView,
        observedValue,
        new UpdateValueStrategy().setConverter(new Converter(String.class, String.class) {
         
          public Object convert(Object fromObject) {
            //remove node if value is set to empty
            if ("".equals(fromObject.toString())) {
              Element element = (Element)parent.getValue();
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

   
    //do the binding
    return dataBindingContext.bindValue(
        observedView,
        observedValue,
        new UpdateValueStrategy().setConverter(new Converter(String.class, String.class) {
         
          public Object convert(Object fromObject) {
            Element element = (Element)((IObserving)observedElement).getObserved();
           
            //remove node if value is set to empty
View Full Code Here

Examples of org.eclipse.core.databinding.UpdateValueStrategy

        GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(lblPrice);

        getBindingContext().bindValue(
                        SWTObservables.observeText(lblPrice),
                        BeansObservables.observeValue(getModel(), "price"), //$NON-NLS-1$
                        new UpdateValueStrategy(false, UpdateValueStrategy.POLICY_UPDATE)
                                        .setConverter(new StringToCurrencyConverter(Values.Amount)), //
                        new UpdateValueStrategy(false, UpdateValueStrategy.POLICY_UPDATE)
                                        .setConverter(new CurrencyToStringConverter(Values.Amount)));

        // amount
        bindings().bindMandatoryAmountInput(editArea, Messages.ColumnAmount, "amount"); //$NON-NLS-1$
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.