<commit_before>package org.wicketopia.persistence.component.scaffold;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.feedback.ComponentFeedbackMessageFilter;
import org.apache.wicket.feedback.ContainerFeedbackMessageFilter;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.IHeaderContributor;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.wicketopia.WicketopiaPlugin;
import org.wicketopia.context.Context;
import org.wicketopia.factory.PropertyComponentFactory;
import org.wicketopia.layout.view.CssBeanViewLayoutPanel;
import org.wicketopia.metadata.WicketopiaBeanFacet;
import org.wicketopia.model.column.FragmentColumn;
import org.wicketopia.model.label.DisplayNameModel;
import org.wicketopia.model.label.PluralizedModel;
import org.wicketopia.persistence.PersistenceProvider;
import org.wicketopia.persistence.component.link.ajax.AjaxCreateLink;
import org.wicketopia.persistence.component.link.ajax.AjaxUpdateLink;
import org.wicketopia.persistence.model.LoadableDetachableEntityModel;
import org.wicketopia.persistence.model.repeater.PersistenceDataProvider;

import java.util.List;

/**
 * @author <NAME>
 */
public class Scaffold<T> extends Panel implements IHeaderContributor
{
//----------------------------------------------------------------------------------------------------------------------
// Fields
//----------------------------------------------------------------------------------------------------------------------

    private static final ResourceReference CSS_REFERENCE = new ResourceReference(Scaffold.class, "scaffold.css");
    private static final String CONTENT_ID = "content";
    private final Class<T> beanType;
    private final PersistenceProvider persistenceProvider;
    private ScaffoldMode mode = ScaffoldMode.List;
    private final FeedbackPanel feedback = new FeedbackPanel("feedback");
    private IModel<T> model;
    private final DisplayNameModel displayName;

//----------------------------------------------------------------------------------------------------------------------
// Constructors
//----------------------------------------------------------------------------------------------------------------------

    public Scaffold(String id, Class<T> beanType, PersistenceProvider persistenceProvider)
    {
        super(id);
        WicketopiaBeanFacet beanFacet = WicketopiaBeanFacet.get(WicketopiaPlugin.get().getBeanMetaData(beanType));
        displayName = new DisplayNameModel(beanFacet);
        add(new AttributeModifier("class", true, new Model<String>("scaffold")));
        feedback.setOutputMarkupPlaceholderTag(true);
        //feedback.setFilter(new ContainerFeedbackMessageFilter(this));
        add(feedback);
        this.beanType = beanType;
        this.persistenceProvider = persistenceProvider;
        refreshContent(null);
        setOutputMarkupPlaceholderTag(true);

    }

    private void refreshContent(AjaxRequestTarget target)
    {
        final Component content = createContent();
        content.setOutputMarkupPlaceholderTag(true);
        addOrReplace(content);
        if (target != null)
        {
            target.addComponent(this);
        }
    }<commit_msg>Adding in filtering on feedback panel.<commit_after>package org.wicketopia.persistence.component.scaffold;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ResourceReference;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.behavior.AbstractBehavior;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.feedback.ComponentFeedbackMessageFilter;
import org.apache.wicket.feedback.ContainerFeedbackMessageFilter;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.IHeaderContributor;
import org.apache.wicket.markup.html.IHeaderResponse;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.wicketopia.WicketopiaPlugin;
import org.wicketopia.context.Context;
import org.wicketopia.factory.PropertyComponentFactory;
import org.wicketopia.layout.view.CssBeanViewLayoutPanel;
import org.wicketopia.metadata.WicketopiaBeanFacet;
import org.wicketopia.model.column.FragmentColumn;
import org.wicketopia.model.label.DisplayNameModel;
import org.wicketopia.model.label.PluralizedModel;
import org.wicketopia.persistence.PersistenceProvider;
import org.wicketopia.persistence.component.link.ajax.AjaxCreateLink;
import org.wicketopia.persistence.component.link.ajax.AjaxUpdateLink;
import org.wicketopia.persistence.model.LoadableDetachableEntityModel;
import org.wicketopia.persistence.model.repeater.PersistenceDataProvider;

import java.util.List;

/**
 * @author <NAME>
 */
public class Scaffold<T> extends Panel implements IHeaderContributor
{
//----------------------------------------------------------------------------------------------------------------------
// Fields
//----------------------------------------------------------------------------------------------------------------------

    private static final ResourceReference CSS_REFERENCE = new ResourceReference(Scaffold.class, "scaffold.css");
    private static final String CONTENT_ID = "content";
    private final Class<T> beanType;
    private final PersistenceProvider persistenceProvider;
    private ScaffoldMode mode = ScaffoldMode.List;
    private final FeedbackPanel feedback = new FeedbackPanel("feedback");
    private IModel<T> model;
    private final DisplayNameModel displayName;

//----------------------------------------------------------------------------------------------------------------------
// Constructors
//----------------------------------------------------------------------------------------------------------------------

    public Scaffold(String id, Class<T> beanType, PersistenceProvider persistenceProvider)
    {
        super(id);
        WicketopiaBeanFacet beanFacet = WicketopiaBeanFacet.get(WicketopiaPlugin.get().getBeanMetaData(beanType));
        displayName = new DisplayNameModel(beanFacet);
        add(new AttributeModifier("class", true, new Model<String>("scaffold")));
        feedback.setOutputMarkupPlaceholderTag(true);
        feedback.setFilter(new ContainerFeedbackMessageFilter(this));
        add(feedback);
        this.beanType = beanType;
        this.persistenceProvider = persistenceProvider;
        refreshContent(null);
        setOutputMarkupPlaceholderTag(true);

    }

    private void refreshContent(AjaxRequestTarget target)
    {
        final Component content = createContent();
        content.setOutputMarkupPlaceholderTag(true);
        addOrReplace(content);
        if (target != null)
        {
            target.addComponent(this);
        }
    }
{'fraction_non_alphanumeric': 0.197651203758074, 'fraction_numerical': 0.0, 'mean_word_length': 2.890360895386021, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2408971', 'n_tokens_mistral': 2302, 'n_tokens_neox': 2249, 'n_words': 351}