Community
Participate
Working Groups
There have been requests in the eclipse.tools newsgroup for the ability to specify a set of tab stops for StyledText editor. Interestingly, the requests are actually from people writing *code* editors that want to support computer languages where the column that text occurs in is significant (as in Fortran, RPG, etc.) NOTES: McQ (10/10/2001 2:17:57 PM) - Currently this is low priority.
Still low priority. Not for R2.0.
bugzilla!
Post 2.0. Re-opening bug reports for review.
Reassigning to SWT Inbox since OTT taking over StyledText.
Are there any plans for anyone to do anything about this bug? The last comment was in 2003. I would really like to see Eclipse be able to have non-uniform tabstops on different lines.
(In reply to comment #5) > Are there any plans for anyone to do anything about this bug? The last comment > was in 2003. > I would really like to see Eclipse be able to have non-uniform tabstops on > different lines. No plans, we are already done for 3.5. Feel free to contribute a fix for 3.6. See TextLayout#setTabs(int[]), StyledText already uses TextLayout.
*** Bug 279356 has been marked as a duplicate of this bug. ***
(In reply to comment #7) > *** Bug 279356 has been marked as a duplicate of this bug. *** Since I'm not the original reporter of this bug, it is not clear to me what "Support for tab stops" means. Firstly, presumably Eclipse/SWT has always had normal fixed tabstops, so it can't mean that. Secondly there's TextLayout#setTabs(int[]) (as you mentioned), which already exists. Thirdly there's what I'm looking for - non-uniform tabstops on different lines. If this third option is what this bug is really about, can we rename this bug to avoid further confusion? Otherwise, could we "un-duplicate" Bug 279356?
(In reply to comment #8) > If this third option is what this bug is really about, can we rename this bug > to avoid further confusion? Otherwise, could we "un-duplicate" Bug 279356? I prefer to keep all the effort in this area in one bug. So I'm changing the title to be more generic.
Unfortunately I lack the skills to contribute code :( However I've followed Nicks "elastic tabstops" efforts ever since and it would really be interesting to see support coming for this in one of the major open source software development tools on this planet ... +1 voted.
This should not be too bad. TextLayout already has support for tab stops. See StyledTextRenderer#getTextLayout where the styledtext sets the tab width in the text layout. Probably all you need to do is to set a array with the tab stops in the text layout (instead of the constant tab width currently used). I'll try to make time to fix for 3.6.
(In reply to comment #11) > This should not be too bad. TextLayout already has support for tab stops. > See StyledTextRenderer#getTextLayout where the styledtext sets the tab width in > the text layout. Probably all you need to do is to set a array with the tab > stops in the text layout (instead of the constant tab width currently used). > > I'll try to make time to fix for 3.6. Do you think it will be possible to define the widths of the tabstops in pixels rather than the number of monospaced characters?
Fixed in HEAD > 20090909 See: StyledText#setTabStops(int[]) StyledText#getTabStops()
I fixed up the testcase I wrote while testing the feature and released it as snippet: http://www.eclipse.org/swt/snippets/index.php#StyledText ◦variable tab stops in StyledText Direct link: http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet325.java (it should be up in a few minutes)
Note: I had to rename StyledText#getTabsStop() to StyledText#getTabStops() as it was spell incorrectly. I'm very sorry for the inconvenience, but unfortunately we only detected it today and the API freeze is tomorrow. This change will in Eclipse 3.6 M6