| Summary: | ampersand could only appear in one continuous sequence in tooltips | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | chen zhichao <c.zhichao> | ||||||
| Component: | SWT | Assignee: | Felipe Heidrich <eclipse.felipe> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | eclipse.felipe, Silenio_Quarti, vwine | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
chen zhichao
Created attachment 168927 [details]
TableItem implementation
In this test, we see that tooltips are showing exactly the same text as table cell.
Created attachment 168928 [details]
LabelProvider implementation
LabelProvider Implementation shows confusing tooltips...
The tree item's tooltip is provided by SWT. Assigning to SWT for comments public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
shell.setLayout(new FillLayout());
final Tree tree = new Tree (shell, SWT.FULL_SELECTION | SWT.MULTI);
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
TreeColumn column = new TreeColumn(tree, SWT.LEFT);
column.setText("ampersand");
column.setWidth(50);
for (int i=0; i<4; i++) {
TreeItem iItem = new TreeItem (tree, 0);
iItem.setText ("aa=11&&bb=22&&cc=33");
}
shell.setSize (200, 200);
shell.open ();
while (!shell.isDisposed()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}
It seems we are forgetting to espace the text before setting the tooltip.
In your post, this line: "aa=11&&&&bb=22&&&&cc=33 shows aa=11&&bb=2222cc=33"
didn't you mean to say: "aa=11&&&&bb=22&&&&cc=33 shows aa=11&&bb=22&&cc=33"
?
SSQ, After 3.6 ? Note: the native tree tooltip has the problem. When the custom tooltip is used this problem doesn't happen. For testing, try adding these lines to see if the problem gets fixed:
tree.addListener(SWT.MeasureItem, new Listener() {
public void handleEvent(Event event) {
}
});
Not for 3.6 forget to mention that I'm using 3.5(In reply to comment #7) > Not for 3.6 Yes, this workround works! Thanks a lot!
> Note: the native tree tooltip has the problem. When the custom tooltip is used
> this problem doesn't happen. For testing, try adding these lines to see if the
> problem gets fixed:
> tree.addListener(SWT.MeasureItem, new Listener() {
> public void handleEvent(Event event) {
> }
> });
(In reply to comment #9) > Yes, this workround works! Thanks a lot! Keep in mind the code I suggested enables custom draw for the table. It will cause considerable extra code to run. I'm having the same problem with a Hyperlink control added to a Composite on a Properties Page. I'm doing something like this: String url = "http://mycompany.com/dosomething.jsp?param1=value1¶m2=value2¶m3=value3"; Hyperlink myLink = formToolkit.createHyperlink(myComposite, "MyLink", SWT.NONE); mylink.setToolTipText(url.replace("&", "&&"); The first ampersand appears but not the second. I tried the workaround, but it didn't work. However, perhaps I'm not adding the listener to the right Control. I tried adding the listener to the hyperlink Control, to its parent, and also to the Composite (which is probably the same as its parent), but none of these approached solved the problem. This seems like a bug to me. If there's a workaround, I'd love to know about it! I'm going to have to suppress the showing of this useful tool tip for now until I figure out a way to show it correctly. (In reply to comment #11) > I'm having the same problem with a Hyperlink control added to a Composite on a > Properties Page. I'm doing something like this: > String url = > "http://mycompany.com/dosomething.jsp?param1=value1¶m2=value2¶m3=value3"; > Hyperlink myLink = formToolkit.createHyperlink(myComposite, "MyLink", > SWT.NONE); This is a different bug, the bug here is against the SWT Tree widget. You are having the bug with Hyperlink from Forms. Please, report the bug against user assistance. 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. If the bug is still relevant, please remove the "stalebug" whiteboard tag. |