<commit_before>package org.opensingular.server.commons.wicket.buttons;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.IModel;
import org.opensingular.server.commons.wicket.view.util.ActionContext;
import org.opensingular.server.commons.wicket.view.util.DispatcherPageUtil;

import static org.opensingular.lib.wicket.util.util.WicketUtils.$b;

public class ViewVersionLink extends WebMarkupContainer {

    public ViewVersionLink(String id, IModel<String> labelModel, ActionContext context) {
        super(id);
        Link<String> link = new Link<String>("oldVersionLink") {
            @Override
            protected void onConfigure() {
                super.onConfigure();
                this.add($b.attr("target", String.format("version%s", context.getFormVersionId().get())));
                this.add($b.attr("href", DispatcherPageUtil.buildFullURL(context)));
                this.setBody(labelModel);
            }

            @Override
            public void onClick() {
            }
        };
        this.add(link);
    }
}
<commit_msg>Correção de bug no botão de diff<commit_after>package org.opensingular.server.commons.wicket.buttons;

import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.opensingular.server.commons.wicket.view.util.ActionContext;
import org.opensingular.server.commons.wicket.view.util.DispatcherPageUtil;

import static org.opensingular.lib.wicket.util.util.WicketUtils.$b;

public class ViewVersionLink extends Panel {

    public ViewVersionLink(String id, IModel<String> labelModel, ActionContext context) {
        super(id);
        Link<String> link = new Link<String>("oldVersionLink") {
            @Override
            protected void onConfigure() {
                super.onConfigure();
                this.add($b.attr("target", String.format("version%s", context.getFormVersionId().get())));
                this.add($b.attr("href", DispatcherPageUtil.buildFullURL(context)));
                this.setBody(labelModel);
            }

            @Override
            public void onClick() {
            }
        };
        this.add(link);
    }
}

{'fraction_non_alphanumeric': 0.11988054607508532, 'fraction_numerical': 0.0, 'mean_word_length': 2.9148580968280466, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '425546', 'n_tokens_mistral': 689, 'n_tokens_neox': 674, 'n_words': 104}