@Override
  protected WizardModel buildModelSteps(
      final Serializable modelObject, final WizardModel wizardModel) {
    ConnInstanceTO connInstanceTO = ConnInstanceTO.class.cast(modelObject);
    wizardModel.add(new ConnectorDetailsPanel(connInstanceTO, bundles));
    wizardModel.add(
        new ConnectorConfPanel(connInstanceTO, bundles) {

          private static final long serialVersionUID = -5886691077681158494L;

          @Override
          protected Pair<Boolean, String> check(final AjaxRequestTarget target) {
            ConnInstanceTO connInstanceTO = ConnInstanceTO.class.cast(modelObject);
            ConnBundleTO bundleTO = ConnectorWizardBuilder.getBundle(connInstanceTO, bundles);

            connInstanceTO.setConnectorName(bundleTO.getConnectorName());
            connInstanceTO.setBundleName(bundleTO.getBundleName());
            connInstanceTO.setVersion(bundleTO.getVersion());

            return connectorRestClient.check(connInstanceTO);
          }

          @Override
          protected void onComponentTag(final ComponentTag tag) {
            tag.append("class", "scrollable-tab-content", " ");
          }
        });
    wizardModel.add(
        new ConnCapabilitiesPanel(
            new PropertyModel<List<ConnectorCapability>>(connInstanceTO, "capabilities")));
    return wizardModel;
  }
Exemple #2
0
  /**
   * Construct.
   *
   * @param id The component id
   */
  public NewUserWizard(String id) {
    super(id);

    // create a blank user
    user = new User();

    setDefaultModel(new CompoundPropertyModel<>(this));
    WizardModel model = new WizardModel();
    model.add(new UserNameStep());
    model.add(new UserDetailsStep());
    model.add(new UserRolesStep());
    model.add(new ConfirmationStep());

    // initialize the wizard with the wizard model we just built
    init(model);
  }