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 139016 Details for
Bug 279972
[Tree] ENTER does not notify widget default selected
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]
Patch that enable widgetDefaultSelected event on ENTER key.
Bug-279972.patch (text/plain), 6.27 KB, created by
Ivan Furnadjiev
on 2009-06-12 07:16:52 EDT
(
hide
)
Description:
Patch that enable widgetDefaultSelected event on ENTER key.
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2009-06-12 07:16:52 EDT
Size:
6.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.demo >Index: src/org/eclipse/rap/demo/controls/TreeTab.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.demo/src/org/eclipse/rap/demo/controls/TreeTab.java,v >retrieving revision 1.27 >diff -u -r1.27 TreeTab.java >--- src/org/eclipse/rap/demo/controls/TreeTab.java 16 Sep 2008 16:28:13 -0000 1.27 >+++ src/org/eclipse/rap/demo/controls/TreeTab.java 12 Jun 2009 11:13:41 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2009 Innoopract Informationssysteme GmbH. > * 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 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing development > ******************************************************************************/ > > package org.eclipse.rap.demo.controls; >@@ -144,9 +145,11 @@ > } > > public void widgetDefaultSelected( final SelectionEvent event ) { >- String title = "Double Click"; >+ String title = "Widget Default Selected"; > Item item = ( Item )event.item; >- String message = "Double click on " + item.getText() + " received"; >+ String message = "Widget default selected on " >+ + item.getText() >+ + " received"; > MessageDialog.openInformation( getShell(), title, message ); > } > } ); >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/widgets/Tree.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/widgets/Tree.js,v >retrieving revision 1.7 >diff -u -r1.7 Tree.js >--- js/org/eclipse/swt/widgets/Tree.js 19 Aug 2008 15:40:24 -0000 1.7 >+++ js/org/eclipse/swt/widgets/Tree.js 12 Jun 2009 11:13:43 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2007, 2009 Innoopract Informationssysteme GmbH. > * 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 >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing development > ******************************************************************************/ > > /** >@@ -57,7 +58,8 @@ > this._tree.addEventListener( "contextmenu", this._onContextMenu, this ); > this._tree.addEventListener( "focus", this._onFocusIn, this ); > this._tree.addEventListener( "blur", this._onFocusOut, this ); >- this._tree.addEventListener( "appear", this._updateLayout, this ); >+ this._tree.addEventListener( "appear", this._updateLayout, this ); >+ this._tree.addEventListener( "keydown", this._onKeyDown, this ); > // TODO [rst] Find out why this is not the default appearance > this._tree.setAppearance( "tree" ); > >@@ -107,6 +109,7 @@ > this._tree.removeEventListener( "focus", this._onFocusIn, this ); > this._tree.removeEventListener( "blur", this._onFocusOut, this ); > this._tree.removeEventListener( "appear", this._updateLayout, this ); >+ this._tree.removeEventListener( "keydown", this._onKeyDown, this ); > this._tree.removeEventListener( "changeElement", this._onTreeElementChange, this._tree ); > this._tree.dispose(); > this._tree = null; >@@ -430,6 +433,32 @@ > > ///////////////// > // Event Listener >+ _onKeyDown : function( evt ) { >+ switch( evt.getKeyIdentifier() ) { >+ case "Enter": >+ var item = this._tree.getManager().getLeadItem(); >+ var selection = this._getSelectionIndices(); >+ if( selection != "" ) { >+ this._sendWidgetDefaultSelected( item ); >+ } >+ break; >+ } >+ }, >+ >+ _sendWidgetDefaultSelected : function( item ) { >+ if( !org_eclipse_rap_rwt_EventUtil_suspend ) { >+ if( this._selectionListeners ) { >+ var wm = org.eclipse.swt.WidgetManager.getInstance(); >+ var id = wm.findIdByWidget( this ); >+ var itemId = wm.findIdByWidget( item ); >+ var req = org.eclipse.swt.Request.getInstance(); >+ var eventName = "org.eclipse.swt.events.widgetDefaultSelected"; >+ req.addEvent( eventName, id ); >+ req.addParameter( eventName + ".item", itemId ); >+ req.send(); >+ } >+ } >+ }, > > _onChangeSelection : function( evt ) { > this._updateSelectedItemState(); >@@ -445,8 +474,8 @@ > // When first visible item is selected and arrow up is pressed the root > // item ( == this ) is selected which results in an invisible selection. > if( item == this ) { >- this._tree.getFirstVisibleChildOfFolder().setSelected( true ); >- this._tree.setSelected( false ); >+ this._tree.getFirstVisibleChildOfFolder().setSelected( true ); >+ this._tree.setSelected( false ); > } else { > if ( this._selectionListeners ) { > this._suspendClicks(); >@@ -546,19 +575,8 @@ > * Handle double click on tree item > * called by org.eclipse.swt.widgets.TreeItem > */ >- _notifyItemDblClick : function(item) { >- if( !org_eclipse_rap_rwt_EventUtil_suspend ) { >- if( this._selectionListeners ) { >- var wm = org.eclipse.swt.WidgetManager.getInstance(); >- var id = wm.findIdByWidget( this ); >- var itemId = wm.findIdByWidget( item ); >- var req = org.eclipse.swt.Request.getInstance(); >- var eventName = "org.eclipse.swt.events.widgetDefaultSelected"; >- req.addEvent( eventName, id ); >- req.addParameter( eventName + ".item", itemId ); >- req.send(); >- } >- } >+ _notifyItemDblClick : function( item ) { >+ this._sendWidgetDefaultSelected( item ); > }, > > /*
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 279972
:
138948
|
139016
|
140213