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 148313 Details for
Bug 290798
[Button] Refactor AbstractButton.js to remove dropdown-features
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.
Fix
RefactorDropDown.txt (text/plain), 5.24 KB, created by
Tim Buschtoens
on 2009-09-29 07:34:03 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Tim Buschtoens
Created:
2009-09-29 07:34:03 EDT
Size:
5.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/rwt/widgets/AbstractButton.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/rwt/widgets/AbstractButton.js,v >retrieving revision 1.1 >diff -u -r1.1 AbstractButton.js >--- js/org/eclipse/rwt/widgets/AbstractButton.js 18 Sep 2009 16:05:32 -0000 1.1 >+++ js/org/eclipse/rwt/widgets/AbstractButton.js 29 Sep 2009 11:31:48 -0000 >@@ -17,7 +17,6 @@ > this.base( arguments, [ "image", "image", "label", "label", "image" ] ); > this._hasSelectionListener = false; > this._selected = false; >- this._isDropDownClick = false; > this._image = [ null, null, null ] ; > this._hotImage = [ null, null, null ]; > this.addEventListener( "mouseover", this._onMouseOver ); >@@ -30,7 +29,6 @@ > this.addState( buttonType ); > switch( buttonType ) { > case "push": >- case "dropDown": > this._isSelectable = false; > this._isDeselectable = false; > this._sendEvent = true; >@@ -48,9 +46,6 @@ > org.eclipse.rwt.RadioButtonUtil.registerExecute( this ); > org.eclipse.rwt.RadioButtonUtil.registerKeypress( this ); > break; >- default: >- throw( "Unkown button type " + buttonType ); >- break; > } > > }, >@@ -144,17 +139,12 @@ > if( this._sendEvent ) { > var widgetManager = org.eclipse.swt.WidgetManager.getInstance(); > var id = widgetManager.findIdByWidget( this ); >- if( this._isDropDownClick ) { >- req.addEvent( "org.eclipse.swt.events.widgetSelected.detail", >- "arrow" ); >- this._isDropDownClick = false; >- } > req.addEvent( "org.eclipse.swt.events.widgetSelected", id ); > } > req.send(); > } > }, >- >+ > _onMouseOver : function( event ) { > if ( event.getTarget() == this ) { > if( this.hasState( "abandoned" ) ) { >@@ -181,19 +171,10 @@ > _onMouseDown : function( event ) { > if ( event.getTarget() == this && event.isLeftButtonPressed() ) { > this.removeState( "abandoned" ); >- if( this._isDropdownClick( event ) ) { >- this._isDropDownClick = true; >- this.execute(); >- } else { >- this.addState( "pressed" ); >- } >+ this.addState( "pressed" ); > } > }, > >- _isDropdownClick : function( event ) { >- return false; >- }, >- > _onMouseUp : function( event ) { > this.setCapture( false ); > var hasPressed = this.hasState( "pressed" ); >@@ -251,7 +232,7 @@ > event.preventDefault(); > event.stopPropagation(); > } >- > } >+ > } > }); >Index: js/org/eclipse/rwt/widgets/ToolItem.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/rwt/widgets/ToolItem.js,v >retrieving revision 1.1 >diff -u -r1.1 ToolItem.js >--- js/org/eclipse/rwt/widgets/ToolItem.js 18 Sep 2009 16:05:32 -0000 1.1 >+++ js/org/eclipse/rwt/widgets/ToolItem.js 29 Sep 2009 11:31:48 -0000 >@@ -14,16 +14,20 @@ > > construct : function( itemType, flat ) { > this.base( arguments, itemType ); >+ this._isDropDown = false; >+ if( itemType == "dropDown" ) { >+ this._isDropDown = true; >+ this._isSelectable = false; >+ this._isDeselectable = false; >+ this._sendEvent = true; >+ this.setCellDimension( 3, 1, 0 ); >+ this.setCellContent( 3, "" ); >+ } > this._separatorBorder = null; > this.setAppearance( "toolbar-button" ); > if( flat ) { > this.addState( "rwt_FLAT" ); > } >- this._isDropDown = itemType == "dropDown"; >- if( this._isDropDown ) { >- this.setCellDimension( 3, 1, 0 ); >- this.setCellContent( 3, "" ); >- } > }, > > properties : { >@@ -55,7 +59,19 @@ > //////////////////// > // Dropdown-support > >- // overwritten: >+ // overwritten: >+ _onMouseDown : function( event ) { >+ if ( event.getTarget() == this && event.isLeftButtonPressed() ) { >+ this.removeState( "abandoned" ); >+ if( this._isDropdownClick( event ) ) { >+ this._onDropDownClick(); >+ this._sendChanges(); >+ } else { >+ this.addState( "pressed" ); >+ } >+ } >+ }, >+ > _isDropdownClick : function( event ) { > var result = false; > var node = this.getCellNode( 3 ); >@@ -66,7 +82,20 @@ > } > return result; > }, >- >+ >+ _onDropDownClick : function() { >+ if( !org_eclipse_rap_rwt_EventUtil_suspend && this._hasSelectionListener ) >+ { >+ var req = org.eclipse.swt.Request.getInstance(); >+ if( this._sendEvent ) { >+ var widgetManager = org.eclipse.swt.WidgetManager.getInstance(); >+ var id = widgetManager.findIdByWidget( this ); >+ req.addEvent( "org.eclipse.swt.events.widgetSelected.detail", >+ "arrow" ); >+ } >+ } >+ }, >+ > _applyDropDownArrow : function( value, oldValue ) { > var url = value ? value[ 0 ] : null; > var width = value ? value[ 1 ] : 0;
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 Raw
Actions:
View
Attachments on
bug 290798
: 148313