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 79669 Details for
Bug 89610
[KeyBindings] preference page: IllegalArgumentException using KeySequenceText delete
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]
fixes the IAE
patch-89610_V01.txt (text/plain), 3.43 KB, created by
Tim Mok
on 2007-10-03 14:43:32 EDT
(
hide
)
Description:
fixes the IAE
Filename:
MIME Type:
Creator:
Tim Mok
Created:
2007-10-03 14:43:32 EDT
Size:
3.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/bindings/keys/KeySequenceText.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/bindings/keys/KeySequenceText.java,v >retrieving revision 1.14 >diff -u -r1.14 KeySequenceText.java >--- src/org/eclipse/jface/bindings/keys/KeySequenceText.java 1 Jun 2007 16:05:14 -0000 1.14 >+++ src/org/eclipse/jface/bindings/keys/KeySequenceText.java 3 Oct 2007 18:39:48 -0000 >@@ -76,6 +76,8 @@ > * The key strokes from which to delete. This list must not > * be <code>null</code>, and must represent a valid key > * sequence. >+ * @return An array of keystrokes minus the keystrokes that were >+ * deleted. > */ > private final KeyStroke[] deleteKeyStroke(final KeyStroke[] keyStrokes) { > clearInsertionIndex(); >@@ -123,8 +125,13 @@ > keyStrokes = handleKeyUp(event, keyStrokes); > } > >+ > // Update the underlying widget. >- setKeySequence(KeySequence.getInstance(keyStrokes)); >+ if (keyStrokes != null) { >+ setKeySequence(KeySequence.getInstance(keyStrokes)); >+ } else { >+ clear(); >+ } > > // Prevent the event from reaching the widget. > event.doit = false; >@@ -144,7 +151,7 @@ > */ > private KeyStroke[] handleKeyDown(Event event, KeyStroke[] keyStrokes) { > // Is it an unmodified backspace character? >- if ((event.character == SWT.BS) && (event.stateMask == 0)) { >+ if ((event.character == SWT.BS || event.character == SWT.DEL) && (event.stateMask == 0)) { > return deleteKeyStroke(keyStrokes); > } > >@@ -614,6 +621,10 @@ > * @param allowIncomplete > * Whether incomplete strokes should be allowed to exist in the > * list after the deletion. >+ * @param deletedKeyStrokes >+ * The list of keystrokes that were deleted by this operation. >+ * Declared as final since it will hold a reference to the new >+ * keyStroke array that has deleted the selected keystrokes. > * @return The index at which a subsequent insert should occur. This index > * only has meaning to the <code>insertStrokeAt</code> method. > */ >@@ -676,10 +687,15 @@ > * Remove the strokes that are touched by the selection. Keep track of > * the first stroke removed. > */ >- final int newLength = endStrokeIndex - startStrokeIndex + 1; >+ final int newLength = keyStrokesLength >+ - (endStrokeIndex - startStrokeIndex + 1); > deletedKeyStrokes[0] = new KeyStroke[newLength]; > final KeyStroke startStroke = keyStrokes[startStrokeIndex]; >- System.arraycopy(keyStrokes, 0, keyStrokes, 0, newLength); >+ KeyStroke keyStrokeResult[] = new KeyStroke[newLength]; >+ System.arraycopy(keyStrokes, 0, keyStrokeResult, 0, startStrokeIndex); >+ System.arraycopy(keyStrokes, endStrokeIndex + 1, keyStrokeResult, >+ startStrokeIndex, keyStrokesLength - endStrokeIndex - 1); >+ System.arraycopy(keyStrokeResult, 0, deletedKeyStrokes[0], 0, newLength); > > /* > * Allow the first stroke removed to be replaced by an incomplete >@@ -696,7 +712,7 @@ > startStrokeIndex); > added[startStrokeIndex] = incompleteStroke; > System.arraycopy(deletedKeyStrokes[0], startStrokeIndex, added, >- startStrokeIndex + 1, newLength); >+ startStrokeIndex + 1, newLength - startStrokeIndex); > deletedKeyStrokes[0] = added; > } > }
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 89610
:
19349
|
79669
|
80275