<commit_before>/**
 * 
 */
package uk.ac.lkl.client;

import com.google.gwt.user.client.ui.HTML;

/**
 * Implements the panel where URLs and embedding widgets are available to save or share the current model.
 * 
 * @author <NAME>
 *
 */

public class RunDownloadSharePanel extends VerticalPanelWithDebugID {
    
    private boolean dirty = true; 
    private boolean enabled = true;   
    private boolean share;
    private boolean run;
    private String modelGuid = null;
    private String savedTitle;
    protected HTML waitingMessage = null;
    
    public RunDownloadSharePanel(boolean run, boolean share) {
	super();
	this.share = share;
	this.run = run;
    }
    
    @Override
    public void setVisible(boolean visible) {
	if (isVisible() == visible) {
	    return;
	}
	super.setVisible(visible);
	if (visible && isAttached()) {
	    BehaviourComposer.runPanel.runDownloadSharePanelDisplayed(this);
	    if (dirty || (!share && BehaviourComposer.runPanel.runEvenIfClean()) && enabled) {
		BehaviourComposer.instance().runModel(run, share, this);
	    } 
	}
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty(boolean dirty) {<commit_msg>Run panel sets NetLogo Web compatibility<commit_after>/**
 * 
 */
package uk.ac.lkl.client;

import com.google.gwt.user.client.ui.HTML;

/**
 * Implements the panel where URLs and embedding widgets are available to save or share the current model.
 * 
 * @author <NAME>
 *
 */

public class RunDownloadSharePanel extends VerticalPanelWithDebugID {
    
    private boolean dirty = true; 
    private boolean enabled = true;   
    private boolean share;
    private boolean run;
    private String modelGuid = null;
    private String savedTitle;
    protected HTML waitingMessage = null;
    
    public RunDownloadSharePanel(boolean run, boolean share) {
	super();
	this.share = share;
	this.run = run;
    }
    
    @Override
    public void setVisible(boolean visible) {
	if (isVisible() == visible) {
	    return;
	}
	super.setVisible(visible);
	if (visible && isAttached()) {
	    BehaviourComposer.runPanel.runDownloadSharePanelDisplayed(this);
	    if (dirty || (!share && BehaviourComposer.runPanel.runEvenIfClean()) && enabled) {
		// NetLogo Web should be used if there is a run tab
		Modeller.forWebVersion = true;
		BehaviourComposer.instance().runModel(run, share, this);
	    } 
	}
    }

    public boolean isDirty() {
        return dirty;
    }

    public void setDirty(boolean dirty) {
{'fraction_non_alphanumeric': 0.10128102481985589, 'fraction_numerical': 0.0, 'mean_word_length': 3.2212837837837838, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5520346', 'n_tokens_mistral': 763, 'n_tokens_neox': 728, 'n_words': 208}