Package org.eclipse.core.databinding.observable.value

Examples of org.eclipse.core.databinding.observable.value.IObservableValue


            + buttonSize.y);
        addKeyMenu.setVisible(true);
      }
    });

    final IObservableValue selection = ViewersObservables
        .observeSingleSelection(filteredTree.getViewer());

    // The when label.
    final Label whenLabel = new Label(leftDataArea, SWT.NONE);
    whenLabel.setText(NewKeysPreferenceMessages.WhenLabel_Text);

    // The when combo.
    whenCombo = new ComboViewer(leftDataArea);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = SWT.FILL;
    gridData.horizontalSpan = 2;
    whenCombo.getCombo().setLayoutData(gridData);
    whenCombo.setLabelProvider(new NamedHandleObjectLabelProvider());
    whenCombo.setContentProvider(new ArrayContentProvider());
    whenCombo.setComparator(new ViewerComparator());
    whenCombo
        .addPostSelectionChangedListener(new ISelectionChangedListener() {

          public void selectionChanged(SelectionChangedEvent event) {
            updateWhenCombo();
          }
        });

    whenCombo.getCombo().setVisibleItemCount(20);
    whenCombo.getCombo().setVisible(false);
    whenLabel.setVisible(false);
    selection.addValueChangeListener(new IValueChangeListener() {

      public void handleValueChange(ValueChangeEvent event) {
        boolean visible = false;
        if (selection.getValue() instanceof KeyBinding) {
          visible = true;
        }
        Combo combo = whenCombo.getCombo();
        if (!combo.isDisposed()) {
          combo.setVisible(visible);
View Full Code Here


      public void widgetSelected(SelectionEvent e) {
        updateShowAll();
      }
    });

    final IObservableValue selection = ViewersObservables
        .observeSingleSelection(filteredTree.getViewer());

    // Create the delete binding button.
    final Button addBindingButton = new Button(treeControls, SWT.PUSH);
    gridData = new GridData();
    widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    addBindingButton
        .setText(NewKeysPreferenceMessages.AddBindingButton_Text);
    gridData.widthHint = Math.max(widthHint, addBindingButton.computeSize(
        SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
    addBindingButton.setLayoutData(gridData);
    addBindingButton.addSelectionListener(new SelectionAdapter() {
      public final void widgetSelected(final SelectionEvent event) {
        selectAddBindingButton(event);
      }
    });
    new ControlUpdater(addBindingButton) {
      protected void updateControl() {
        Object selectedObject = selection.getValue();
        addBindingButton
            .setEnabled(selectedObject instanceof KeyBinding);
      }
    };

    // Create the delete binding button.
    final Button removeBindingButton = new Button(treeControls, SWT.PUSH);
    gridData = new GridData();
    widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
    removeBindingButton
        .setText(NewKeysPreferenceMessages.RemoveBindingButton_Text);
    gridData.widthHint = Math.max(widthHint, removeBindingButton
        .computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x) + 5;
    removeBindingButton.setLayoutData(gridData);
    removeBindingButton.addSelectionListener(new SelectionAdapter() {
      public final void widgetSelected(final SelectionEvent event) {
        selectRemoveBindingButton(event);
      }
    });
    new ControlUpdater(removeBindingButton) {
      protected void updateControl() {
        Object selectedObject = selection.getValue();
        removeBindingButton
            .setEnabled(selectedObject instanceof KeyBinding);
      }
    };
View Full Code Here

    return wrapper;
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue spinnerObserveSelectionObserveWidget = SWTObservables.observeSelection(spinner);
    IObservableValue wrapperMeasuresNumberOfNewMeasuresObserveValue = PojoObservables.observeValue(wrapper, "measuresNumberOfNewMeasures");
    bindingContext.bindValue(spinnerObserveSelectionObserveWidget, wrapperMeasuresNumberOfNewMeasuresObserveValue, null, null);
    //
    IObservableValue btnCreateNewSectionObserveSelectionObserveWidget = SWTObservables.observeSelection(btnCreateNewSection);
    IObservableValue wrapperMeasuresCreateNewSectionObserveValue = PojoObservables.observeValue(wrapper, "measuresCreateNewSection");
    bindingContext.bindValue(btnCreateNewSectionObserveSelectionObserveWidget, wrapperMeasuresCreateNewSectionObserveValue, null, null);
    //
    IObservableValue btnCreateNewStaffsObserveSelectionObserveWidget = SWTObservables.observeSelection(btnCreateNewStaffs);
    IObservableValue wrapperMeasuresMeasureContainsStaffsAndLayersObserveValue = PojoObservables.observeValue(wrapper, "measuresMeasureContainsStaffsAndLayers");
    bindingContext.bindValue(btnCreateNewStaffsObserveSelectionObserveWidget, wrapperMeasuresMeasureContainsStaffsAndLayersObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

  }

  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();

    IObservableValue btnCreateANewObserveSelectionObserveWidget = SWTObservables
        .observeSelection(btnCreateANew);
    IObservableValue contentWrapperStaffDefsCreateNewStaffGroupObserveValue = PojoObservables
        .observeValue(contentWrapper, "staffDefsCreateNewStaffGroup");
    bindingContext.bindValue(btnCreateANewObserveSelectionObserveWidget,
        contentWrapperStaffDefsCreateNewStaffGroupObserveValue, null,
        null);

    IObservableValue btnInsertNewStaffObserveSelectionObserveWidget = SWTObservables
        .observeSelection(btnInsertNewStaff);
    IObservableValue contentWrapperStaffDefsFillMeasuresWithStaffsObserveValue = PojoObservables
        .observeValue(contentWrapper, "staffDefsFillMeasuresWithStaffs");
    bindingContext.bindValue(
        btnInsertNewStaffObserveSelectionObserveWidget,
        contentWrapperStaffDefsFillMeasuresWithStaffsObserveValue,
        null, null);
View Full Code Here

    }
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue nameTextObserveTextObserveWidget = SWTObservables.observeText(nameText, SWT.Modify);
    IObservableValue constantNameObserveValue = BeansObservables.observeValue(constant, "toolName");
    bindingContext.bindValue(nameTextObserveTextObserveWidget, constantNameObserveValue, null, null);
    //
    IObservableValue valueTextObserveTextObserveWidget = SWTObservables.observeText(valueText, SWT.Modify);
    IObservableValue constantValueObserveValue = BeansObservables.observeValue(constant, "value");
    bindingContext.bindValue(valueTextObserveTextObserveWidget, constantValueObserveValue, null, null);
    //
    IObservableValue publicCheckButtonObserveSelectionObserveWidget = SWTObservables.observeSelection(publicCheckButton);
    IObservableValue constantPublicObserveValue = BeansObservables.observeValue(constant, "public");
    bindingContext.bindValue(publicCheckButtonObserveSelectionObserveWidget, constantPublicObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

  }
 
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue nameTextObserveTextObserveWidget = SWTObservables.observeText(nameText, SWT.Modify);
    IObservableValue attributeNameObserveValue = BeansObservables.observeValue(attribute, "toolName");
    UpdateValueStrategy strategy = new UpdateValueStrategy();
    if (this.attribute instanceof ToolWindowAttribute){
      strategy.setAfterConvertValidator(new ToolNameValidatorWithBrackets(nameText));
    } else {
      strategy.setAfterConvertValidator(new ToolNameValidator(nameText));
    }
    bindingContext.bindValue(nameTextObserveTextObserveWidget, attributeNameObserveValue, strategy, null);
    //
    IObservableValue typeTextObserveTextObserveWidget = SWTObservables.observeText(typeText, SWT.Modify);
    IObservableValue attributeTypeObserveValue = BeansObservables.observeValue(attribute, "type");
    bindingContext.bindValue(typeTextObserveTextObserveWidget, attributeTypeObserveValue, null, null);
    //
    IObservableValue btnCheckButtonObserveSelectionObserveWidget = SWTObservables.observeSelection(btnCheckButton);
    IObservableValue attributePublicObserveValue = BeansObservables.observeValue(attribute, "public");
    bindingContext.bindValue(btnCheckButtonObserveSelectionObserveWidget, attributePublicObserveValue, null, null);
    //
    IObservableValue nameTextObserveEditableObserveWidget = SWTObservables.observeEditable(nameText);
    IObservableValue attributeReadWriteObserveValue = BeansObservables.observeValue(attribute, "readWrite");
    bindingContext.bindValue(nameTextObserveEditableObserveWidget, attributeReadWriteObserveValue, null, null);
    //
    IObservableValue typeTextObserveEditableObserveWidget = SWTObservables.observeEditable(typeText);
    bindingContext.bindValue(typeTextObserveEditableObserveWidget, attributeReadWriteObserveValue, null, null);
    //
    IObservableValue btnCheckButtonObserveEnabledObserveWidget = SWTObservables.observeEnabled(btnCheckButton);
    bindingContext.bindValue(btnCheckButtonObserveEnabledObserveWidget, attributeReadWriteObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

    this.cls = cls;
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue projectTextObserveTextObserveWidget = SWTObservables.observeText(projectText, SWT.FocusOut);
    IObservableValue planNameObserveValue = BeansObservables.observeValue(plan, "toolName");
    bindingContext.bindValue(projectTextObserveTextObserveWidget, planNameObserveValue, null, null);
    //
    IObservableValue classNameTextObserveTextObserveWidget = SWTObservables.observeText(classNameText, SWT.FocusOut);
    IObservableValue clsNameObserveValue = BeansObservables.observeValue(cls, "toolName");
    bindingContext.bindValue(classNameTextObserveTextObserveWidget, clsNameObserveValue, null, null);
    //
    IObservableValue btnWindowClassObserveSelectionObserveWidget = SWTObservables.observeSelection(btnWindowClass);
    IObservableValue clsMappedObserveValue = BeansObservables.observeValue(cls, "mapped");
    bindingContext.bindValue(btnWindowClassObserveSelectionObserveWidget, clsMappedObserveValue, null, null);
    //
    IObservableValue superClassTextObserveTextObserveWidget = SWTObservables.observeText(superClassText, SWT.FocusOut);
    IObservableValue clsSuperClassObserveValue = BeansObservables.observeValue(cls, "superClass");
    bindingContext.bindValue(superClassTextObserveTextObserveWidget, clsSuperClassObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

    return new Point(523, 300);
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue textObserveTextObserveWidget = SWTObservables.observeText(text, SWT.Modify);
    IObservableValue eventNameObserveValue = BeansObservables.observeValue(event, "toolName");
    UpdateValueStrategy strategy = new UpdateValueStrategy();
    strategy.setAfterConvertValidator(new ToolNameValidator(text));
    bindingContext.bindValue(textObserveTextObserveWidget, eventNameObserveValue, strategy, null);
    //
    IObservableValue buttonObserveSelectionObserveWidget = SWTObservables.observeSelection(button);
    IObservableValue eventPublicObserveValue = BeansObservables.observeValue(event, "public");
    bindingContext.bindValue(buttonObserveSelectionObserveWidget, eventPublicObserveValue, null, null);
    //
    ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
    tableViewer.setContentProvider(listContentProvider);
    //
View Full Code Here

    }
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue soClassTextObserveTextObserveWidget = SWTObservables.observeText(soClassText, SWT.Modify);
    IObservableValue soTypeObserveValue = BeansObservables.observeValue(so, "type");
    bindingContext.bindValue(soClassTextObserveTextObserveWidget, soTypeObserveValue, null, null);
    //
    IObservableValue dialogDurationComboObserveSelectionObserveWidget = SWTObservables.observeSelection(dialogDurationCombo);
    IObservableValue soDialogDurationObserveValue = BeansObservables.observeValue(so, "dialogDuration");
    bindingContext.bindValue(dialogDurationComboObserveSelectionObserveWidget, soDialogDurationObserveValue, null, null);
    //
    IObservableValue uUIDTextObserveTextObserveWidget = SWTObservables.observeText(UUIDText, SWT.NONE);
    IObservableValue soUuidObserveValue = BeansObservables.observeValue(so, "uuid");
    bindingContext.bindValue(uUIDTextObserveTextObserveWidget, soUuidObserveValue, null, null);
    //
    IObservableValue visabilityComboObserveSelectionObserveWidget = SWTObservables.observeSelection(visabilityCombo);
    IObservableValue soVisabilityObserveValue = BeansObservables.observeValue(so, "visability");
    bindingContext.bindValue(visabilityComboObserveSelectionObserveWidget, soVisabilityObserveValue, null, null);
    //
    IObservableValue btnLoadBalancedObserveSelectionObserveWidget = SWTObservables.observeSelection(btnLoadBalanced);
    IObservableValue soLoadBalanceObserveValue = BeansObservables.observeValue(so, "loadBalance");
    bindingContext.bindValue(btnLoadBalancedObserveSelectionObserveWidget, soLoadBalanceObserveValue, null, null);
    //
    IObservableValue soNameTextObserveTextObserveWidget = SWTObservables.observeText(soNameText, SWT.Modify);
    IObservableValue soToolNameObserveValue = BeansObservables.observeValue(so, "toolName");
    UpdateValueStrategy strategy = new UpdateValueStrategy();
    strategy.setAfterConvertValidator(new ToolNameValidator(soNameText));
    bindingContext.bindValue(soNameTextObserveTextObserveWidget, soToolNameObserveValue, strategy, null);
    //
    IObservableValue searchPathTextObserveTextObserveWidget = SWTObservables.observeText(searchPathText, SWT.Modify);
    IObservableValue soSearchPathObserveValue = BeansObservables.observeValue(so, "searchPath");
    bindingContext.bindValue(searchPathTextObserveTextObserveWidget, soSearchPathObserveValue, null, null);
    //
    IObservableValue resourceNameTextObserveTextObserveWidget = SWTObservables.observeText(resourceNameText, SWT.Modify);
    IObservableValue soResourceNameObserveValue = BeansObservables.observeValue(so, "resourceName");
    bindingContext.bindValue(resourceNameTextObserveTextObserveWidget, soResourceNameObserveValue, null, null);
    //
    IObservableValue userNameTextObserveTextObserveWidget = SWTObservables.observeText(userNameText, SWT.Modify);
    IObservableValue soUserNameObserveValue = BeansObservables.observeValue(so, "userName");
    bindingContext.bindValue(userNameTextObserveTextObserveWidget, soUserNameObserveValue, null, null);
    //
    IObservableValue userPasswordTextObserveTextObserveWidget = SWTObservables.observeText(userPasswordText, SWT.Modify);
    IObservableValue soUserPasswordObserveValue = BeansObservables.observeValue(so, "userPassword");
    bindingContext.bindValue(userPasswordTextObserveTextObserveWidget, soUserPasswordObserveValue, null, null);
    //
    IObservableValue managerTextObserveTextObserveWidget = SWTObservables.observeText(managerText, SWT.Modify);
    IObservableValue soExternalManagerObserveValue = BeansObservables.observeValue(so, "externalManager");
    bindingContext.bindValue(managerTextObserveTextObserveWidget, soExternalManagerObserveValue, null, null);
    //
    IObservableValue lookupButtonObserveVisibleObserveWidget = SWTObservables.observeVisible(lookupButton);
    IObservableValue soToolSOObserveValue = BeansObservables.observeValue(so, "toolSO");
    bindingContext.bindValue(lookupButtonObserveVisibleObserveWidget, soToolSOObserveValue, null, null);
    //
    IObservableValue soClassTextObserveEditableObserveWidget = SWTObservables.observeEditable(soClassText);
    bindingContext.bindValue(soClassTextObserveEditableObserveWidget, soToolSOObserveValue, null, null);
    //
    IObservableValue lblManagerObserveVisibleObserveWidget = SWTObservables.observeVisible(lblManager);
    IObservableValue soDatabaseSOObserveValue = BeansObservables.observeValue(so, "databaseSO");
    bindingContext.bindValue(lblManagerObserveVisibleObserveWidget, soDatabaseSOObserveValue, null, null);
    //
    IObservableValue managerTextObserveVisibleObserveWidget = SWTObservables.observeVisible(managerText);
    bindingContext.bindValue(managerTextObserveVisibleObserveWidget, soDatabaseSOObserveValue, null, null);
    //
    IObservableValue lblUserNameObserveVisibleObserveWidget = SWTObservables.observeVisible(lblUserName);
    IObservableValue soDBSessionSOObserveValue = BeansObservables.observeValue(so, "DBSessionSO");
    bindingContext.bindValue(lblUserNameObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    IObservableValue userNameTextObserveVisibleObserveWidget = SWTObservables.observeVisible(userNameText);
    bindingContext.bindValue(userNameTextObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    IObservableValue lblUserPasswordObserveVisibleObserveWidget = SWTObservables.observeVisible(lblUserPassword);
    bindingContext.bindValue(lblUserPasswordObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    IObservableValue userPasswordTextObserveVisibleObserveWidget = SWTObservables.observeVisible(userPasswordText);
    bindingContext.bindValue(userPasswordTextObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    IObservableValue lblResourceManagerObserveVisibleObserveWidget = SWTObservables.observeVisible(lblResourceManager);
    bindingContext.bindValue(lblResourceManagerObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    IObservableValue resourceNameTextObserveVisibleObserveWidget = SWTObservables.observeVisible(resourceNameText);
    bindingContext.bindValue(resourceNameTextObserveVisibleObserveWidget, soDBSessionSOObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

    }
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    IObservableValue nameTextObserveTextObserveWidget = SWTObservables.observeText(nameText, SWT.Modify);
    IObservableValue constantNameObserveValue = BeansObservables.observeValue(constant, "toolName");
    bindingContext.bindValue(nameTextObserveTextObserveWidget, constantNameObserveValue, null, null);
    //
    IObservableValue valueTextObserveTextObserveWidget = SWTObservables.observeText(valueText, SWT.Modify);
    IObservableValue constantValueObserveValue = BeansObservables.observeValue(constant, "value");
    bindingContext.bindValue(valueTextObserveTextObserveWidget, constantValueObserveValue, null, null);
    //
    IObservableValue publicCheckButtonObserveSelectionObserveWidget = SWTObservables.observeSelection(publicCheckButton);
    IObservableValue constantPublicObserveValue = BeansObservables.observeValue(constant, "public");
    bindingContext.bindValue(publicCheckButtonObserveSelectionObserveWidget, constantPublicObserveValue, null, null);
    //
    return bindingContext;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.databinding.observable.value.IObservableValue

Copyright © 2018 www.massapicom. 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.