Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349809 - User does not notice if text is getting shorted automatically on copy&paste
Summary: User does not notice if text is getting shorted automatically on copy&paste
Status: CLOSED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 396192
  Show dependency tree
 
Reported: 2011-06-20 08:29 EDT by Claudio Guglielmo CLA
Modified: 2015-07-06 08:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Guglielmo CLA 2011-06-20 08:29:23 EDT
Build Identifier: 3.8.0

If MaxLength is set on a string field and a text whose length exceeds that value is pasted from the clipboard the text will automatically be shorted without informing the user.

It would be good to either inform the user with a message box saying the text was shorted or to invalidate the value so that the user can correct it by himself.
In my opinion the invalidation would be better but only if validateOnAnyKey is set to true otherwise the user does not know when the text is short enough. Because of this I would prefer the solution with the message box.

BTW: At the moment a project can achieve this by either overriding execParseValue of a StringField like this:

public String execParseValue(String text) throws ProcessingException {
            if (StringUtility.hasText(text) && text.length() > getMaxLength()) {
              MessageBox.showOkMessage(null, null, "The inserted text is too long for this field and has therefore been truncated."));
            }
            return super.execParseValue(text);
          }

Or (more general) by creating a custom SwtScoutStringField with a ModifyListener.

Reproducible: Always
Comment 1 Beat Schwarzentrub CLA 2011-10-19 10:30:59 EDT
I think this is an SWT-only problem. The Swing variants of the Scout fields already handle this correctly (see org.eclipse.scout.rt.ui.swing.basic.document.BasicDocumentFilter).
Comment 2 Lukas Huser CLA 2011-12-27 15:17:20 EST
[Swing] The implementation of this feature is not complete for Swing either. When pasting to a StringField with keyboard shortcut ctrl-v, the user is informed with a message box. But when using the context menu item "Paste" on a StringField, the content is silently truncated to the maximum field length.
Comment 3 Andreas Hoegger CLA 2015-04-14 09:55:34 EDT
Scout Project clean up.
Bugs matching one of the following criteria will be removed:
- SWT, Swing and HTML(RAP) bugs which are not mandatory for the next release. The future is the new HTML UI.
- Bugs concerning a replaced technology.
- old bugs which got obsolete.
Comment 4 Matthias Zimmermann CLA 2015-07-06 08:24:57 EDT
bugzilla cleanup for bugs in state WONTFIX, INVALID and WORSFORME and no target milestone.

in case the bug should have been closed by mistake, please reopen the bug and let us know why you think that this bug should not have been closed.