Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 458142

Summary: [Template] Client crashes if cell position is not specified correctly
Product: [RT] RAP Reporter: Marco Feldmann <riotsportcrew>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.3   
Target Milestone: 3.0 M5   
Hardware: All   
OS: All   
Whiteboard: sr232
Attachments:
Description Flags
client javascript error none

Description Marco Feldmann CLA 2015-01-22 08:52:39 EST
Created attachment 250145 [details]
client javascript error

Row Template crashs with the following code:

             Table tblSach = new org.eclipse.swt.widgets.Table(parent,
                           SWT.FULL_SELECTION | SWT.MULTI);
             tblSach.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
             TableColumn column1 = new TableColumn(tblSach, SWT.NONE);
             column1.setWidth(300);
             TableColumn column2 = new TableColumn(tblSach, SWT.NONE);
             column2.setWidth(100);

             Template template = new Template();
             new TextCell(template).setBindingIndex(0).setFont(
                           new Font(null, new FontData("Arial", 14, SWT.BOLD)));
             new TextCell(template).setBindingIndex(1).setTop(20);

             TableViewer tblViewer = new TableViewer(tblSach);
             tblViewer.getTable().getColumn(0).setWidth(900);
             tblSach.setData(RWT.CUSTOM_ITEM_HEIGHT, new Integer(80));
             tblSach.setData(RWT.ROW_TEMPLATE, template);
             tblSach.pack();

             // Befüellen der Spalten
             TableItem tblItem = new TableItem(tblSach, SWT.NONE);
             tblItem.setText(0, "Text1: " + "value1");
             tblItem.setText(1, "Text2: " + "value2");
             tblItem.setBackground(new Color(null, 190, 190, 190));
Comment 1 Ivan Furnadjiev CLA 2015-01-23 03:20:09 EST
Actually, your first TextCell has no bounds - nothing is defined (top, left, right...). Nevertheless, the client should not crash in such cases.
Comment 2 Ivan Furnadjiev CLA 2015-01-26 08:13:22 EST
Fixed with change https://git.eclipse.org/r/#/c/40344/
Comment 3 Ivan Furnadjiev CLA 2015-01-28 05:21:23 EST
Backported to 2.3-maintenance branch with change https://git.eclipse.org/r/40525