<commit_before>package org.pentaho.reporting.platform.plugin.gwt.client;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle;
import org.pentaho.gwt.widgets.client.utils.string.StringUtils;
import org.pentaho.reporting.platform.plugin.gwt.client.ReportViewer.RENDER_TYPE;

import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class ReportContainer extends VerticalPanel implements IParameterSubmissionListener
{
  private ParameterControllerPanel parameterControllerPanel;
  private Frame reportContainer;
  private ReportViewer viewer;
  private String url = "about:blank";

  public ReportContainer(final ReportViewer viewer, ResourceBundle messages)
  {
    this.viewer = viewer;
    parameterControllerPanel = new ParameterControllerPanel(viewer, this, messages);
    parameterControllerPanel.addParameterSubmissionListener(this);
    reportContainer = new Frame() {
      
      public void onBrowserEvent(Event event) {
        super.onBrowserEvent(event);
        if (event.getTypeInt() == Event.ONLOAD) {
          if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
            WaitPopup.getInstance().setVisible(false);
          }
        }
      }
      
      protected void onLoad() {
        super.onLoad();
        if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
          WaitPopup.getInstance().setVisible(false);
        }
      }

      public void setUrl(String url) {
        if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
          WaitPopup.getInstance().setVisible(true);
        }
        super.setUrl(url);
      }
      
    };
    reportContainer.sinkEvents(Event.ONLOAD);
    
    init();
  }

  public void init() {
	reportContainer.setUrl("about:blank");
    reportContainer.setVisible(true);
    clear();
    reportContainer.setHeight("100%"); //$NON-NLS-1$
    reportContainer.setWidth("100%"); //$NON-NLS-1$
    reportContainer.getElement().setAttribute("frameBorder", "0"); //$NON-NLS-1$ //$NON-NLS-2$
    add(parameterControllerPanel);
    add(reportContainer);
    setWidth("100%"); //$NON-NLS-1$
    setHeight("100%"); //$NON-NLS-1$
    makeFullHeight(reportContainer, this);
    reportContainer.setUrl(url);
  }
  
  public void hideParameterController()
  {
    parameterControllerPanel.clear();
    parameterControllerPanel.removeFromParent();
    parameterControllerPanel.setVisible(false);
  }
<commit_msg>BISERVER-4213 Shading/Translucency of report execution results does not go away when report is done running until the user clicks around a few times.<commit_after>package org.pentaho.reporting.platform.plugin.gwt.client;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.pentaho.gwt.widgets.client.utils.i18n.ResourceBundle;
import org.pentaho.gwt.widgets.client.utils.string.StringUtils;
import org.pentaho.reporting.platform.plugin.gwt.client.ReportViewer.RENDER_TYPE;

import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class ReportContainer extends VerticalPanel implements IParameterSubmissionListener
{
  private ParameterControllerPanel parameterControllerPanel;
  private Frame reportContainer;
  private ReportViewer viewer;
  private String url = "about:blank";

  public ReportContainer(final ReportViewer viewer, ResourceBundle messages)
  {
    this.viewer = viewer;
    parameterControllerPanel = new ParameterControllerPanel(viewer, this, messages);
    parameterControllerPanel.addParameterSubmissionListener(this);
    reportContainer = new Frame() {
      
      public void onBrowserEvent(Event event) {
        super.onBrowserEvent(event);
        if (event.getTypeInt() == Event.ONLOAD) {
          if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
            WaitPopup.getInstance().setVisible(false);
          }
        }
      }
      
      protected void onLoad() {
        super.onLoad();
        if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
          WaitPopup.getInstance().setVisible(false);
        }
      }

      public void setUrl(String url) {
        if (StringUtils.isEmpty(url) == false && url.equals("about:blank") == false) {
          WaitPopup.getInstance().setVisible(true);
        }
        super.setUrl(url);
        // ie is not responding to onload
        Timer t = new Timer() {
          public void run() {
            WaitPopup.getInstance().setVisible(false);
          }
        };
        t.schedule(1000);
      }
      
    };
    reportContainer.sinkEvents(Event.ONLOAD);
    
    init();
  }

  public void init() {
	reportContainer.setUrl("about:blank");
    reportContainer.setVisible(true);
    clear();
    reportContainer.setHeight("100%"); //$NON-NLS-1$
    reportContainer.setWidth("100%"); //$NON-NLS-1$
    reportContainer.getElement().setAttribute("frameBorder", "0"); //$NON-NLS-1$ //$NON-NLS-2$
    add(parameterControllerPanel);
    add(reportContainer);
    setWidth("100%"); //$NON-NLS-1$
    setHeight("100%"); //$NON-NLS-1$
    makeFullHeight(reportContainer, this);
    reportContainer.setUrl(url);
  }
  
  public void hideParameterController()
  {
    parameterControllerPanel.clear();
    parameterControllerPanel.removeFromParent();
    parameterControllerPanel.setVisible(false);
  }

{'fraction_non_alphanumeric': 0.12645071886367573, 'fraction_numerical': 0.008661008141347654, 'mean_word_length': 3.4794414274631498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1221148', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1683, 'n_words': 293}