Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 294635
Collapse All | Expand All

(-)js/org/eclipse/swt/browser/Browser.js (-8 / +34 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 Innoopract Informationssysteme GmbH.
2
 * Copyright (c) 2007, 2009 Innoopract Informationssysteme GmbH.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     Innoopract Informationssysteme GmbH - initial API and implementation
9
 *     Innoopract Informationssysteme GmbH - initial API and implementation
10
 *     EclipseSource - ongoing development
10
 ******************************************************************************/
11
 ******************************************************************************/
11
12
12
qx.Class.define( "org.eclipse.swt.browser.Browser", {
13
qx.Class.define( "org.eclipse.swt.browser.Browser", {
Lines 14-43 Link Here
14
  
15
  
15
  construct : function() {
16
  construct : function() {
16
    this.base( arguments );
17
    this.base( arguments );
17
    // TODO [rh] preliminary workaround to make Browser accessible by tab
18
    this.setTabIndex( 1 );
19
    this.setAppearance( "browser" );
18
    this.setAppearance( "browser" );
20
    this.addEventListener( "load", this._onLoad, this );
19
    this.addEventListener( "focus", this._onFocusIn, this );
20
    this.addEventListener( "blur", this._onFocusOut, this );
21
    this.__onBlockerMouseDown
22
      = qx.lang.Function.bind( this._onBlockerMouseDown, this );
21
  },
23
  },
22
  
24
  
23
  destruct : function() {
25
  destruct : function() {
24
    this.removeEventListener( "load", this._onLoad, this );
26
    this.removeEventListener( "focus", this._onFocusIn, this );
27
    this.removeEventListener( "blur", this._onFocusOut, this );
28
    qx.html.EventRegistration.removeEventListener( this.getBlockerNode(),
29
                                                   "mousedown",
30
                                                   this.__onBlockerMouseDown );
25
  },  
31
  },  
26
32
27
  members : {
33
  members : {
28
    
34
    
29
    _onLoad : function( evt ) {
35
    _applyElement : function( value, old ) {
36
      this.base( arguments, value, old );
37
      qx.html.EventRegistration.addEventListener( this.getBlockerNode(),
38
                                                  "mousedown",
39
                                                  this.__onBlockerMouseDown );
40
    },
41
    
42
    _beforeAppear : function() {
43
      this.base( arguments );
44
      qx.ui.embed.IframeManager.getInstance().remove( this );
45
    },
46
    
47
    _onFocusIn : function( evt ) {
30
      this.release();
48
      this.release();
31
    },
49
    },
32
    
50
    
51
    _onFocusOut : function( evt ) {
52
      this.block();
53
    },
54
    
55
    _onBlockerMouseDown : function( evt ) {
56
      this.focus();
57
    },
58
    
33
    execute : function( script ) {
59
    execute : function( script ) {
34
      var result = true;
60
      var result = true;
35
      try {
61
      try {
36
        if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) {
62
        if( qx.core.Variant.isSet( "qx.client", "mshtml" ) ) {
37
          this.getContentWindow().execScript( script , "JScript" );
63
          this.getContentWindow().execScript( script , "JScript" );
38
        } else {
64
        } else {
39
          this.getContentWindow().eval( script );                    
65
          this.getContentWindow().eval( script );
40
        }        
66
        }
41
      } catch( e ) {
67
      } catch( e ) {
42
        result = false;
68
        result = false;
43
      }
69
      }

Return to bug 294635