<commit_before>package org.ovirt.engine.ui.common.presenter;

import org.ovirt.engine.ui.common.auth.CurrentUser;
import org.ovirt.engine.ui.common.uicommon.model.OptionsProvider;
import org.ovirt.engine.ui.common.utils.WebUtils;
import org.ovirt.engine.ui.uicommonweb.models.OptionsModel;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.gwtplatform.mvp.client.PresenterWidget;
import com.gwtplatform.mvp.client.View;

public abstract class AbstractHeaderPresenterWidget<V extends AbstractHeaderPresenterWidget.ViewDef> extends PresenterWidget<V> {

    public interface ViewDef extends View {

        void setUserName(String userName);

        HasClickHandlers getOptionsLink();

        HasClickHandlers getLogoutLink();

        HasClickHandlers getGuideLink();

    }

    private final CurrentUser user;
    private final String windowName;
    private String guideUrl;
    private final OptionsProvider optionsProvider;

    public AbstractHeaderPresenterWidget(EventBus eventBus, V view, CurrentUser user,
            OptionsProvider optionsProvider, String windowName, String guideUrl) {
        super(eventBus, view);
        this.user = user;
        this.windowName = windowName;
        this.optionsProvider = optionsProvider;
        setGuideUrl(guideUrl);
    }

    @Override
    protected void onBind() {
        super.onBind();

        registerHandler(getView().getLogoutLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                user.logout();
            }
        }));

        registerHandler(getView().getGuideLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                WebUtils.openUrlInNewWindow(windowName, guideUrl);
            }
        }));


        registerHandler(getView().getOptionsLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                OptionsModel model = optionsProvider.getModel();
                model.executeCommand(model.getEditCommand());
            }
        }));
    }
<commit_msg>GuideLink url mod<commit_after>package org.ovirt.engine.ui.common.presenter;

import org.ovirt.engine.ui.common.auth.CurrentUser;
import org.ovirt.engine.ui.common.uicommon.model.OptionsProvider;
import org.ovirt.engine.ui.common.utils.WebUtils;
import org.ovirt.engine.ui.uicommonweb.models.OptionsModel;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.gwtplatform.mvp.client.PresenterWidget;
import com.gwtplatform.mvp.client.View;

public abstract class AbstractHeaderPresenterWidget<V extends AbstractHeaderPresenterWidget.ViewDef> extends PresenterWidget<V> {

    public interface ViewDef extends View {

        void setUserName(String userName);

        HasClickHandlers getOptionsLink();

        HasClickHandlers getLogoutLink();

        HasClickHandlers getGuideLink();

    }

    private final CurrentUser user;
    private final String windowName;
    private String guideUrl;
    private final OptionsProvider optionsProvider;

    public AbstractHeaderPresenterWidget(EventBus eventBus, V view, CurrentUser user,
            OptionsProvider optionsProvider, String windowName, String guideUrl) {
        super(eventBus, view);
        this.user = user;
        this.windowName = windowName;
        this.optionsProvider = optionsProvider;
        setGuideUrl(guideUrl);
    }

    @Override
    protected void onBind() {
        super.onBind();

        registerHandler(getView().getLogoutLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                user.logout();
            }
        }));

        registerHandler(getView().getGuideLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                WebUtils.openUrlInNewWindow(windowName, "/docs/administration-guide/index.html");//$NON-NLS-1$
            }
        }));


        registerHandler(getView().getOptionsLink().addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                OptionsModel model = optionsProvider.getModel();
                model.executeCommand(model.getEditCommand());
            }
        }));
    }

{'fraction_non_alphanumeric': 0.0941983780411728, 'fraction_numerical': 0.0002079434393844874, 'mean_word_length': 3.018379281537176, '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': '3322726', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1283, 'n_words': 234}