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 143712 Details for
Bug 279103
[Cocoa] SelectionChanged events behaviour broken
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]
fix
tree_table_selection.patch (text/plain), 5.06 KB, created by
Silenio Quarti
on 2009-08-06 15:53:04 EDT
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Silenio Quarti
Created:
2009-08-06 15:53:04 EDT
Size:
5.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java,v >retrieving revision 1.179 >diff -u -r1.179 Tree.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java 22 Jul 2009 20:34:34 -0000 1.179 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java 6 Aug 2009 19:55:18 -0000 >@@ -84,7 +84,7 @@ > TreeColumn sortColumn; > int columnCount; > int sortDirection; >- boolean ignoreExpand, ignoreSelect, ignoreRedraw, reloadPending, drawExpansion; >+ boolean ignoreExpand, ignoreSelect, ignoreRedraw, reloadPending, drawExpansion, wasSelected; > Rectangle imageBounds; > TreeItem insertItem; > boolean insertBefore; >@@ -1892,8 +1892,9 @@ > } > > void mouseDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { >+ NSOutlineView widget = (NSOutlineView)view; >+ NSEvent nsEvent = new NSEvent(theEvent); > if (headerView != null && id == headerView.id) { >- NSTableView widget = (NSTableView)view; > widget.setAllowsColumnReordering(false); > NSPoint pt = headerView.convertPoint_fromView_(new NSEvent(theEvent).locationInWindow(), null); > int /*long*/ nsIndex = headerView.columnAtPoint(pt); >@@ -1911,10 +1912,27 @@ > // Bug/feature in Cocoa: If the tree has a context menu we just set it visible instead of returning > // it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, > // which is interpreted as a single click that clears the selection. Fix is to ignore control-click, >- NSEvent event = new NSEvent(theEvent); >- if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; >+ if ((nsEvent.modifierFlags() & OS.NSControlKeyMask) != 0) return; > } >+ wasSelected = false; > super.mouseDown(id, sel, theEvent); >+ if (!wasSelected) { >+ NSPoint pt = view.convertPoint_fromView_(nsEvent.locationInWindow(), null); >+ int /*long*/ row = widget.rowAtPoint(pt); >+ if (row != -1 && widget.isRowSelected(row)) { >+ NSRect rect = widget.frameOfOutlineCellAtRow(row); >+ if (!OS.NSPointInRect(pt, rect)) { >+ id itemID = widget.itemAtRow(row); >+ Widget item = display.getWidget (itemID.id); >+ if (item != null && item instanceof TreeItem) { >+ Event event = new Event (); >+ event.item = item; >+ postEvent (SWT.Selection, event); >+ } >+ } >+ } >+ } >+ wasSelected = false; > } > > /* >@@ -2085,6 +2103,7 @@ > } > > void outlineViewSelectionDidChange (int /*long*/ id, int /*long*/ sel, int /*long*/ notification) { >+ wasSelected = true; > if (ignoreSelect) return; > NSOutlineView widget = (NSOutlineView) view; > int row = (int)/*64*/widget.selectedRow (); >Index: Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java,v >retrieving revision 1.152 >diff -u -r1.152 Table.java >--- Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java 20 Jul 2009 14:32:14 -0000 1.152 >+++ Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java 6 Aug 2009 19:55:18 -0000 >@@ -76,7 +76,7 @@ > NSTextFieldCell dataCell; > NSButtonCell buttonCell; > int columnCount, itemCount, lastIndexOf, sortDirection; >- boolean ignoreSelect, fixScrollWidth, drawExpansion; >+ boolean ignoreSelect, fixScrollWidth, drawExpansion, wasSelected; > Rectangle imageBounds; > > static int NEXT_ID; >@@ -1863,8 +1863,9 @@ > } > > void mouseDown (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) { >+ NSTableView widget = (NSTableView)view; >+ NSEvent nsEvent = new NSEvent(theEvent); > if (headerView != null && id == headerView.id) { >- NSTableView widget = (NSTableView)view; > widget.setAllowsColumnReordering(false); > NSPoint pt = headerView.convertPoint_fromView_(new NSEvent(theEvent).locationInWindow(), null); > int /*long*/ nsIndex = headerView.columnAtPoint(pt); >@@ -1883,10 +1884,22 @@ > // it from menuForEvent:. This has the side effect, however, of sending control-click to the NSTableView, > // which is interpreted as a single click that clears the selection. Fix is to ignore control-click if the > // view has a context menu. >- NSEvent event = new NSEvent(theEvent); >- if ((event.modifierFlags() & OS.NSControlKeyMask) != 0) return; >+ if ((nsEvent.modifierFlags() & OS.NSControlKeyMask) != 0) return; > } >+ wasSelected = false; > super.mouseDown(id, sel, theEvent); >+ if (!wasSelected) { >+ NSPoint pt = view.convertPoint_fromView_(nsEvent.locationInWindow(), null); >+ int /*long*/ row = widget.rowAtPoint(pt); >+ if (row != -1 && widget.isRowSelected(row)) { >+ if (0 < row && row <= itemCount) { >+ Event event = new Event (); >+ event.item = _getItem ((int)/*64*/row); >+ postEvent (SWT.Selection, event); >+ } >+ } >+ } >+ wasSelected = false; > } > > /* >@@ -3013,6 +3026,7 @@ > } > > void tableViewSelectionDidChange (int /*long*/ id, int /*long*/ sel, int /*long*/ aNotification) { >+ wasSelected = true; > if (ignoreSelect) return; > NSTableView widget = (NSTableView) view; > int row = (int)/*64*/widget.selectedRow ();
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 279103
: 143712