You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Sandro Martini (JIRA)" <ji...@apache.org> on 2009/11/17 11:36:39 UTC

[jira] Created: (PIVOT-343) Handle Control Characters in Input Fields

Handle Control Characters in Input Fields
-----------------------------------------

                 Key: PIVOT-343
                 URL: https://issues.apache.org/jira/browse/PIVOT-343
             Project: Pivot
          Issue Type: Improvement
          Components: wtk
            Reporter: Sandro Martini
            Priority: Minor
             Fix For: 2.0


In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.

This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.

The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).

So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778894#action_12778894 ] 

Greg Brown commented on PIVOT-343:
----------------------------------

You may not need to run your test app in a debugger. Just write an app that contains a single text input, attach a ComponentKeyListener to it, and see what events are fired. You might even be able to use the Component Explorer and save yourself the effort of writing any code at all.


> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sandro Martini closed PIVOT-343.
--------------------------------

    Resolution: Won't Fix

The current behavior is enough (at least in current tests).

> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778887#action_12778887 ] 

Greg Brown commented on PIVOT-343:
----------------------------------

I understand. However, these characters are entered on the keyboard by holding down the Control key while typing the corresponding control character letter key. See the chart on this page:

http://en.wikipedia.org/wiki/ASCII

This means that any application should be able to intercept the keyPressed() event for the ENTER key rather than the keyTyped() event for the "\r" character, for example.

Assuming that the bar code scanner in question correctly emulates the keyboard behavior and fires keyPressed()/keyReleased() in addition to keyTyped(), I don't see a use case for supporting control characters in keyTyped().


> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778892#action_12778892 ] 

Sandro Martini commented on PIVOT-343:
--------------------------------------

Hi Greg,
thanks for the info.

For my use case, I have to try to run a test application with a Debugger, and see what happen (I'll post here results).

Could exist other cases where the right behavior is not respected ... let's see later.


This issue is only a reminder for some tests to do (and to ensure that common cases maybe are already handled right).

Bye,
Sandro


> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778856#action_12778856 ] 

Greg Brown commented on PIVOT-343:
----------------------------------

I don't think we should change the existing behavior. The keyPressed() and keyReleased() events are still fired when the Control key is pressed. It is only keyTyped() that is not fired in this case (which makes sense, because control characters are non-displayable). Any application that needs to respond to control characters can simply handle it in keyPressed() instead of keyTyped().


> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (PIVOT-343) Handle Control Characters in Input Fields

Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778876#action_12778876 ] 

Sandro Martini commented on PIVOT-343:
--------------------------------------

Sorry for the confusion, but here "Control Chars" means any non-printable chars (in ASCII terms), like CR, LF, backspace, Tab, etc, and not only the Control modifier key ... be free to change the title or the text is you find a better description.


> Handle Control Characters in Input Fields
> -----------------------------------------
>
>                 Key: PIVOT-343
>                 URL: https://issues.apache.org/jira/browse/PIVOT-343
>             Project: Pivot
>          Issue Type: Improvement
>          Components: wtk
>            Reporter: Sandro Martini
>            Priority: Minor
>             Fix For: 2.0
>
>
> In TextInput (or at least in TextArea, then possibly in any other component that accept input form the user) could be useful to have a property to set what to do with Control Chars, like in dot Net components.
> This is important for example with some applications reading data from instruments (for example BarCode Scanners), where usually at the end of any code read will be appended a CR LF as a marker, and in this case these chars have to be accepted in the field but not displayed.
> The default behavior should be to filter them out in all components (but not in multi-line components, like TextArea), but if the filtering is disabled (maybe with a dedicated style property) we could use another style property to set the desired formatting (by default nothing, or maybe a given char like space, etc).
> So what do you think on a style like "escapeControlCharacters" to control the display part, with some flag values, like "space", "none" or "null", etc ?
> And another style like "filterControlCharacters" by default true (remove any non printable char, but in a i18n context could not be so simple to know if a char is displayable, right ? or maybe we could have here a regexp but could be too heavy ... ideas ?) and if false it keep all chars as given.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.