/[Apache-SVN]
ViewVC logotype

Revision 1410536


Jump to revision: Previous Next
Author: rwhitcomb
Date: Fri Nov 16 18:52:25 2012 UTC (11 years, 5 months ago)
Changed paths: 2
Log Message:
Part of PIVOT-696: Add support for viewing tab characters in TextArea.

Already the TerraTextAreaSkin has a "tabWidth" style, and supports
Ctrl-Tab entering a "tab" which is a number of spaces up to the tab
width.

This change extends that to the "setText" method.  The TextArea.Skin
interface adds a "getTabWidth" method so the component can know what
the current setting is.  Then in "setText", keep track of the current
position in the line (since the last \n) and when a \t is encountered
in the stream, convert it to a number of spaces according to the
position and the tabWidth setting.

The combined effect is that files with tab characters will look the
same as with editors that really support tabs (albeit with the tabs
replaced by the appropriate number of spaces).


Changed paths

Path Details
Directorypivot/trunk/wtk/src/org/apache/pivot/wtk/TextArea.java modified , text changed
Directorypivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26