Community
Participate
Working Groups
I wish for a setting in which i can choose how the filenames are cut off in the tabs. For example now they are cut off as follows: a-very-long-f... (for a file named "a-very-long-filename.txt") A simple feature would be to be able to choose between: wrap (end) example : a-very-long-... wrap (center) example : a-ve...name.txt wrap (beginning) example : ...ng-filename.txt and additionally provide for a maximum length to accept, plus the ability to check off the extension of a filename, to provide more room for the rest of the filename A more flexible one is to create regular expression replacement rules for filenames. For example, my PHP class names start with a prefix "class." I would like to show "RegisterFormHandler" for a file named "class.RegisterFormHandler.php". The regex replacement rule would be: regex: /^class\.(.*)\.php$/ replacement: $1 Or, for implementing my own wrapping: regex: /^({5,}).+({5,})$/ replacement: $1...$2 Another
(text seems cut off at end)
The "Another" comment at the end should be disregarded, it is a typo.
*** Bug 196363 has been marked as a duplicate of this bug. ***
This version of the request is much broader and more IDE-specific than the one just marked as a dup. I also doubt that this could be implemented as requested, since SWT is specified to run under OSGi Minimum Execution Environment 1.0, which does not include regular expressions support. In any case, that bug contains a useful code snippet, so whoever implements this should take a look. In the meantime, an updated target version would be nice, so this doesn't get lost.
FYI, CLabel implements a variant of this idea that shortens the text in the middle, instead of the side. That version does not support the ellipses parameter but is very similar otherwise. I recommend creating an API for this with two new properties (with both getters and setters): /** * Sets the portion of the text contents of this item that will be clipped * when the width of the text is too large for the available space. * * @param clipStyle one of SWT.LEAD, SWT.TRAIL, or SWT.CENTER */ public void setClipStyle(int clipStyle); /** * Sets the String that will be used to replace clipped text in this widget. * * @param ellipses the new replacement string for clipped text, or null to * use the default value */ public void setEllipses(String ellipses); The method shortenText(GC, String text, String ellipses, int width, int clipStyle) could be provided as a static helper somewhere within the swt.custom package or as an instance method on Widget. I'm still not clear whether it makes sense to put this only on CTabItem or also on CTabFolder. I'm leaning towards the former.
> I'm still not clear whether it makes sense to put this only on CTabItem or also > on CTabFolder. I'm leaning towards the former. I'd say the CTabFolder should have a policy (either pluggable or preset list via a style bit/int) which the CTabItems consult, with the notion being that all tabs within a folder follow the same truncation rule.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
*** Bug 576455 has been marked as a duplicate of this bug. ***