Пример #1
0
  /**
   * Create a new InterfaceControlComposite.
   *
   * @param container the container
   * @param parent the parent composite
   * @param style the style bits
   */
  public ContractControlComposite(ICompositeContainer container, Composite parent, int style) {
    super(Contract.class, container, parent, style);

    _serviceControl =
        new ContractControl(
            ScaPackage.eINSTANCE.getService(),
            null,
            EnumSet.of(InterfaceType.Java, InterfaceType.WSDL, InterfaceType.ESB));

    int numColumns = 3;
    setLayout(new GridLayout(numColumns, false));

    _serviceControl.createControl(this, numColumns);
    _serviceControl.addSelectionChangedListener(
        new ISelectionChangedListener() {
          @Override
          public void selectionChanged(SelectionChangedEvent event) {
            if (!_inUpdate) {
              getContainer().validated(_serviceControl.getStatus());
            }
          }
        });

    adaptChildren(this);
  }
Пример #2
0
 @Override
 public void refresh() {
   _inUpdate = true;
   Contract contract = getTargetObject();
   if (contract != null) {
     _serviceControl.setSelection(new StructuredSelection(contract));
   }
   _inUpdate = false;
 }