Pivot
  1. Pivot
  2. PIVOT-696

TextPane support for entering tab characters and tab stops

    Details

    • Type: Wish Wish
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently, if you press Ctrl+Tab in a TextArea, series of space characters entered. (The number of space characters can be specified with tabWidth property.) Text containing tabs can be set by TextArea.setText, but then tab characters are not displayed. It is desirable that TextArea supports tab stops so users can enter and see tab characters.

        Activity

        Taro App created issue -
        Sandro Martini made changes -
        Field Original Value New Value
        Fix Version/s 2.0.1 [ 12315951 ]
        Hide
        Sandro Martini added a comment -

        Verify using a non-proportional font how this is displayed, for example to have a text version of multi-column data inside

        Show
        Sandro Martini added a comment - Verify using a non-proportional font how this is displayed, for example to have a text version of multi-column data inside
        Hide
        Taro App added a comment -

        Even if a non-proportional font (Font.MONOSPACED) is used, the same issue exists.

        Show
        Taro App added a comment - Even if a non-proportional font (Font.MONOSPACED) is used, the same issue exists.
        Hide
        Noel Grandin added a comment -

        I don't think this feature belongs in TextArea.
        TextArea is highly optimised for a very simple use-case.

        TextPane is where all of the fancy features belong.

        As a first step towards this, I have implemented support for CTRL-TAB in TextPane.

        Show
        Noel Grandin added a comment - I don't think this feature belongs in TextArea. TextArea is highly optimised for a very simple use-case. TextPane is where all of the fancy features belong. As a first step towards this, I have implemented support for CTRL-TAB in TextPane.
        Hide
        Chris Bartlett added a comment -

        I'm inclined to agree with Noel and leave it to TextPane. I don't see a tutorial section for TextPane though, so is it ready for use yet?

        Show
        Chris Bartlett added a comment - I'm inclined to agree with Noel and leave it to TextPane. I don't see a tutorial section for TextPane though, so is it ready for use yet?
        Hide
        Noel Grandin added a comment -

        It's fine for light use - see the example code in

        org.apache.pivot.demos.text.TextPaneDemo

        but it depends on what you expect from a rich text editor. There is still lots off functionality that could be added.

        Show
        Noel Grandin added a comment - It's fine for light use - see the example code in org.apache.pivot.demos.text.TextPaneDemo but it depends on what you expect from a rich text editor. There is still lots off functionality that could be added.
        Sandro Martini made changes -
        Comment [ Hi all,
        should I resolve this ticket in 2.0.1 or move to 2.0.2 ?
        ]
        Hide
        Sandro Martini added a comment -

        As suggested, moved to TextPane and 2.0.2, and assigned to Noel, our TextArea expert.

        Show
        Sandro Martini added a comment - As suggested, moved to TextPane and 2.0.2, and assigned to Noel, our TextArea expert.
        Sandro Martini made changes -
        Summary TextArea support for entering tab characters and tab stops TextPane support for entering tab characters and tab stops
        Assignee Noel Grandin [ grandinj ]
        Fix Version/s 2.0.2 [ 12317574 ]
        Fix Version/s 2.0.1 [ 12315951 ]
        Affects Version/s 2.0.1 [ 12315951 ]
        Sandro Martini made changes -
        Fix Version/s 2.1 [ 12314825 ]
        Fix Version/s 2.0.2 [ 12317574 ]
        Affects Version/s 2.0.1 [ 12315951 ]
        Hide
        Roger Whitcomb added a comment -

        I am going to make a small revision to TextArea to at least convert tabs to spaces in "setText" according to the current "tabWidth" style in the skin. This will involve adding "getTabWidth" to the TextArea.Skin interface, and putting a bit of code into "setText" to convert tabs to spaces according to this width.

        I'm doing this from a user request with our application. And since Ctrl-Tab already does the same thing, it only seems reasonable to support this in "setText". Other places could use it also, but this seems the least impact and most useful.

        But, of course, the full functionality could still be done in TextPane at some point.

        Show
        Roger Whitcomb added a comment - I am going to make a small revision to TextArea to at least convert tabs to spaces in "setText" according to the current "tabWidth" style in the skin. This will involve adding "getTabWidth" to the TextArea.Skin interface, and putting a bit of code into "setText" to convert tabs to spaces according to this width. I'm doing this from a user request with our application. And since Ctrl-Tab already does the same thing, it only seems reasonable to support this in "setText". Other places could use it also, but this seems the least impact and most useful. But, of course, the full functionality could still be done in TextPane at some point.
        Hide
        Roger Whitcomb added a comment -

        Committed this small change to TextArea:
        [trunk]:
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextAreaSkin.java
        Transmitting file data ..
        Committed revision 1410536.

        [branches/2.0.x]:
        Sending .
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextAreaSkin.java
        Transmitting file data ..
        Committed revision 1410537.

        Show
        Roger Whitcomb added a comment - Committed this small change to TextArea: [trunk] : Sending wtk\src\org\apache\pivot\wtk\TextArea.java Sending wtk\src\org\apache\pivot\wtk\skin\TextAreaSkin.java Transmitting file data .. Committed revision 1410536. [branches/2.0.x] : Sending . Sending wtk\src\org\apache\pivot\wtk\TextArea.java Sending wtk\src\org\apache\pivot\wtk\skin\TextAreaSkin.java Transmitting file data .. Committed revision 1410537.
        Hide
        Roger Whitcomb added a comment -

        Extended the support of converting tabs to appropriate number of spaces to "insertText" also (which means "paste" also works):
        [trunk]:
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Transmitting file data .
        Committed revision 1410555.

        [branches/2.0.x]:
        Sending .
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Transmitting file data .
        Committed revision 1410556.

        Show
        Roger Whitcomb added a comment - Extended the support of converting tabs to appropriate number of spaces to "insertText" also (which means "paste" also works): [trunk] : Sending wtk\src\org\apache\pivot\wtk\TextArea.java Transmitting file data . Committed revision 1410555. [branches/2.0.x] : Sending . Sending wtk\src\org\apache\pivot\wtk\TextArea.java Transmitting file data . Committed revision 1410556.
        Hide
        Roger Whitcomb added a comment -

        I added a new property to TextArea called "expandTabs" which is set to false by default, and which controls whether this tab expansion happens during "setText" and "insertText". The default behavior (now) will be the same as it was in version 2.0.2, but by setting this property true the new behavior is enabled.

        [trunk]:
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Transmitting file data .
        Committed revision 1417258.

        [branches/2.0.x]:
        Sending .
        Sending wtk\src\org\apache\pivot\wtk\TextArea.java
        Transmitting file data .
        Committed revision 1417259.

        Show
        Roger Whitcomb added a comment - I added a new property to TextArea called "expandTabs" which is set to false by default, and which controls whether this tab expansion happens during "setText" and "insertText". The default behavior (now) will be the same as it was in version 2.0.2, but by setting this property true the new behavior is enabled. [trunk] : Sending wtk\src\org\apache\pivot\wtk\TextArea.java Transmitting file data . Committed revision 1417258. [branches/2.0.x] : Sending . Sending wtk\src\org\apache\pivot\wtk\TextArea.java Transmitting file data . Committed revision 1417259.
        Sandro Martini made changes -
        Fix Version/s 2.0.3 [ 12321246 ]
        Fix Version/s 2.1 [ 12314825 ]
        Hide
        Sandro Martini added a comment -

        Reassigned because Roger is now working on this

        Show
        Sandro Martini added a comment - Reassigned because Roger is now working on this
        Sandro Martini made changes -
        Assignee Noel Grandin [ grandinj ] Roger Whitcomb [ rwhitcomb ]
        Sandro Martini made changes -
        Fix Version/s 2.0.4 [ 12323384 ]
        Fix Version/s 2.0.3 [ 12321246 ]
        Hide
        Roger Whitcomb added a comment -

        Made some progress: ability to expand tabs during paste or from keyboard:
        Sending wtk\src\org\apache\pivot\wtk\TextPane.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkin.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinBlockView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinBulletedListView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinComponentNodeView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinDocumentView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinElementView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinImageNodeView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinListItemView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinListView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinNodeView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinNumberedListView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinParagraphView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinSpanView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinTextNodeView.java
        Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinVerticalElementView.java
        Sending wtk\src\org\apache\pivot\wtk\text\PlainTextSerializer.java
        Transmitting file data .................
        Committed revision 1551679.

        Show
        Roger Whitcomb added a comment - Made some progress: ability to expand tabs during paste or from keyboard: Sending wtk\src\org\apache\pivot\wtk\TextPane.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkin.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinBlockView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinBulletedListView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinComponentNodeView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinDocumentView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinElementView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinImageNodeView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinListItemView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinListView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinNodeView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinNumberedListView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinParagraphView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinSpanView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinTextNodeView.java Sending wtk\src\org\apache\pivot\wtk\skin\TextPaneSkinVerticalElementView.java Sending wtk\src\org\apache\pivot\wtk\text\PlainTextSerializer.java Transmitting file data ................. Committed revision 1551679.
        Sandro Martini made changes -
        Fix Version/s 2.0.5 [ 12326554 ]
        Fix Version/s 2.0.4 [ 12323384 ]
        Sandro Martini made changes -
        Fix Version/s 2.0.5 [ 12326554 ]
        Sandro Martini made changes -
        Issue Type Improvement [ 4 ] Wish [ 5 ]

          People

          • Assignee:
            Roger Whitcomb
            Reporter:
            Taro App
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development