Package org.apache.syncope.console.wicket.markup.html.form

Examples of org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel


        form.add(events);

        final UserSearchPanel recipients = new UserSearchPanel("recipients", notificationTO.getRecipients());
        form.add(recipients);

        final AjaxCheckBoxPanel selfAsRecipient = new AjaxCheckBoxPanel("selfAsRecipient",
                getString("selfAsRecipient"), new PropertyModel(notificationTO, "selfAsRecipient"));
        form.add(selfAsRecipient);

        AjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
View Full Code Here


                "jobActionsClassName", getString("actionsClass"), new PropertyModel(taskTO, "jobActionsClassName"));
        actionsClassName.setChoices(classNames.getObject());
        actionsClassName.setStyleShet("ui-widget-content ui-corner-all long_dynamicsize");
        profile.add(actionsClassName);

        final AjaxCheckBoxPanel creates = new AjaxCheckBoxPanel("performCreate", getString("creates"),
                new PropertyModel<Boolean>(taskTO, "performCreate"));
        profile.add(creates);

        final AjaxCheckBoxPanel updates = new AjaxCheckBoxPanel("performUpdate", getString("updates"),
                new PropertyModel<Boolean>(taskTO, "performUpdate"));
        profile.add(updates);

        final AjaxCheckBoxPanel deletes = new AjaxCheckBoxPanel("performDelete", getString("updates"),
                new PropertyModel<Boolean>(taskTO, "performDelete"));
        profile.add(deletes);

        final AjaxCheckBoxPanel status = new AjaxCheckBoxPanel("syncStatus", getString("status"),
                new PropertyModel<Boolean>(taskTO, "syncStatus"));
        profile.add(status);

        final AjaxCheckBoxPanel fullReconciliation = new AjaxCheckBoxPanel("fullReconciliation",
                getString("fullReconciliation"), new PropertyModel<Boolean>(taskTO, "fullReconciliation"));
        profile.add(fullReconciliation);
    }
View Full Code Here

        resourceName.setEnabled(createFlag);
        resourceName.addRequiredLabel();
        add(resourceName);

        final AjaxCheckBoxPanel forceMandatoryConstraint = new AjaxCheckBoxPanel("forceMandatoryConstraint",
                new ResourceModel("forceMandatoryConstraint", "forceMandatoryConstraint").getObject(),
                new PropertyModel<Boolean>(resourceTO, "forceMandatoryConstraint"));
        add(forceMandatoryConstraint);

        final AjaxCheckBoxPanel propagationPrimary = new AjaxCheckBoxPanel("propagationPrimary", new ResourceModel(
                "propagationPrimary", "propagationPrimary").getObject(), new PropertyModel<Boolean>(resourceTO,
                "propagationPrimary"));
        add(propagationPrimary);

        final AjaxNumberFieldPanel propagationPriority = new AjaxNumberFieldPanel("propagationPriority",
                new ResourceModel("propagationPriority", "propagationPriority").getObject(), new PropertyModel<Number>(
                        resourceTO, "propagationPriority"), Integer.class);
        add(propagationPriority);

        final AjaxDropDownChoicePanel<PropagationMode> propagationMode = new AjaxDropDownChoicePanel<PropagationMode>(
                "propagationMode", new ResourceModel("propagationMode", "propagationMode").getObject(),
                new PropertyModel(resourceTO, "propagationMode"));
        propagationMode.setChoices(Arrays.asList(PropagationMode.values()));
        add(propagationMode);

        final AjaxDropDownChoicePanel<TraceLevel> createTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
                "createTraceLevel", new ResourceModel("createTraceLevel", "createTraceLevel").getObject(),
                new PropertyModel(resourceTO, "createTraceLevel"));
        createTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
        add(createTraceLevel);

        final AjaxDropDownChoicePanel<TraceLevel> updateTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
                "updateTraceLevel", new ResourceModel("updateTraceLevel", "updateTraceLevel").getObject(),
                new PropertyModel(resourceTO, "updateTraceLevel"));
        updateTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
        add(updateTraceLevel);

        final AjaxDropDownChoicePanel<TraceLevel> deleteTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
                "deleteTraceLevel", new ResourceModel("deleteTraceLevel", "deleteTraceLevel").getObject(),
                new PropertyModel(resourceTO, "deleteTraceLevel"));
        deleteTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
        add(deleteTraceLevel);

        final AjaxDropDownChoicePanel<TraceLevel> syncTraceLevel = new AjaxDropDownChoicePanel<TraceLevel>(
                "syncTraceLevel", new ResourceModel("syncTraceLevel", "syncTraceLevel").getObject(), new PropertyModel(
                        resourceTO, "syncTraceLevel"));
        syncTraceLevel.setChoices(Arrays.asList(TraceLevel.values()));
        add(syncTraceLevel);

        final AjaxCheckBoxPanel resetToken = new AjaxCheckBoxPanel("resetToken", new ResourceModel("resetToken",
                "resetToken").getObject(), new Model(null));

        resetToken.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget art) {
                if (resetToken.getModelObject()) {
                    resourceTO.setSyncToken(null);
                }
            }
        });
        add(resetToken);
View Full Code Here

            @Override
            protected void onUpdate(AjaxRequestTarget art) {
            }
        });

        final AjaxCheckBoxPanel multivalue = new AjaxCheckBoxPanel("multivalue", getString("multivalue"),
                new PropertyModel<Boolean>(schema, "multivalue"));

        final AjaxCheckBoxPanel readonly = new AjaxCheckBoxPanel("readonly", getString("readonly"),
                new PropertyModel<Boolean>(schema, "readonly"));

        final AjaxCheckBoxPanel uniqueConstraint = new AjaxCheckBoxPanel("uniqueConstraint",
                getString("uniqueConstraint"), new PropertyModel<Boolean>(schema, "uniqueConstraint"));

        final AjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit")) {

            private static final long serialVersionUID = -958724007591692537L;
View Full Code Here

        name.addRequiredLabel();
        this.add(name);

        this.add(new AttributesPanel("attributes", roleTO, form, false));

        final AjaxCheckBoxPanel inhAttributes = new AjaxCheckBoxPanel("inheritAttributes", "inheritAttributes",
                new PropertyModel<Boolean>(roleTO, "inheritAttributes"));
        this.add(inhAttributes);
        //--------------------------------

        //--------------------------------
        // Derived attributes container
        //--------------------------------
        this.add(new DerivedAttributesPanel("derivedAttributes", roleTO));

        final AjaxCheckBoxPanel inhDerivedAttributes = new AjaxCheckBoxPanel("inheritDerivedAttributes",
                "inheritDerivedAttributes", new PropertyModel<Boolean>(roleTO, "inheritDerivedAttributes"));
        inhDerivedAttributes.setOutputMarkupId(true);
        this.add(inhDerivedAttributes);
        //--------------------------------

        //--------------------------------
        // Virtual attributes container
        //--------------------------------
        this.add(new VirtualAttributesPanel("virtualAttributes", roleTO, false));

        final AjaxCheckBoxPanel inhVirtualAttributes = new AjaxCheckBoxPanel("inheritVirtualAttributes",
                "inheritVirtualAttributes", new PropertyModel<Boolean>(roleTO, "inheritVirtualAttributes"));
        inhVirtualAttributes.setOutputMarkupId(true);
        this.add(inhVirtualAttributes);
        //--------------------------------

        //--------------------------------
        // Security container
View Full Code Here

                        item.add(getActivationControl(component,
                                (Enum) classMethod.invoke(policy, new Object[]{}) != null,
                                ConflictResolutionAction.IGNORE, ConflictResolutionAction.IGNORE));

                    } else if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
                        item.add(new AjaxCheckBoxPanel("check", field.getName(), new PropertyModel(policy,
                                field.getName())));

                        item.add(new Label("field", new Model(null)));

                    } else if (field.getType().equals(List.class) || field.getType().equals(Set.class)) {
                        classMethod = policy.getClass().getMethod("get" + StringUtils.capitalize(field.getName()),
                                new Class[]{});

                        if (field.getSchemaList() != null) {
                            final List values = schemas.getObject();

                            if (field.getSchemaList().extended()) {
                                values.add("id");
                                values.add("username");
                            }

                            component = new AjaxPalettePanel("field", new PropertyModel(policy, field.getName()),
                                    new ListModel<String>(values));

                            item.add(component);

                            item.add(getActivationControl(component, !((List) classMethod.invoke(policy,
                                    new Object[]{})).isEmpty(), new ArrayList<String>(), new ArrayList<String>()));
                        } else {
                            final FieldPanel panel = new AjaxTextFieldPanel("panel", field.getName(), new Model(null));

                            panel.setRequired(true);

                            component = new MultiValueSelectorPanel<String>("field", new PropertyModel(policy, field.
                                    getName()), panel);

                            item.add(component);

                            final List<String> reinitializedValue = new ArrayList<String>();

                            reinitializedValue.add("");

                            item.add(getActivationControl(component, !((List<String>) classMethod.invoke(policy,
                                    new Object[]{})).isEmpty(), (Serializable) new ArrayList<String>(),
                                    (Serializable) reinitializedValue));
                        }
                    } else if (field.getType().equals(int.class) || field.getType().equals(Integer.class)) {

                        classMethod = policy.getClass().getMethod("get" + StringUtils.capitalize(field.getName()),
                                new Class[]{});

                        component = new AjaxTextFieldPanel("field", field.getName(), new PropertyModel(policy, field.
                                getName()));

                        item.add(component);

                        item.add(getActivationControl(component,
                                (Integer) classMethod.invoke(policy, new Object[]{}) > 0, 0, 0));
                    } else {
                        item.add(new AjaxCheckBoxPanel("check", field.getName(), new Model()));
                        item.add(new Label("field", new Model(null)));
                    }
                } catch (Exception e) {
                    LOG.error("Error retrieving policy fields", e);
                }
View Full Code Here

    }

    private <T extends Serializable> AjaxCheckBoxPanel getActivationControl(final AbstractFieldPanel panel,
            final Boolean checked, final T defaultModelObject, final T reinitializedValue) {

        final AjaxCheckBoxPanel check = new AjaxCheckBoxPanel("check", "check", new Model(checked));

        panel.setEnabled(checked);

        check.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                if (check.getModelObject()) {
                    panel.setEnabled(true);
                    panel.setModelObject(reinitializedValue);
                } else {
                    panel.setModelObject(defaultModelObject);
                    panel.setEnabled(false);
View Full Code Here

        ((DropDownChoice) passwordPolicy.getField()).setNullValid(true);

        securityContainer.add(passwordPolicy);

        final AjaxCheckBoxPanel inhPasswordPolicy = new AjaxCheckBoxPanel("inheritPasswordPolicy",
                "inheritPasswordPolicy", new PropertyModel<Boolean>(entityTO, "inheritPasswordPolicy"));

        passwordPolicy.setReadOnly(inhPasswordPolicy.getModelObject());

        inhPasswordPolicy.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                passwordPolicy.setReadOnly(inhPasswordPolicy.getModelObject());
                target.add(passwordPolicy);
            }
        });

        securityContainer.add(inhPasswordPolicy);
        // -------------------------------

        // -------------------------------
        // Account policy specification
        // -------------------------------
        final AjaxDropDownChoicePanel<Long> accountPolicy = new AjaxDropDownChoicePanel<Long>("accountPolicy",
                "accountPolicy", new PropertyModel(entityTO, "accountPolicy"));

        accountPolicy.setChoiceRenderer(new PolicyRenderer(PolicyType.ACCOUNT));

        accountPolicy.setChoices(new ArrayList<Long>(accountPolicies.getObject().keySet()));

        ((DropDownChoice) accountPolicy.getField()).setNullValid(true);

        securityContainer.add(accountPolicy);

        final AjaxCheckBoxPanel inhAccountPolicy = new AjaxCheckBoxPanel("inheritAccountPolicy",
                "inheritAccountPolicy", new PropertyModel<Boolean>(entityTO, "inheritAccountPolicy"));
        accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());

        inhAccountPolicy.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {

            private static final long serialVersionUID = -1107858522700306810L;

            @Override
            protected void onUpdate(final AjaxRequestTarget target) {
                accountPolicy.setReadOnly(inhAccountPolicy.getModelObject());
                target.add(accountPolicy);
            }
        });

        securityContainer.add(inhAccountPolicy);
View Full Code Here

                        field = new AjaxNumberFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model(),
                                ClassUtils.resolvePrimitiveIfNecessary(propertySchemaClass));

                        required = property.getSchema().isRequired();
                    } else if (Boolean.class.equals(propertySchemaClass) || boolean.class.equals(propertySchemaClass)) {
                        field = new AjaxCheckBoxPanel("panel", label.getDefaultModelObjectAsString(), new Model());
                    } else {
                        field = new AjaxTextFieldPanel("panel", label.getDefaultModelObjectAsString(), new Model());

                        required = property.getSchema().isRequired();
                    }

                    if (String[].class.equals(propertySchemaClass)) {
                        isArray = true;
                    }
                }

                field.setTitle(property.getSchema().getHelpMessage());

                if (isArray) {
                    field.removeRequiredLabel();

                    if (property.getValues().isEmpty()) {
                        property.getValues().add(null);
                    }

                    item.add(new MultiValueSelectorPanel<String>("panel", new PropertyModel<List<String>>(property,
                            "values"), field));
                } else {
                    if (required) {
                        field.addRequiredLabel();
                    }

                    field.setNewModel(property.getValues());
                    item.add(field);
                }

                final AjaxCheckBoxPanel overridable = new AjaxCheckBoxPanel("connPropAttrOverridable",
                        "connPropAttrOverridable", new PropertyModel(property, "overridable"));

                item.add(overridable);
                connectorTO.getConfiguration().add(property);
            }
View Full Code Here

    private FieldPanel buildSinglePanel(final Class<?> type, final String fieldName, final String id) {
        FieldPanel result = null;
        PropertyModel model = new PropertyModel(ReportletConfModalPage.this.reportletConf, fieldName);
        if (Boolean.TYPE.equals(type) || Boolean.class.equals(type)) {
            result = new AjaxCheckBoxPanel(id, fieldName, model);
        } else if (Integer.TYPE.equals(type) || Integer.class.equals(type) || Long.TYPE.equals(type)
                || Long.class.equals(type) || Double.TYPE.equals(type) || Double.class.equals(type)) {

            result = new AjaxNumberFieldPanel(id, fieldName, model, ClassUtils.resolvePrimitiveIfNecessary(type));
        } else if (Date.class.equals(type)) {
View Full Code Here

TOP

Related Classes of org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.