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 48252 Details for
Bug 154289
[Viewers] - NPE in TreeEditorImpl.activateCellEditor
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 NLP and editor value appling
patch.txt (text/plain), 9.35 KB, created by
Thomas Schindl
on 2006-08-20 11:50:48 EDT
(
hide
)
Description:
Fix NLP and editor value appling
Filename:
MIME Type:
Creator:
Thomas Schindl
Created:
2006-08-20 11:50:48 EDT
Size:
9.35 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/viewers/TreeEditorImpl.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeEditorImpl.java,v >retrieving revision 1.11 >diff -u -r1.11 TreeEditorImpl.java >--- src/org/eclipse/jface/viewers/TreeEditorImpl.java 17 Aug 2006 19:34:41 -0000 1.11 >+++ src/org/eclipse/jface/viewers/TreeEditorImpl.java 20 Aug 2006 15:50:20 -0000 >@@ -72,42 +72,44 @@ > > if( part != null && part.getEditingSupport() != null && part.getEditingSupport().canEdit(element) ) { > cellEditor = part.getEditingSupport().getCellEditor(element); >- cellEditor.addListener(cellEditorListener); >- Object value = part.getEditingSupport().getValue(element); >- cellEditor.setValue(value); >- // Tricky flow of control here: >- // activate() can trigger callback to cellEditorListener which will clear cellEditor >- // so must get control first, but must still call activate() even if there is no control. >- final Control control = cellEditor.getControl(); >- cellEditor.activate(); >- if (control == null) { >- return; >- } >- setLayoutData(cellEditor.getLayoutData()); >- setEditor(control, treeItem, columnNumber); >- cellEditor.setFocus(); >- if (focusListener == null) { >- focusListener = new FocusAdapter() { >- public void focusLost(FocusEvent e) { >- applyEditorValue(); >+ if( cellEditor != null ) { >+ cellEditor.addListener(cellEditorListener); >+ Object value = part.getEditingSupport().getValue(element); >+ cellEditor.setValue(value); >+ // Tricky flow of control here: >+ // activate() can trigger callback to cellEditorListener which will clear cellEditor >+ // so must get control first, but must still call activate() even if there is no control. >+ final Control control = cellEditor.getControl(); >+ cellEditor.activate(); >+ if (control == null) { >+ return; >+ } >+ setLayoutData(cellEditor.getLayoutData()); >+ setEditor(control, treeItem, columnNumber); >+ cellEditor.setFocus(); >+ if (focusListener == null) { >+ focusListener = new FocusAdapter() { >+ public void focusLost(FocusEvent e) { >+ applyEditorValue(); >+ } >+ }; >+ } >+ control.addFocusListener(focusListener); >+ mouseListener = new MouseAdapter() { >+ public void mouseDown(MouseEvent e) { >+ // time wrap? >+ // check for expiration of doubleClickTime >+ if (e.time <= doubleClickExpirationTime) { >+ control.removeMouseListener(mouseListener); >+ cancelEditing(); >+ handleDoubleClickEvent(); >+ } else if (mouseListener != null) { >+ control.removeMouseListener(mouseListener); >+ } > } > }; >- } >- control.addFocusListener(focusListener); >- mouseListener = new MouseAdapter() { >- public void mouseDown(MouseEvent e) { >- // time wrap? >- // check for expiration of doubleClickTime >- if (e.time <= doubleClickExpirationTime) { >- control.removeMouseListener(mouseListener); >- cancelEditing(); >- handleDoubleClickEvent(); >- } else if (mouseListener != null) { >- control.removeMouseListener(mouseListener); >- } >- } >- }; >- control.addMouseListener(mouseListener); >+ control.addMouseListener(mouseListener); >+ } > } > } > >@@ -310,7 +312,7 @@ > * by delegating to the cell modifier. > */ > private void saveEditorValue(CellEditor cellEditor, Item treeItem) { >- ViewerColumn part = (ViewerColumn)treeItem.getData(ViewerColumn.COLUMN_VIEWER_KEY); >+ ViewerColumn part = viewer.getViewerColumn(columnNumber); > > if( part != null && part.getEditingSupport() != null ) { > part.getEditingSupport().setValue(treeItem.getData(), cellEditor.getValue()); >Index: src/org/eclipse/jface/viewers/TableEditorImpl.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jface/src/org/eclipse/jface/viewers/TableEditorImpl.java,v >retrieving revision 1.11 >diff -u -r1.11 TableEditorImpl.java >--- src/org/eclipse/jface/viewers/TableEditorImpl.java 17 Aug 2006 19:34:41 -0000 1.11 >+++ src/org/eclipse/jface/viewers/TableEditorImpl.java 20 Aug 2006 15:50:20 -0000 >@@ -72,42 +72,44 @@ > > if( part != null && part.getEditingSupport() != null && part.getEditingSupport().canEdit(element) ) { > cellEditor = part.getEditingSupport().getCellEditor(element); >- cellEditor.addListener(cellEditorListener); >- Object value = part.getEditingSupport().getValue(element); >- cellEditor.setValue(value); >- // Tricky flow of control here: >- // activate() can trigger callback to cellEditorListener which will clear cellEditor >- // so must get control first, but must still call activate() even if there is no control. >- final Control control = cellEditor.getControl(); >- cellEditor.activate(); >- if (control == null) { >- return; >- } >- setLayoutData(cellEditor.getLayoutData()); >- setEditor(control, tableItem, columnNumber); >- cellEditor.setFocus(); >- if (focusListener == null) { >- focusListener = new FocusAdapter() { >- public void focusLost(FocusEvent e) { >- applyEditorValue(); >+ if( cellEditor != null ) { >+ cellEditor.addListener(cellEditorListener); >+ Object value = part.getEditingSupport().getValue(element); >+ cellEditor.setValue(value); >+ // Tricky flow of control here: >+ // activate() can trigger callback to cellEditorListener which will clear cellEditor >+ // so must get control first, but must still call activate() even if there is no control. >+ final Control control = cellEditor.getControl(); >+ cellEditor.activate(); >+ if (control == null) { >+ return; >+ } >+ setLayoutData(cellEditor.getLayoutData()); >+ setEditor(control, tableItem, columnNumber); >+ cellEditor.setFocus(); >+ if (focusListener == null) { >+ focusListener = new FocusAdapter() { >+ public void focusLost(FocusEvent e) { >+ applyEditorValue(); >+ } >+ }; >+ } >+ control.addFocusListener(focusListener); >+ mouseListener = new MouseAdapter() { >+ public void mouseDown(MouseEvent e) { >+ // time wrap? >+ // check for expiration of doubleClickTime >+ if (e.time <= doubleClickExpirationTime) { >+ control.removeMouseListener(mouseListener); >+ cancelEditing(); >+ handleDoubleClickEvent(); >+ } else if (mouseListener != null) { >+ control.removeMouseListener(mouseListener); >+ } > } > }; >- } >- control.addFocusListener(focusListener); >- mouseListener = new MouseAdapter() { >- public void mouseDown(MouseEvent e) { >- // time wrap? >- // check for expiration of doubleClickTime >- if (e.time <= doubleClickExpirationTime) { >- control.removeMouseListener(mouseListener); >- cancelEditing(); >- handleDoubleClickEvent(); >- } else if (mouseListener != null) { >- control.removeMouseListener(mouseListener); >- } >- } >- }; >- control.addMouseListener(mouseListener); >+ control.addMouseListener(mouseListener); >+ } > } > } > >@@ -305,7 +307,7 @@ > * by delegating to the cell modifier. > */ > private void saveEditorValue(CellEditor cellEditor, Item tableItem) { >- ViewerColumn part = (ViewerColumn)tableItem.getData(ViewerColumn.COLUMN_VIEWER_KEY); >+ ViewerColumn part = viewer.getViewerColumn(columnNumber); > > if( part != null && part.getEditingSupport() != null ) { > part.getEditingSupport().setValue(tableItem.getData(), cellEditor.getValue());
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 154289
:
48157
|
48158
| 48252 |
48253