Community
Participate
Working Groups
I'd like to introduce a custom behaviour (in fact a custom tooltip) in cases when there's not enough space to display the whole text of a CLabel. To achieve that, I'd like to propose the following enhancements in CLabel class: 1. Ability to turn off default behaviour (system tooltip) by means of either a style flag or a setter. 2. Notification mechanism to notify clients that the CLabel's text has been shortened. This should probably be an additional Listener class. Please, let me know if these enhancements are acceptable. If they're, I'll implement a patch for the CLabel class.
Created attachment 21956 [details] Patch proposal In fact much simpler solution would probably be to extract some of the code into a protected method that could then be overriden. Here is a patch proposal. It defines a new method internalSetToolTipText() that gets two parameters: label's text if it's not completely visible (null otherwise) and tooltip text set by the application. This method is then called instead of super.setTooltipText(). My implementation would then look like this: class MyCLabel extends CLabel { protected void internalSetToolTipText(String text, String appToolTipText) { String string = appToolTipText != null ? appToolTipText; // display string using custom tooltip } } This is how this method is implemented in CLabel, the only difference is that it uses system tooltip.
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.