<commit_before>package org.jboss.as.console.client.shared.subsys.logger.wizard;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.v3.widgets.wizard.WizardStep;
import org.jboss.as.console.client.widgets.ContentDescription;
import org.jboss.as.console.mbui.widgets.ModelNodeForm;
import org.jboss.as.console.mbui.widgets.ModelNodeFormBuilder;
import org.jboss.ballroom.client.widgets.forms.FormValidation;
import org.jboss.dmr.client.ModelNode;

/**
 * @author <NAME>
 * @since 08/09/15
 */
public class CommonAttributesStep extends WizardStep<HandlerContext, HandlerSteps>{

    private final TwoStepWizard wizard;
    private ModelNodeForm form;

    public CommonAttributesStep(TwoStepWizard wizard, String title) {
        super(wizard, title);
        this.wizard = wizard;
    }

    @Override
    protected Widget asWidget(HandlerContext context) {
        ModelNodeFormBuilder builder = new ModelNodeFormBuilder()
                .setCreateMode(true)
                .setResourceDescription(wizard.getResourceDescription())
                .setRequiredOnly(true)
                .setSecurityContext(wizard.getSecurityContext());

        ModelNodeFormBuilder.FormAssets assets = builder.build();
        form = assets.getForm();
        form.setEnabled(true);

        if (form.hasWritableAttributes()) {
            FlowPanel layout = new FlowPanel();
            Widget formWidget = form.asWidget();
            ModelNode opDescription = wizard.getResourceDescription().get("operations").get("add").get("description");
            ContentDescription text = new ContentDescription(opDescription.asString());
            layout.add(text);
            layout.add(assets.getHelp().asWidget());
            layout.add(formWidget);
            return layout;

        } else {
            return new HTML(Console.CONSTANTS.noConfigurableAttributes());
        }
    }<commit_msg>[JBEAP-6349] Extra paragraph in the help text when adding periodic-size-rotating-file-handler<commit_after>package org.jboss.as.console.client.shared.subsys.logger.wizard;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.v3.widgets.wizard.WizardStep;
import org.jboss.as.console.client.widgets.ContentDescription;
import org.jboss.as.console.mbui.widgets.ModelNodeForm;
import org.jboss.as.console.mbui.widgets.ModelNodeFormBuilder;
import org.jboss.ballroom.client.widgets.forms.FormValidation;
import org.jboss.dmr.client.ModelNode;

/**
 * @author <NAME>
 * @since 08/09/15
 */
public class CommonAttributesStep extends WizardStep<HandlerContext, HandlerSteps>{

    private final TwoStepWizard wizard;
    private ModelNodeForm form;

    public CommonAttributesStep(TwoStepWizard wizard, String title) {
        super(wizard, title);
        this.wizard = wizard;
    }

    @Override
    protected Widget asWidget(HandlerContext context) {
        ModelNodeFormBuilder builder = new ModelNodeFormBuilder()
                .setCreateMode(true)
                .setResourceDescription(wizard.getResourceDescription())
                .setRequiredOnly(true)
                .setSecurityContext(wizard.getSecurityContext())
                //exclude file so it does not appear in the description as it is described in the next step
                .exclude("file");

        ModelNodeFormBuilder.FormAssets assets = builder.build();
        form = assets.getForm();
        form.setEnabled(true);

        if (form.hasWritableAttributes()) {
            FlowPanel layout = new FlowPanel();
            Widget formWidget = form.asWidget();
            ModelNode opDescription = wizard.getResourceDescription().get("operations").get("add").get("description");
            ContentDescription text = new ContentDescription(opDescription.asString());
            layout.add(text);
            layout.add(assets.getHelp().asWidget());
            layout.add(formWidget);
            return layout;

        } else {
            return new HTML(Console.CONSTANTS.noConfigurableAttributes());
        }
    }
{'fraction_non_alphanumeric': 0.10748204771832291, 'fraction_numerical': 0.004169562195969423, 'mean_word_length': 3.1163012392755003, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4903194', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1169, 'n_words': 212}