Package org.eclipse.core.databinding

Examples of org.eclipse.core.databinding.DataBindingContext


      public void modifyText(ModifyEvent e) {
        service.setName(nameText.getText());
      }
    });

    bindingContext = new DataBindingContext();
    map = new WritableMap();

    WizardPageSupport.create(this, bindingContext);

    bindingContext.bindValue(SWTObservables.observeText(nameText, SWT.Modify),
View Full Code Here


    label = new Label(container, SWT.NULL);
    label.setToolTipText(getCaption("filterWizard.tooltip.query"));
    label.setImage(help);

    // add WizardPage validators
    DataBindingContext dbc = new DataBindingContext();
    WizardPageSupport.create(this, dbc);
    dbc.bindValue(SWTObservables.observeText(nameText, SWT.Modify),
        nameValue, new UpdateValueStrategy()
            .setBeforeSetValidator(new FilterNameValidator()), null);
    dbc.bindValue(SWTObservables.observeText(queryText, SWT.Modify),
        queryValue, new UpdateValueStrategy()
            .setBeforeSetValidator(new JSONValidator()), null);

    setControl(container);
    // disable save until everything matches
View Full Code Here

     */
    label = new Label(container, SWT.NULL);
    label.setText("Auth not supported yet...");

    // add WizardPage validators
    DataBindingContext dbc = new DataBindingContext();
    WizardPageSupport.create(this, dbc);

    dbc.bindValue(SWTObservables.observeText(connName, SWT.Modify),
        nameValue, new UpdateValueStrategy()
            .setBeforeSetValidator(new NameValidator()), null);
    dbc.bindValue(SWTObservables.observeText(host, SWT.Modify), hostValue,
        new UpdateValueStrategy()
            .setBeforeSetValidator(new HostNameValidator()), null);
    dbc.bindValue(SWTObservables.observeText(port, SWT.Modify), portValue,
        new UpdateValueStrategy()
            .setBeforeSetValidator(new PortValidator()), null);

    initialize();
    setControl(container);
View Full Code Here

      }
    });
    btnDeleteSource.setBounds(440, 51, 100, 30);
    btnDeleteSource.setText(MusicMessages.ManageSourcesDialog_4);

    m_bindingContext = new DataBindingContext();

    table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION);
    table.setBounds(10, 15, 424, 248);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
View Full Code Here

  public InsertMeasuresDialogWrapper getWrapper() {
    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

    btnInsertNewStaff
        .setText("Insert new Staff elements into existing Measures");
    btnInsertNewStaff
    .setToolTipText("Insert new Staff elements into existing Measures");

    m_bindingContext = new DataBindingContext();
    table = new Table(grpStaffdefProperties, SWT.BORDER
        | SWT.FULL_SELECTION);
    table.setBounds(10, 15, 312, 193);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);

    // see mysteriousTableViewer
    tableViewer = new TableViewer(table);
    tableViewer.getTable().setHeaderVisible(true);
    tableViewer.getTable().setLinesVisible(true);

    TableViewerColumn clefShapeColumn = new TableViewerColumn(tableViewer,
        SWT.BORDER);
    clefShapeColumn.getColumn().setText("Clefshape");
    clefShapeColumn.getColumn().setToolTipText("Clefshape help");
    clefShapeColumn.getColumn().setWidth(100);
    TableViewerColumn keySigColumn = new TableViewerColumn(tableViewer,
        SWT.BORDER);
    keySigColumn.getColumn().setText("KeySig");
    keySigColumn.getColumn().setToolTipText("KeySig help");
    keySigColumn.getColumn().setWidth(100);
    TableViewerColumn meterCountColumn = new TableViewerColumn(tableViewer,
        SWT.BORDER);
    meterCountColumn.getColumn().setText("MeterCount");
    meterCountColumn.getColumn().setToolTipText("MeterCount help");
    meterCountColumn.getColumn().setWidth(55);
    TableViewerColumn meterUnitColumn = new TableViewerColumn(tableViewer,
        SWT.BORDER);
    meterUnitColumn.getColumn().setText("MeterUnit");
    meterUnitColumn.getColumn().setToolTipText("MeterUnit help");
    meterUnitColumn.getColumn().setWidth(55);

    tableViewer.setLabelProvider(new ITableLabelProvider() {
      @Override
      public void addListener(ILabelProviderListener listener) {
      }

      @Override
      public void dispose() {
      }

      @Override
      public Image getColumnImage(Object element, int columnIndex) {
        return null;
      }

      @Override
      public String getColumnText(Object element, int columnIndex) {
        switch (columnIndex) {
        case 0:
          return ((InsertStaffDefsDialogEntryWrapper) element)
              .getClefShape().name();
        case 1:
          return ((InsertStaffDefsDialogEntryWrapper) element)
              .getKeySigValue();
        case 2:
          return ((InsertStaffDefsDialogEntryWrapper) element)
              .getMeterCount();
        case 3:
          return ((InsertStaffDefsDialogEntryWrapper) element)
              .getMeterUnit();
        default:
          return element.toString();
        }
      }

      @Override
      public boolean isLabelProperty(Object element, String property) {
        return false;
      }

      @Override
      public void removeListener(ILabelProviderListener listener) {
      }
    });

    tableViewer.setContentProvider(new ObservableListContentProvider());
    tableViewer.setInput(writableList);

    DataBindingContext ctx = new DataBindingContext();

    meterUnitColumn.setEditingSupport(new ObservableValueEditingSupport(
        tableViewer, ctx) {
      private TextCellEditor textEditor;
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);
    //
    return bindingContext;
View Full Code Here

    if (typeText!=null){
      typeText.setText(typeName);
    }
  }
  protected DataBindingContext initDataBindings() {
    DataBindingContext bindingContext = new DataBindingContext();
    //
    return bindingContext;
  }
View Full Code Here

    if (this.constant != null && this.nameText != null){
      m_bindingContext = initDataBindings();
    }
  }
  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

  public void setAttribute(ToolAttribute attribute) {
    this.attribute = attribute;
  }
 
  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

TOP

Related Classes of org.eclipse.core.databinding.DataBindingContext

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.