/** Binds the UI */
  public void bindUI() {
    myContext = IBindingContext.Factory.createContext(myView.getScrolledForm());

    myViewerBinding =
        myContext.addViewer(myTableViewer, myShop, ShopPackage.Literals.SHOP__CONTACTS);
    myNameColumnBinding =
        myViewerBinding.addColumn(myNameColumn, IMOAOPackage.Literals.NAMED_OBJECT__NAME);
    myCountryColumnBinding =
        myViewerBinding
            .addColumn(myCountryColumn, ShopPackage.Literals.CONTACT__COUNTRY)
            .arg(Constants.ARG_FEATURE_NAME, "abbreviation")
            .validValues(myShop, ShopPackage.Literals.SHOP__COUNTRIES);
    myCountryNameColumnBinding =
        myCountryColumnBinding
            .addColumn(myCountryNameColumn, IMOAOPackage.Literals.NAMED_OBJECT__NAME)
            .readonly();

    final IObservableValue selection = myViewerBinding.getSingleSelection();

    myNameBinding =
        myContext.addBinding(myNameText, selection, IMOAOPackage.Literals.NAMED_OBJECT__NAME);

    myContext.finish();
    yield();
  }
Пример #2
0
  /** Binds the UI */
  public void bindUI() {
    myContext = IBindingContext.Factory.createContext(myView.getScrolledForm());

    myViewer = myContext.addViewer(myTable, myShop, ShopPackage.Literals.SHOP__COUNTRIES);
    myViewer.addColumn(myNameColumn, IMOAOPackage.Literals.NAMED_OBJECT__NAME);
    myViewer.addColumn(myAbbreviationColumn, ShopPackage.Literals.COUNTRY__ABBREVIATION);

    myContext.finish();
    yield();
  }