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

Bug 471795

Summary: Tab Sequencing ignored since RAP 3.0
Product: [RT] RAP Reporter: John Gymer <jgymer>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: rsternberg
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard: sr301

Description John Gymer CLA 2015-07-03 08:02:40 EDT
Since RAP 3.0, Tab Sequencing around controls does not work.
Snippet below has simple shell with 4 Text controls. The 3rd and 4th control are read-only and NOT included in the tab sequence, but all fields can be tabbed to, including the read-only ones. The same snippet works correctly in RAP 2.3:

/* DEMONSTRATES ISSUE WITH TAB SEQUENCES AND READ-ONLY FIELDS */
package bug.snippet;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class Bugsy {
	private Display display;
	private Shell shell;
	private Text txt1;
	private Text txt2;
	private Text txt3;
	private Text txt4;
	
	public void begin() {
		System.out.println("BugSnippy Starting...");
		
		// create Shell
		display = new Display();
		shell = new Shell(display, SWT.TITLE|SWT.BORDER|SWT.CLOSE);
		shell.setFullScreen(true);
		//shell.setBounds(10, 10, 800, 400);
		shell.setText("Bug Snippet");
		shell.setBackground(new Color(null, new RGB(192,255,192)));
		FormLayout layout = new FormLayout();
		layout.marginWidth = 0;
		layout.marginHeight = 0;
		layout.marginLeft = 10;
		layout.marginTop = 10;
		layout.marginRight = 10;
		layout.marginBottom = 10;
		layout.spacing = 0;
		shell.setLayout(layout);

		txt1 = new Text(shell, SWT.BORDER|SWT.SINGLE);
		txt2 = new Text(shell, SWT.BORDER|SWT.SINGLE);
		txt3 = new Text(shell, SWT.BORDER|SWT.SINGLE|SWT.READ_ONLY);
		txt4 = new Text(shell, SWT.BORDER|SWT.SINGLE|SWT.READ_ONLY);
		FormData fd = new FormData();
		fd.left = new FormAttachment(0, 10); fd.top = new FormAttachment(0, 50);
		fd.right = new FormAttachment(0, 100); fd.bottom = new FormAttachment(0, 70);
		txt1.setLayoutData(fd);
		fd = new FormData();
		fd.left = new FormAttachment(0, 10); fd.top = new FormAttachment(0, 80);
		fd.right = new FormAttachment(0, 100); fd.bottom = new FormAttachment(0, 100);
		txt2.setLayoutData(fd);
		fd = new FormData();
		fd.left = new FormAttachment(0, 10); fd.top = new FormAttachment(0, 110);
		fd.right = new FormAttachment(0, 100); fd.bottom = new FormAttachment(0, 130);
		txt3.setLayoutData(fd);
		fd = new FormData();
		fd.left = new FormAttachment(0, 10); fd.top = new FormAttachment(0, 140);
		fd.right = new FormAttachment(0, 100); fd.bottom = new FormAttachment(0, 160);
		txt4.setLayoutData(fd);
		
		Control[] tabList = new Control[2];
		tabList[0] = txt1;
		tabList[1] = txt2;
		shell.setTabList(tabList);
		shell.layout();

		shell.open();

		System.out.println("BugSnippy Done!");
	}
}
Comment 1 Ivan Furnadjiev CLA 2015-07-09 06:25:48 EDT
The problem is that the -1 tabIndex is not rendered to the client as it is consider as default value (ControlLCAUtil.renderTabIndex). This regression has been introduced recentry with commit 3e61ce166ad8b911282426ab94f17778339f32e1. We *must* render tabIndex for all controls even it is -1 (disabled tabbibg) as client has no reasonable default value (it's null).
Comment 2 Ivan Furnadjiev CLA 2015-07-10 05:14:41 EDT
Fixed with change https://git.eclipse.org/r/#/c/51644/. We agree that it's safe to be backported to 3.0_maintanance branch.
Comment 3 Ralf Sternberg CLA 2015-07-14 04:48:53 EDT
Backported to 3.0.1 with commit 2ae7227.