org.eclipse.swt.win32.win32.x86_3.7.2.v3740f

.locationListeners;
          this$0.locationListeners = new LocationListener[0];
          this$0.site.ignoreAllMessages = true;
          this$0.execute("window.location.href='about:blank'");
          this$0.site.ignoreAllMessages = false;
          this$0.locationListeners = oldLocationListeners;
        }
        if (!this$0.frame.isDisposed()) {
          this$0.unhookDOMListeners(this$0.documents);
        }
        for (int i = 0; i < this$0.documents.length; i++) {
          this$0.documents[i].dispose();
        }
        this$0.documents = null;
        
        Enumeration elements = this$0.functions.elements();
        while (elements.hasMoreElements()) {
          ((BrowserFunction)elements.nextElement()).dispose(false);
        }
        this$0.functions = null;
        
        this$0.lastNavigateURL = (this$0.uncRedirect = null);
        this$0.domListener = null;
        if (this$0.auto != null) {
          this$0.auto.dispose();
        }
        this$0.auto = null;
      }
      break;
    case 11: 
      this$0.frame.setBounds(this$0.browser.getClientArea());
      break;
    case 37: 
      doit = false;
      break;
    case 15: 
      this$0.site.setFocus();
      break;
    case 31: 
      if ((detail == 8) && ((widget instanceof WebSite)))
      {
        this$0.browser.traverse(8, e);
        doit = false;
      }
      if ((detail == 16) && ((widget instanceof Browser)))
      {
        this$0.site.traverse(16, e);
        doit = false;
      }
      if ((detail == 4) && (doit) && ((widget instanceof Browser)))
      {
        type = 0;
        doit = false;
      }
      break;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.IE.6
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Hashtable;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.internal.ole.win32.COM;
import org.eclipse.swt.internal.ole.win32.IDispatch;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.ole.win32.OleAutomation;
import org.eclipse.swt.ole.win32.OleEvent;
import org.eclipse.swt.ole.win32.OleListener;
import org.eclipse.swt.ole.win32.Variant;
import org.eclipse.swt.widgets.Display;

class IE$7
  implements OleListener
{
  final IE this$0;
  
  IE$7(IE paramIE)
  {
    this$0 = paramIE;
  }
  
  public void handleEvent(OleEvent event)
  {
    if (this$0.auto != null) {
      switch (type)
      {
      case 250: 
        this$0.isRefresh = false;
        if (!this$0.performingInitialNavigate)
        {
          Variant varResult = arguments[1];
          String url = varResult.getString();
          if (this$0.uncRedirect != null)
          {
            if ((this$0.uncRedirect.equals(url)) || ((this$0.uncRedirect.startsWith(url)) && (this$0.uncRedirect.indexOf('\\', 2) == url.length())))
            {
              Variant cancel = arguments[6];
              if (cancel != null)
              {
                int pCancel = cancel.getByRef();
                COM.MoveMemory(pCancel, new short[1], 2);
              }
            }
            else
            {
              this$0.uncRedirect = null;
            }
          }
          else
          {
            if ((url.indexOf(":/") == -1) && (url.indexOf(":\\") != -1)) {
              url = "file://" + url.replace('\\', '/');
            }
            if ((url.startsWith("file://")) && (this$0._getUrl().startsWith("about:blank")) && (this$0.untrustedText))
            {
              Variant cancel = arguments[6];
              if (cancel != null)
              {
                int pCancel = cancel.getByRef();
                COM.MoveMemory(pCancel, new short[] { -1 }, 2);
              }
            }
            else
            {
              LocationEvent newEvent = new LocationEvent(this$0.browser);
              display = this$0.browser.getDisplay();
              widget = this$0.browser;
              location = url;
              doit = true;
              for (int i = 0; i < this$0.locationListeners.length; i++) {
                this$0.locationListeners[i].changing(newEvent);
              }
              boolean doit = (doit) && (!this$0.browser.isDisposed());
              Variant cancel = arguments[6];
              if (cancel != null)
              {
                int pCancel = cancel.getByRef();
                COM.MoveMemory(pCancel, new short[] { doit ? 0 : -1 }, 2);
              }
              if (doit) {
                this$0.lastNavigateURL = url;
              }
            }
          }
        }
        break;
      case 105: 
        boolean enabled = false;
        Variant varResult = arguments[0];
        int command = varResult.getInt();
        varResult = arguments[1];
        enabled = varResult.getBoolean();
        switch (command)
        {
        case 2: 
          this$0.back = enabled; break;
        case 1: 
          this$0.forward = enabled;
        }
        break;
      case 259: 
        if (this$0.performingInitialNavigate)
        {
          this$0.performingInitialNavigate = false;
          if (this$0.pendingText != null) {
            this$0.setText((String)this$0.pendingText[0], ((Boolean)this$0.pendingText[1]).booleanValue());
          } else if (this$0.pendingUrl != null) {
            this$0.setUrl((String)this$0.pendingUrl[0], (String)this$0.pendingUrl[1], (String[])this$0.pendingUrl[2]);
          }
          this$0.pendingText = (this$0.pendingUrl = null);
        }
        else
        {
          Variant varResult = arguments[0];
          IDispatch dispatch = varResult.getDispatch();
          
          varResult = arguments[1];
          String url = varResult.getString();
          if ((url.indexOf(":/") == -1) && (url.indexOf(":\\") != -1)) {
            url = "file://" + url.replace('\\', '/');
          }
          if ((this$0.html != null) && (url.equals("about:blank")))
          {
            if (this$0.delaySetText)
            {
              this$0.delaySetText = false;
              this$0.browser.getDisplay().asyncExec(new IE.8(this));
            }
            else
            {
              this$0.setHTML(this$0.html);
              this$0.html = null;
            }
          }
          else
          {
            Variant variant = new Variant(this$0.auto);
            IDispatch top = variant.getDispatch();
            LocationEvent locationEvent = new LocationEvent(this$0.browser);
            display = this$0.browser.getDisplay();
            widget = this$0.browser;
            location = url;
            top = (top.getAddress() == dispatch.getAddress());
            for (int i = 0; i < this$0.locationListeners.length; i++) {
              this$0.locationListeners[i].changed(locationEvent);
            }
            if (this$0.browser.isDisposed()) {
              return;
            }
            if ((this$0.globalDispatch != 0) && (dispatch.getAddress() == this$0.globalDispatch))
            {
              this$0.globalDispatch = 0;
              
              IE ie = (IE)this$0.browser.webBrowser;
              if (installFunctionsOnDocumentComplete)
              {
                installFunctionsOnDocumentComplete = false;
                Enumeration elements = this$0.functions.elements();
                while (elements.hasMoreElements())
                {
                  BrowserFunction function = (BrowserFunction)elements.nextElement();
                  this$0.execute(functionString);
                }
              }
              ProgressEvent progressEvent = new ProgressEvent(this$0.browser);
              display = this$0.browser.getDisplay();
              widget = this$0.browser;
              for (int i = 0; i < this$0.progressListeners.length; i++) {
                this$0.progressListeners[i].completed(progressEvent);
              }
            }
          }
        }
        break;
      case 104: 
        if ((goto 3389) && 
        
          (this$0.isRefresh))
        {
          this$0.isRefresh = false;
          
          Enumeration elements = this$0.functions.elements();
          while (elements.hasMoreElements())
          {
            BrowserFunction function = (BrowserFunction)elements.nextElement();
            this$0.execute(functionString);
          }
          ProgressEvent progressEvent = new ProgressEvent(this$0.browser);
          display = this$0.browser.getDisplay();
          widget = this$0.browser;
          for (int i = 0; i < this$0.progressListeners.length; i++) {
            this$0.progressListeners[i].completed(progressEvent);
          }
        }
        break;
      case 252: 
        Variant varResult = arguments[1];
        String url = varResult.getString();
        if (!this$0.performingInitialNavigate) {
          this$0.isAboutBlank = url.startsWith("about:blank");
        }
        boolean isPDF = false;
        String path = null;
        try
        {
          path = new URL(url).getPath();
        }
        catch (MalformedURLException localMalformedURLException) {}
        if (path != null)
        {
          int extensionIndex = path.lastIndexOf('.');
          if (extensionIndex != -1)
          {
            String extension = path.substring(extensionIndex);
            if (extension.equalsIgnoreCase(".pdf"))
            {
              isPDF = true;
              IE.PDFCount += 1;
              if (IE.PDFCount > 20) {
                COM.FreeUnusedLibraries = false;
              }
            }
          }
        }
        if (this$0.uncRedirect != null)
        {
          if (this$0.uncRedirect.equals(url)) {
            this$0.uncRedirect = null;
          } else if (this$0.uncRedirect.startsWith(url)) {
            this$0.navigate(this$0.uncRedirect, null, null, true);
          } else {
            this$0.uncRedirect = null;
          }
        }
        else
        {
          varResult = arguments[0];
          IDispatch dispatch = varResult.getDispatch();
          if (this$0.globalDispatch == 0) {
            this$0.globalDispatch = dispatch.getAddress();
          }
          OleAutomation webBrowser = varResult.getAutomation();
          Variant variant = new Variant(this$0.auto);
          IDispatch top = variant.getDispatch();
          boolean isTop = top.getAddress() == dispatch.getAddress();
          if (isTop)
          {
            this$0.unhookDOMListeners(this$0.documents);
            for (int i = 0; i < this$0.documents.length; i++) {
              this$0.documents[i].dispose();
            }
            this$0.documents = new OleAutomation[0];
            
            Enumeration elements = this$0.functions.elements();
            while (elements.hasMoreElements())
            {
              BrowserFunction function = (BrowserFunction)elements.nextElement();
              this$0.execute(functionString);
            }
          }
          if (!isPDF) {
            this$0.hookDOMListeners(webBrowser, isTop);
          }
          webBrowser.dispose();
        }
        break;
      case 271: 
        if (this$0.uncRedirect != null)
        {
          this$0.uncRedirect = null;
        }
        else
        {
          Variant varResult = arguments[1];
          String url = varResult.getString();
          if (url.startsWith("\\\\"))
          {
            varResult = arguments[3];
            int statusCode = varResult.getInt();
            if (statusCode == -2146697211)
            {
              int index = url.indexOf('\\', 2);
              if (index != -1)
              {
                String host = url.substring(0, index);
                Variant cancel = arguments[4];
                if (cancel != null)
                {
                  int pCancel = cancel.getByRef();
                  COM.MoveMemory(pCancel, new short[] { -1 }, 2);
                }
                this$0.browser.getDisplay().asyncExec(new IE.9(this, url, host));
              }
            }
          }
        }
        break;
      case 251: 
        Variant cancel = arguments[1];
        int pCancel = cancel.getByRef();
        WindowEvent newEvent = new WindowEvent(this$0.browser);
        display = this$0.browser.getDisplay();
        widget = this$0.browser;
        required = false;
        for (int i = 0; i < this$0.openWindowListeners.length; i++) {
          this$0.openWindowListeners[i].open(newEvent);
        }
        IE browser = null;
        if ((browser != null) && ((browser.webBrowser instanceof IE))) {
          browser = (IE)browser.webBrowser;
        }
        boolean doit = (browser != null) && (!browser.isDisposed());
        if (doit)
        {
          installFunctionsOnDocumentComplete = true;
          
          Variant variant = new Variant(auto);
          IDispatch iDispatch = variant.getDispatch();
          Variant ppDisp = arguments[0];
          int byref = ppDisp.getByRef();
          if (byref != 0) {
            COM.MoveMemory(byref, new int[] { iDispatch.getAddress() }, OS.PTR_SIZEOF);
          }
        }
        if (required) {
          COM.MoveMemory(pCancel, new short[] { doit ? 0 : -1 }, 2);
        }
        break;
      case 256: 
        Variant arg0 = arguments[0];
        this$0.menuBar = arg0.getBoolean();
        break;
      case 257: 
        Variant arg0 = arguments[0];
        this$0.statusBar = arg0.getBoolean();
        break;
      case 255: 
        Variant arg0 = arguments[0];
        this$0.toolBar = arg0.getBoolean();
        if (!this$0.toolBar)
        {
          this$0.addressBar = false;
          this$0.menuBar = false;
        }
        break;
      case 254: 
        Variant arg1 = arguments[0];
        boolean visible = arg1.getBoolean();
        WindowEvent newEvent = new WindowEvent(this$0.browser);
        display = this$0.browser.getDisplay();
        widget = this$0.browser;
        if (visible)
        {
          if (this$0.addressBar)
          {
            int[] rgdispid = this$0.auto.getIDsOfNames(new String[] { "AddressBar" });
            Variant pVarResult = this$0.auto.getProperty(rgdispid[0]);
            if (pVarResult != null)
            {
              if (pVarResult.getType() == 11) {
                this$0.addressBar = pVarResult.getBoolean();
              }
              pVarResult.dispose();
            }
          }
          addressBar = this$0.addressBar;
          menuBar = this$0.menuBar;
          statusBar = this$0.statusBar;
          toolBar = this$0.toolBar;
          location = this$0.location;
          size = this$0.size;
          for (int i = 0; i < this$0.visibilityWindowListeners.length; i++) {
            this$0.visibilityWindowListeners[i].show(newEvent);
          }
          this$0.location = null;
          this$0.size = null;
        }
        else
        {
          for (int i = 0; i < this$0.visibilityWindowListeners.length; i++) {
            this$0.visibilityWindowListeners[i].hide(newEvent);
          }
        }
        break;
      case 108: 
        if ((goto 3389) && 
        
          (!this$0.performingInitialNavigate))
        {
          Variant arg1 = arguments[0];
          int nProgress = arg1.getType() != 3 ? 0 : arg1.getInt();
          Variant arg2 = arguments[1];
          int nProgressMax = arg2.getType() != 3 ? 0 : arg2.getInt();
          ProgressEvent newEvent = new ProgressEvent(this$0.browser);
          display = this$0.browser.getDisplay();
          widget = this$0.browser;
          current = nProgress;
          total = nProgressMax;
          if (nProgress != -1) {
            for (int i = 0; i < this$0.progressListeners.length; i++) {
              this$0.progressListeners[i].changed(newEvent);
            }
          }
        }
        break;
      case 102: 
        if ((goto 3389) && 
        
          (!this$0.performingInitialNavigate))
        {
          Variant arg1 = arguments[0];
          if (arg1.getType() == 8)
          {
            String text = arg1.getString();
            StatusTextEvent newEvent = new StatusTextEvent(this$0.browser);
            display = this$0.browser.getDisplay();
            widget = this$0.browser;
            text = text;
            for (int i = 0; i < this$0.statusTextListeners.length; i++) {
              this$0.statusTextListeners[i].changed(newEvent);
            }
          }
        }
        break;
      case 113: 
        if ((goto 3389) && 
        
          (!this$0.performingInitialNavigate))
        {
          Variant arg1 = arguments[0];
          if (arg1.getType() == 8)
          {
            String title = arg1.getString();
            TitleEvent newEvent = new TitleEvent(this$0.browser);
            display = this$0.browser.getDisplay();
            widget = this$0.browser;
            title = title;
            for (int i = 0; i < this$0.titleListeners.length; i++) {
              this$0.titleListeners[i].changed(newEvent);
            }
          }
        }
        break;
      case 263: 
        this$0.browser.getDisplay().asyncExec(new IE.10(this));
        
        Variant cancel = arguments[1];
        int pCancel = cancel.getByRef();
        Variant arg1 = arguments[0];
        boolean isChildWindow = arg1.getBoolean();
        COM.MoveMemory(pCancel, new short[] { isChildWindow ? 0 : -1 }, 2);
        break;
      case 267: 
        if (this$0.size == null) {
          this$0.size = new Point(0, 0);
        }
        Variant arg1 = arguments[0];
        this$0.size.y = arg1.getInt();
        break;
      case 264: 
        if (this$0.location == null) {
          this$0.location = new Point(0, 0);
        }
        Variant arg1 = arguments[0];
        this$0.location.x = arg1.getInt();
        break;
      case 265: 
        if (this$0.location == null) {
          this$0.location = new Point(0, 0);
        }
        Variant arg1 = arguments[0];
        this$0.location.y = arg1.getInt();
        break;
      case 266: 
        if (this$0.size == null) {
          this$0.size = new Point(0, 0);
        }
        Variant arg1 = arguments[0];
        this$0.size.x = arg1.getInt();
      }
    }
    Variant[] arguments = arguments;
    for (int i = 0; i < arguments.length; i++) {
      arguments[i].dispose();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.IE.7
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

class IE$8
  implements Runnable
{
  final IE.7 this$1;
  
  IE$8(IE.7 param7)
  {
    this$1 = param7;
  }
  
  public void run()
  {
    if ((access$0this$1).browser.isDisposed()) || (access$0this$1).html == null)) {
      return;
    }
    IE.7.access$0(this$1).setHTML(access$0this$1).html);
    access$0this$1).html = null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.IE.8
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

class IE$9
  implements Runnable
{
  final IE.7 this$1;
  private final String val$url;
  private final String val$host;
  
  IE$9(IE.7 param7, String paramString1, String paramString2)
  {
    this$1 = param7;val$url = paramString1;val$host = paramString2;
  }
  
  public void run()
  {
    if (access$0this$1).browser.isDisposed()) {
      return;
    }
    if (val$url.endsWith("\\")) {
      access$0this$1).uncRedirect = val$url.substring(0, val$url.length() - 1);
    } else {
      access$0this$1).uncRedirect = val$url;
    }
    IE.7.access$0(this$1).navigate(val$host, null, null, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.swt.browser.IE.9
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.swt.browser;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.internal.C;
import org.eclipse.swt.internal.ole.win32.COM;
import org.eclipse.swt.internal.ole.win32.GUID;
import org.eclipse.swt.internal.ole.win32.IDispatch;
import org.eclipse.swt.internal.ole.win32.IPersistStreamInit;
import org.eclipse.swt.internal.ole.win32.IUnknown;
import org.eclipse.swt.internal.win32.MSG;
import org.eclipse.swt.internal.win32.OS;
import org.eclipse.swt.internal.win32.SAFEARRAY;
import org.eclipse.swt.internal.win32.SAFEARRAYBOUND;
import org.eclipse.swt.internal.win32.TCHAR;
import org.eclipse.swt.ole.win32.OleAutomation;
import org.eclipse.swt.ole.win32.OleEvent;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.ole.win32.OleListener;
import org.eclipse.swt.ole.win32.Variant;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;

class IE
  extends WebBrowser
{
  OleFrame frame;
  WebSite site;
  OleAutomation auto;
  OleListener domListener;
  OleAutomation[] documents = new OleAutomation[0];
  boolean back;
  boolean forward;
  boolean delaySetText;
  boolean ignoreDispose;
  boolean ignoreTraverse;
  boolean performingInitialNavigate;
  boolean installFunctionsOnDocumentComplete;
  boolean untrustedText;
  boolean isRefresh;
  boolean isAboutBlank;
  Point location;
  Point size;
  boolean addressBar = true;
  boolean menuBar = true;
  boolean statusBar = true;
  boolean toolBar = true;
  int globalDispatch;
  String html;
  String lastNavigateURL;
  String uncRedirect;
  Object[] pendingText;
  Object[] pendingUrl;
  int style;
  int lastKeyCode;
  int lastCharCode;
  int lastMouseMoveX;
  int lastMouseMoveY;
  static boolean Initialized;
  static int IEVersion;
  static int PDFCount;
  static String ProgId = "Shell.Explorer";
  static final int BeforeNavigate2 = 250;
  static final int CommandStateChange = 105;
  static final int DocumentComplete = 259;
  static final int DownloadComplete = 104;
  static final int NavigateComplete2 = 252;
  static final int NewWindow2 = 251;
  static final int OnMenuBar = 256;
  static final int OnStatusBar = 257;
  static final int OnToolBar = 255;
  static final int OnVisible = 254;
  static final int ProgressChange = 108;
  static final int RegisterAsBrowser = 552;
  static final int StatusTextChange = 102;
  static final int TitleChange = 113;
  static final int WindowClosing = 263;
  static final int WindowSetHeight = 267;
  static final int WindowSetLeft = 264;
  static final int WindowSetResizable = 262;
  static final int WindowSetTop = 265;
  static final int WindowSetWidth = 266;
  static final int NavigateError = 271;
  static final short CSC_NAVIGATEFORWARD = 1;
  static final short CSC_NAVIGATEBACK = 2;
  static final int INET_E_DEFAULT_ACTION = -2146697199;
  static final int INET_E_RESOURCE_NOT_FOUND = -2146697211;
  static final int READYSTATE_COMPLETE = 4;
  static final int URLPOLICY_ALLOW = 0;
  static final int URLPOLICY_DISALLOW = 3;
  static final int URLPOLICY_JAVA_PROHIBIT = 0;
  static final int URLPOLICY_JAVA_LOW = 196608;
  static final int URLZONE_LOCAL_MACHINE = 0;
  static final int URLZONE_INTRANET = 1;
  static final int URLACTION_ACTIVEX_MIN = 4608;
  static final int URLACTION_ACTIVEX_MAX = 5119;
  static final int URLACTION_ACTIVEX_RUN = 4608;
  static final int URLACTION_FEATURE_ZONE_ELEVATION = 8449;
  static final int URLACTION_JAVA_MIN = 7168;
  static final int URLACTION_JAVA_MAX = 7423;
  static final int URLACTION_SCRIPT_RUN = 5120;
  static final int DISPID_AMBIENT_DLCONTROL = -5512;
  static final int DLCTL_DLIMAGES = 16;
  static final int DLCTL_VIDEOS = 32;
  static final int DLCTL_BGSOUNDS = 64;
  static final int DLCTL_NO_SCRIPTS = 128;
  static final int DLCTL_NO_JAVA = 256;
  static final int DLCTL_NO_RUNACTIVEXCTLS = 512;
  static final int DLCTL_NO_DLACTIVEXCTLS = 1024;
  static final int DLCTL_DOWNLOADONLY = 2048;
  static final int DLCTL_NO_FRAMEDOWNLOAD = 4096;
  static final int DLCTL_RESYNCHRONIZE = 8192;
  static final int DLCTL_PRAGMA_NO_CACHE = 16384;
  static final int DLCTL_FORCEOFFLINE = 268435456;
  static final int DLCTL_NO_CLIENTPULL = 536870912;
  static final int DLCTL_SILENT = 1073741824;
  static final int DOCHOSTUIFLAG_THEME = 262144;
  static final int DOCHOSTUIFLAG_NO3DBORDER = 4;
  static final int DOCHOSTUIFLAG_NO3DOUTERBORDER = 2097152;
  static final String ABOUT_BLANK = "about:blank";
  static final String CLSID_SHELLEXPLORER1 = "{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}";
  static final int DEFAULT_IE_VERSION = 9000;
  static final String EXTENSION_PDF = ".pdf";
  static final String HTML_DOCUMENT = "HTML Document";
  static final int MAX_PDF = 20;
  static final char SEPARATOR_OS = System.getProperty("file.separator").charAt(0);
  static final String PROPERTY_IEVERSION = "org.eclipse.swt.browser.IEVersion";
  static final String VALUE_DEFAULT = "default";
  static final String EVENT_DOUBLECLICK = "dblclick";
  static final String EVENT_DRAGEND = "dragend";
  static final String EVENT_DRAGSTART = "dragstart";
  static final String EVENT_KEYDOWN = "keydown";
  static final String EVENT_KEYPRESS = "keypress";
  static final String EVENT_KEYUP = "keyup";
  static final String EVENT_MOUSEMOVE = "mousemove";
  static final String EVENT_MOUSEWHEEL = "mousewheel";
  static final String EVENT_MOUSEUP = "mouseup";
  static final String EVENT_MOUSEDOWN = "mousedown";
  static final String EVENT_MOUSEOUT = "mouseout";
  static final String EVENT_MOUSEOVER = "mouseover";
  static final String PROTOCOL_FILE = "file://";
  static final String PROPERTY_ALTKEY = "altKey";
  static final String PROPERTY_BUTTON = "button";
  static final String PROPERTY_CTRLKEY = "ctrlKey";
  static final String PROPERTY_DOCUMENT = "Document";
  static final String PROPERTY_FROMELEMENT = "fromElement";
  static final String PROPERTY_KEYCODE = "keyCode";
  static final String PROPERTY_REPEAT = "repeat";
  static final String PROPERTY_RETURNVALUE = "returnValue";
  static final String PROPERTY_SCREENX = "screenX";
  static final String PROPERTY_SCREENY = "screenY";
  static final String PROPERTY_SHIFTKEY = "shiftKey";
  static final String PROPERTY_TOELEMENT = "toElement";
  static final String PROPERTY_TYPE = "type";
  static final String PROPERTY_WHEELDELTA = "wheelDelta";
  
  static
  {
    NativeClearSessions = new Runnable()
    {
      public void run()
      {
        if (OS.IsPPC) {
          return;
        }
        OS.InternetSetOption(0, 42, 0, 0);
      }
    };
    NativeGetCookie = new Runnable()
    {
      public void run()
      {
        if (OS.IsPPC) {
          return;
        }
        TCHAR url = new TCHAR(0, IE.CookieUrl, true);
        TCHAR cookieData = new TCHAR(0, 8192);
        int[] size = { cookieData.length() };
        if (!OS.InternetGetCookie(url, null, cookieData, size))
        {
          size[0] /= TCHAR.sizeof;
          cookieData = new TCHAR(0, size[0]);
          if (!OS.InternetGetCookie(url, null, cookieData, size)) {
            return;
          }
        }
        String allCookies = cookieData.toString(0, size[0]);
        StringTokenizer tokenizer = new StringTokenizer(allCookies, ";");
        while (tokenizer.hasMoreTokens())
        {
          String cookie = tokenizer.nextToken();
          int index = cookie.indexOf('=');
          if (index != -1)
          {
            String name = cookie.substring(0, index).trim();
            if (name.equals(IE.CookieName))
            {
              IE.CookieValue = cookie.substring(index + 1).trim();
              return;
            }
          }
        }
      }
    };
    NativeSetCookie = new Runnable()
    {
      public void run()
      {
        if (OS.IsPPC) {
          return;
        }
        TCHAR url = new TCHAR(0, IE.CookieUrl, true);
        TCHAR value = new TCHAR(0, IE.CookieValue, true);
        IE.CookieResult = OS.InternetSetCookie(url, null, value);
      }
    };
    TCHAR key = new TCHAR(0, "Software\\Microsoft\\Internet Explorer", true);
    int[] phkResult = new int[1];
    if (OS.RegOpenKeyEx(-2147483646, key, 0, 131097, phkResult) == 0)
    {
      int[] lpcbData = new int[1];
      TCHAR buffer = new TCHAR(0, "Version", true);
      int result = OS.RegQueryValueEx(phkResult[0], buffer, 0, null, null, lpcbData);
      if (result == 0)
      {
        TCHAR lpData = new TCHAR(0, lpcbData[0] / TCHAR.sizeof);
        result = OS.RegQueryValueEx(phkResult[0], buffer, 0, null, lpData, lpcbData);
        if (result == 0)
        {
          String versionString = lpData.toString(0, lpData.strlen());
          int index = versionString.indexOf(".");
          if (index != -1)
          {
            String majorString = versionString.substring(0, index);
            try
            {
              IEVersion = Integer.valueOf(majorString).intValue();
            }
            catch (NumberFormatException localNumberFormatException) {}
          }
        }
      }
      OS.RegCloseKey(phkResult[0]);
    }
    key = new TCHAR(0, "Shell.Explorer\\CLSID", true);
    phkResult = new int[1];
    if (OS.RegOpenKeyEx(Integer.MIN_VALUE, key, 0, 131097, phkResult) == 0)
    {
      int[] lpcbData = new int[1];
      int result = OS.RegQueryValueEx(phkResult[0], null, 0, null, null, lpcbData);
      if (result == 0)
      {
        TCHAR lpData = new TCHAR(0, lpcbData[0] / TCHAR.sizeof);
        result = OS.RegQueryValueEx(phkResult[0], null, 0, null, lpData, lpcbData);
        if (result == 0)
        {
          String clsid = lpData.toString(0, lpData.strlen());
          if (clsid.equals("{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}"))
          {
            key = new TCHAR(0, "Shell.Explorer.2", true);
            int[] phkResult2 = new int[1];
            if (OS.RegOpenKeyEx(Integer.MIN_VALUE, key, 0, 131097, phkResult2) == 0)
            {
              OS.RegCloseKey(phkResult2[0]);
              ProgId = "Shell.Explorer.2";
            }
          }
        }
      }
      OS.RegCloseKey(phkResult[0]);
    }
    if (NativePendingCookies != null) {
      SetPendingCookies(NativePendingCookies);
    }
    NativePendingCookies = null;
  }
  
  public void create(Composite parent, int style)
  {
    this.style = style;
    frame = new OleFrame(browser, 0);
    try
    {
      site = new WebSite(frame, 0, ProgId);
    }
    catch (SWTException localSWTException)
    {
      browser.dispose();
      SWT.error(2);
    }
    if (!Initialized)
    {
      Initialized = true;
      int version = 0;
      String versionProperty = System.getProperty("org.eclipse.swt.browser.IEVersion");
      if (versionProperty != null) {
        if (versionProperty.equalsIgnoreCase("default")) {
          version = -1;
        } else {
          try
          {
            version = Integer.valueOf(versionProperty).intValue();
          }
          catch (NumberFormatException localNumberFormatException) {}
        }
      }
      if (version == 0) {
        if (IEVersion != 0) {
          version = IEVersion * 1000;
        } else {
          version = 9000;
        }
      }
      if (version != -1)
      {
        int[] key = new int[1];
        TCHAR subkey = new TCHAR(0, "Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION", true);
        if (OS.RegCreateKeyEx(-2147483647, subkey, 0, null, 1, 131079, 0, key, null) == 0)
        {
          TCHAR lpszFile = new TCHAR(0, 260);
          OS.GetModuleFileName(0, lpszFile, lpszFile.length());
          String path = lpszFile.toString(0, lpszFile.strlen());
          int index = path.lastIndexOf(SEPARATOR_OS);
          String executable = index != -1 ? path.substring(index + 1) : path;
          TCHAR lpValueName = new TCHAR(0, executable, true);
          if (OS.RegQueryValueEx(key[0], lpValueName, 0, null, null, null) == 2) {
            if (OS.RegSetValueEx(key[0], lpValueName, 0, 4, new int[] { version }, 4) == 0) {
              parent.getDisplay().addListener(12, new Listener()
              {
                private final TCHAR val$subkey;
                private final TCHAR val$lpValueName;
                
                public void handleEvent(Event event)
                {
                  int[] key = new int[1];
                  if (OS.RegOpenKeyEx(-2147483647, val$subkey, 0, 131078, key) == 0) {
                    OS.RegDeleteValue(key[0], val$lpValueName);
                  }
                }
              });
            }
          }
          OS.RegCloseKey(key[0]);
        }
      }
    }
    site.doVerb(-5);
    auto = new OleAutomation(site);
    
    domListener = new OleListener()
    {
      public void handleEvent(OleEvent e)
      {
        handleDOMEvent(e);
      }
    };
    Listener listener = new Listener()
    {
      public void handleEvent(Event e)
      {
        switch (type)
        {
        case 12: 
          if (ignoreDispose)
          {
            ignoreDispose = false;
          }
          else
          {
            ignoreDispose = true;
            browser.notifyListeners(type, e);
            type = 0;
            if (!browser.isClosing)
            {
              LocationListener[] oldLocationListeners = locationListeners;
              locationListeners = new LocationListener[0];
              site.ignoreAllMessages = true;
              execute("window.location.href='about:blank'");
              site.ignoreAllMessages = false;
              locationListeners = oldLocationListeners;
            }
            if (!frame.isDisposed()) {
              unhookDOMListeners(documents);
            }
            for (int i = 0; i < documents.length; i++) {
              documents[i].dispose();
            }
            documents = null;
            
            Enumeration elements = functions.elements();
            while (elements.hasMoreElements()) {
              ((BrowserFunction)elements.nextElement()).dispose(false);
            }
            functions = null;
            
            lastNavigateURL = (uncRedirect = null);
            domListener = null;
            if (auto != null) {
              auto.dispose();
            }
            auto = null;
          }
          break;
        case 11: 
          frame.setBounds(browser.getClientArea());
          break;
        case 37: 
          doit = false;
          break;
        case 15: 
          site.setFocus();
          break;
        case 31: 
          if ((detail == 8) && ((widget instanceof WebSite)))
          {
            browser.traverse(8, e);
            doit = false;
          }
          if ((detail == 16) && ((widget instanceof Browser)))
          {
            site.traverse(16, e);
            doit = false;
          }
          if ((detail == 4) && (doit) && ((widget instanceof Browser)))
          {
            type = 0;
            doit = false;
          }
          break;
        }
      }
    };
    browser.addListener(12, listener);
    browser.addListener(15, listener);
    browser.addListener(11, listener);
    browser.addListener(31, listener);
    site.addListener(37, listener);
    site.addListener(31, listener);
    
    OleListener oleListener = new OleListener()
    {
      public void handleEvent(OleEvent event)
      {
        if (auto != null) {
          switch (type)
          {
          case 250: 
            isRefresh = false;
            if (!performingInitialNavigate)
            {
              Variant varResult = arguments[1];
              String url = varResult.getString();
              if (uncRedirect != null)
              {
                if ((uncRedirect.equals(url)) || ((uncRedirect.startsWith(url)) && (uncRedirect.indexOf('\\', 2) == url.length())))
                {
                  Variant cancel = arguments[6];
                  if (cancel != null)
                  {
                    int pCancel = cancel.getByRef();
                    COM.MoveMemory(pCancel, new short[1], 2);
                  }
                }
                else
                {
                  uncRedirect = null;
                }
              }
              else
              {
                if ((url.indexOf(":/") == -1) && (url.indexOf(":\\") != -1)) {
                  url = "file://" + url.replace('\\', '/');
                }
                if ((url.startsWith("file://")) && (_getUrl().startsWith("about:blank")) && (untrustedText))
                {
                  Variant cancel = arguments[6];
                  if (cancel != null)
                  {
                    int pCancel = cancel.getByRef();
                    COM.MoveMemory(pCancel, new short[] { -1 }, 2);
                  }
                }
                else
                {
                  LocationEvent newEvent = new LocationEvent(IE.this.browser);
                  display = IE.this.browser.getDisplay();
                  widget = IE.this.browser;
                  location = url;
                  doit = true;
                  for (int i = 0; i < locationListeners.length; i++) {
                    locationListeners[i].changing(newEvent);
                  }
                  boolean doit = (doit) && (!IE.this.browser.isDisposed());
                  Variant cancel = arguments[6];
                  if (cancel != null)
                  {
                    int pCancel = cancel.getByRef();
                    COM.MoveMemory(pCancel, new short[] { doit ? 0 : -1 }, 2);
                  }
                  if (doit) {
                    lastNavigateURL = url;
                  }
                }
              }
            }
            break;
          case 105: 
            boolean enabled = false;
            Variant varResult = arguments[0];
            int command = varResult.getInt();
            varResult = arguments[1];
            enabled = varResult.getBoolean();
            switch (command)
            {
            case 2: 
              back = enabled; break;
            case 1: 
              forward = enabled;
            }
            break;
          case 259: 
            if (performingInitialNavigate)
            {
              performingInitialNavigate = false;
              if (pendingText != null) {
                setText((String)pendingText[0], ((Boolean)pendingText[1]).booleanValue());
              } else if (pendingUrl != null) {
                setUrl((String)pendingUrl[0], (String)pendingUrl[1], (String[])pendingUrl[2]);
              }
              pendingText = (pendingUrl = null);
            }
            else
            {
              Variant varResult = arguments[0];
              IDispatch dispatch = varResult.getDispatch();
              
              varResult = arguments[1];
              String url = varResult.getString();
              if ((url.indexOf(":/") == -1) && (url.indexOf(":\\") != -1)) {
                url = "file://" + url.replace('\\', '/');
              }
              if ((html != null) && (url.equals("about:blank")))
              {
                if (delaySetText)
                {
                  delaySetText = false;
                  IE.this.browser.getDisplay().asyncExec(new IE.8(this));
                }
                else
                {
                  setHTML(html);
                  html = null;
                }
              }
              else
              {
                Variant variant = new Variant(auto);
                IDispatch top = variant.getDispatch();
                LocationEvent locationEvent = new LocationEvent(IE.this.browser);
                display = IE.this.browser.getDisplay();
                widget = IE.this.browser;
                location = url;
                top = (top.getAddress() == dispatch.getAddress());
                for (int i = 0; i < locationListeners.length; i++) {
                  locationListeners[i].changed(locationEvent);
                }
                if (IE.this.browser.isDispos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd