Ejemplo n.º 1
0
  private void enableOrDisableImmediate() {
    boolean isService = false;
    boolean isFactory =
        fComponent.getFactory() != null && !fComponent.getFactory().equals(""); // $NON-NLS-1$
    boolean isImmediate = fComponent.getImmediate();
    boolean enabled = true;

    if (fComponent.getService() != null) {
      IDSProvide[] providedServices = fComponent.getService().getProvidedServices();
      if (providedServices != null && providedServices.length > 0) {
        isService = true;
      }
    }
    if (!isService && !isFactory && !isImmediate) {
      enabled = false;
    }

    fImmediateButton.setEnabled(enabled);
  }
Ejemplo n.º 2
0
  public void setListeners() {
    // Attribute: factory
    fFactoryEntry.setFormEntryListener(
        new FormEntryAdapter(this) {
          @Override
          public void textValueChanged(FormEntry entry) {
            // Ensure data object is defined
            if (fComponent == null) {
              return;
            }
            fComponent.setFactory(fFactoryEntry.getValue());
          }
        });

    fConfigurationPolicy.addModifyListener(
        e -> {
          // Ensure data object is defined
          if (fComponent == null) {
            return;
          }
          fComponent.setConfigurationPolicy(fConfigurationPolicy.getSelection());
        });
  }
Ejemplo n.º 3
0
  public void updateUIFields() {
    if (fComponent != null) {
      if (fComponent.getFactory() == null) {
        // Attribute: factory
        fFactoryEntry.setValue("", true); // $NON-NLS-1$
      } else {
        // Attribute: factory
        fFactoryEntry.setValue(fComponent.getFactory(), true);
      }

      fEnabledButton.setSelection(fComponent.getEnabled());
      fImmediateButton.setSelection(fComponent.getImmediate());
      enableOrDisableImmediate();

      // Attribute: Policy
      if (fComponent.getConfigurationPolicy() != null)
        fConfigurationPolicy.setText(fComponent.getConfigurationPolicy());
    }
  }