Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 208627 Details for
Bug 366929
Enable rendering of HTML element IDs for RAP widgets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
introduces support for optional rendering of html ids for widgets. plus small refractoring of ProtocolTest.js
enableIdRendering_patch (text/plain), 6.04 KB, created by
Nick Mussin
on 2011-12-20 10:31:17 EST
(
hide
)
Description:
introduces support for optional rendering of html ids for widgets. plus small refractoring of ProtocolTest.js
Filename:
MIME Type:
Creator:
Nick Mussin
Created:
2011-12-20 10:31:17 EST
Size:
6.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: js/org/eclipse/rwt/protocol/ObjectManager.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/js/org/eclipse/rwt/protocol/ObjectManager.js,v >retrieving revision 1.2 >diff -u -r1.2 ObjectManager.js >--- js/org/eclipse/rwt/protocol/ObjectManager.js 25 Oct 2011 13:41:12 -0000 1.2 >+++ js/org/eclipse/rwt/protocol/ObjectManager.js 20 Dec 2011 15:29:52 -0000 >@@ -22,6 +22,9 @@ > "type" : type > }; > object._rwtId = id; >+ if( typeof object.applyObjectId === "function" ) { >+ object.applyObjectId( id ); >+ } > if( this._callbacks[ id ] ) { > for( var i = 0; i < this._callbacks[ id ].length; i++ ) { > this._callbacks[ id ][ i ]( object ); >Index: js/qx/ui/core/Widget.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/js/qx/ui/core/Widget.js,v >retrieving revision 1.10 >diff -u -r1.10 Widget.js >--- js/qx/ui/core/Widget.js 9 Dec 2011 08:07:12 -0000 1.10 >+++ js/qx/ui/core/Widget.js 20 Dec 2011 15:29:56 -0000 >@@ -91,6 +91,8 @@ > > _autoFlushTimeout : null, > _flushGlobalQueuesPhase : 0, >+ _renderHtmlIds : false, >+ > _FLUSH_PHASE_IDLE : 0, > _FLUSH_PHASE_WIDGET : 1, > _FLUSH_PHASE_STATE : 2, >@@ -4057,6 +4059,12 @@ > result = this._adapters[ key ]; > } > return result; >+ }, >+ >+ applyObjectId : function( id ) { >+ if( qx.ui.core.Widget._renderHtmlIds ) { >+ this.setHtmlAttribute( "id", id ); >+ } > } > > }, >#P org.eclipse.rap.rwt.jstest >Index: js/org/eclipse/rwt/test/tests/ObjectManagerTest.js >=================================================================== >RCS file: js/org/eclipse/rwt/test/tests/ObjectManagerTest.js >diff -N js/org/eclipse/rwt/test/tests/ObjectManagerTest.js >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ js/org/eclipse/rwt/test/tests/ObjectManagerTest.js 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,63 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 EclipseSource and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * EclipseSource - initial API and implementation >+ ******************************************************************************/ >+ >+qx.Class.define( "org.eclipse.rwt.test.tests.ObjectManagerTest", { >+ >+ extend : qx.core.Object, >+ >+ members : { >+ >+ testAdd : function() { >+ var manager = org.eclipse.rwt.protocol.ObjectManager; >+ var obj = {}; >+ >+ manager.add( "myId", obj, "myType" ); >+ >+ assertIdentical( obj, manager.getObject( "myId" ) ); >+ assertEquals( "myType", manager.getType( "myId" ) ); >+ this._clearObjectManager(); >+ }, >+ >+ testRemove : function() { >+ var manager = org.eclipse.rwt.protocol.ObjectManager; >+ var obj = {}; >+ manager.add( "myId", obj, "myType" ); >+ >+ manager.remove( "myId" ); >+ >+ assertIdentical( undefined, manager.getObject( "myId" ) ); >+ assertIdentical( undefined, manager.getType( "myId" ) ); >+ this._clearObjectManager(); >+ }, >+ >+ testApplyObjectIdIsCalled : function() { >+ var manager = org.eclipse.rwt.protocol.ObjectManager; >+ var log = ""; >+ var obj = { >+ applyObjectId : function( id ) { >+ log += id; >+ } >+ }; >+ >+ manager.add( "myId", obj, "myType" ); >+ >+ assertEquals( "myId", log ); >+ this._clearObjectManager(); >+ }, >+ >+ _clearObjectManager: function() { >+ var manager = org.eclipse.rwt.protocol.ObjectManager; >+ manager._map = {}; >+ manager._callbacks = {}; >+ } >+ } >+ >+} ); >Index: js/org/eclipse/rwt/test/tests/ProtocolTest.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/ProtocolTest.js,v >retrieving revision 1.19 >diff -u -r1.19 ProtocolTest.js >--- js/org/eclipse/rwt/test/tests/ProtocolTest.js 18 Nov 2011 11:58:03 -0000 1.19 >+++ js/org/eclipse/rwt/test/tests/ProtocolTest.js 20 Dec 2011 15:29:59 -0000 >@@ -29,17 +29,6 @@ > } > }, > >- testObjectManager : function() { >- var manager = org.eclipse.rwt.protocol.ObjectManager; >- var obj = {}; >- manager.add( "myId", obj, "myType" ); >- assertIdentical( obj, manager.getObject( "myId" ) ); >- assertEquals( "myType", manager.getType( "myId" ) ); >- manager.remove( "myId" ); >- assertTrue( manager.getObject( "myId" ) == null ); >- assertTrue( manager.getType( "myId" ) == null ); >- }, >- > testProcessSet : function() { > var registry = org.eclipse.rwt.protocol.AdapterRegistry; > var processor = org.eclipse.rwt.protocol.Processor; >Index: js/org/eclipse/rwt/test/tests/WidgetTest.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/WidgetTest.js,v >retrieving revision 1.10 >diff -u -r1.10 WidgetTest.js >--- js/org/eclipse/rwt/test/tests/WidgetTest.js 12 Dec 2011 11:57:27 -0000 1.10 >+++ js/org/eclipse/rwt/test/tests/WidgetTest.js 20 Dec 2011 15:29:59 -0000 >@@ -534,6 +534,25 @@ > assertFalse( button.getFocused() ); > }, > >+ testApplyObjectId_default : function() { >+ var button = new org.eclipse.rwt.widgets.Button( "push" ); >+ button.addToDocument(); >+ >+ button.applyObjectId( "w23" ); >+ >+ assertIdentical( "", button.getHtmlAttribute( "id" ) ); >+ }, >+ >+ testApplyObjectId_whenActivated : function() { >+ var button = new org.eclipse.rwt.widgets.Button( "push" ); >+ button.addToDocument(); >+ >+ qx.ui.core.Widget._renderHtmlIds = true; >+ button.applyObjectId( "w23" ); >+ >+ assertEquals( "w23", button.getHtmlAttribute( "id" ) ); >+ }, >+ > ///////// > // Helper > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 366929
: 208627