@Override
 public void setTargetObject(EObject target) {
   super.setTargetObject(target);
   if (_opSelectorComposite != null && !_opSelectorComposite.isDisposed()) {
     _opSelectorComposite.setTargetObject((EObject) target);
   }
 }
Ejemplo n.º 2
0
  @Override
  public void createContents(Composite parent, int style) {
    _panel = new Composite(parent, style);
    _panel.setLayout(new FillLayout());
    if (getRootGridData() != null) {
      _panel.setLayoutData(getRootGridData());
    }

    getSchedulerTabControl(_panel);

    if (getTargetObject() != null && getTargetObject() instanceof Service) {
      if (_opSelectorComposite != null && !_opSelectorComposite.isDisposed()) {
        _opSelectorComposite.setTargetObject((EObject) getTargetObject());
      }
    }
  }
  @Override
  public void setBinding(Binding impl) {
    super.setBinding(impl);
    if (impl instanceof CamelMailBindingType) {
      _binding = (CamelMailBindingType) impl;

      _bindingValue.setValue(_binding);

      if (_binding.getConsume() == null) {
        TransactionalEditingDomain domain = getDomain(_binding);
        if (domain != null) {
          domain
              .getCommandStack()
              .execute(
                  new RecordingCommand(domain) {
                    protected void doExecute() {
                      _binding.setConsume(MailFactory.eINSTANCE.createCamelMailConsumerType());
                    }
                  });
        } else {
          _binding.setConsume(MailFactory.eINSTANCE.createCamelMailConsumerType());
        }
      }

      // refresh the operation selector control
      if (_opSelectorComposite != null
          && !_opSelectorComposite.isDisposed()
          && getTargetObject() != null) {
        _opSelectorComposite.setTargetObject(getTargetObject());
      }

      _opSelectorComposite.setBinding(_binding);
    } else {
      _bindingValue.setValue(null);
    }
  }