예제 #1
0
  @Override
  public void bind(final IEMFEditContext context) {
    super.bind(context);

    final IEMFEditListProperty emfProperty =
        EMFEditProperties.list(getEditingDomain(), getEFeature());
    fModelObservable = emfProperty.observeDetail(getBaseObservable());
    ((IObserving) fModelObservable).getObserved();

    fWidget.viewer.setInput(fModelObservable);
    fButtonGroup.connectTo(fWidget.viewer, fModelObservable, null);

    register(fWidget.table, IEFPropertyExpressions.EOBJECT_LIST_ID);
    fSelectionProvider = new ElementSourceSelectionProvider(fWidget.viewer, this);
    ViewerUtil.setSelectionProvider(fWidget.table, fSelectionProvider);

    {
      final int operations = (DND.DROP_DEFAULT | DND.DROP_COPY | DND.DROP_MOVE);
      final Transfer[] transfers = new Transfer[] {LocalTransfer.getInstance()};
      fWidget.viewer.addDragSupport(operations, transfers, new ViewerDragAdapter(fWidget.viewer));
      fWidget.viewer.addDropSupport(
          operations,
          transfers,
          new EditingDomainViewerDropAdapter(getEditingDomain(), fWidget.viewer));
    }

    fSingleSelectionObservable = ViewersObservables.observeSinglePostSelection(fWidget.viewer);

    fButtonGroup.updateState();
  }
  @Override
  protected void updateControls() {
    loadValues();
    this.listViewer.refresh();
    this.listButtons.updateState();

    ViewerUtil.scheduleStandardSelection(this.listViewer);
  }