Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317585

Summary: Numeric and Decimal-TextRidget don't support shortcuts for cut and paste
Product: [RT] Riena Reporter: Steffen Kriese <steffen.kriese>
Component: UIAssignee: Project Inbox <riena.ui-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: christian.campo, nobody, peter.kullmann
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
This change fix the problem none

Description Steffen Kriese CLA 2010-06-22 10:32:06 EDT
The Numeric and Decimal-TextRidget don't support the shortcuts CTRL-X, CTRL-V and SHIFT-Insert for cutting and pasting text from the clipboard even if it conforms to the format of that specific ridget. This is a different behavior than all other SWT-Controls.
Comment 1 Elias Volanakis CLA 2010-06-24 02:45:04 EDT
True, this is not supported at this time.

I wonder if it would be ok if we support only complete paste / cut (i.e. paste replaces the complete content regardless of selection, cut cuts the complete content). This would be the easiest to implement...
Comment 2 Steffen Kriese CLA 2010-06-24 09:51:47 EDT
Yes, that seems appropriate.
Comment 3 Tobias Schoene CLA 2012-05-11 09:37:12 EDT
Created attachment 215475 [details]
This change fix the problem

I've fixed the problem by changing line 701 from "String newText = null;" to "String newText = e.text;". Please check the fix.  I would be glad if the fix will be integrated in the riena-trunk.

Greetings, 
Tobias
Comment 4 Nobody - feel free to take it CLA 2012-05-14 10:15:11 EDT
@Tobias, the provided fix does not entirely solve the problem. I wrote a snippet [1] to try it out and succeeded to create an invalid value. Here are the steps to reproduce the problem that I got:

1. Start the snippet (after changing NumericTextRidget)
 - the value is "0,00"
2. Enter 123
 - the value is "123,"
3. Ctrl+A to select all text in the text field
4. Ctrl+V, Ctrl+V, Ctrl+V, Ctrl+V ...
 - the value is "123,123,123,123,"

Implementing a 'correct' cut & paste behavior which preserves value validity will require some more investigation so I leave this bug unassigned for now.


Here is the snippet:
[1] http://git.eclipse.org/c/riena/org.eclipse.riena.git/plain/org.eclipse.riena.sample.snippets/src/org/eclipse/riena/sample/snippets/frombugs/NumericTextRidgetBug.java?id=9df6421194d50a6e5a8b95d2f412f3c7aba61358