Community
Participate
Working Groups
A simple snippet to reproduce the issue: With sample form page provided (code above), with a scrollable table with many rows The first time the editor is opened, a vertical scrollbar appear on the whole editor and the table. The table scroll bar is expected, the editor scrollbar is not and should not be here. Strange thing is if the editor is closed and reopened, then we have only the table scrollbar as expected. The only way to have the issue again is to restart the application. I have this behavior with chrome FF and IE public class EditorPage extends FormPage { public EditorPage(FormEditor editor, String id, String title) { super(editor, id, title); } @Override protected void createFormContent(IManagedForm managedForm) { FormToolkit toolkit = managedForm.getToolkit(); ScrolledForm form = managedForm.getForm(); //body form.setText("My Form Page"); Composite body = form.getBody(); toolkit.decorateFormHeading(form.getForm()); GridLayout globalGridLayout = new GridLayout(); globalGridLayout.numColumns = 1; body.setLayout(globalGridLayout); //a Table viewer TableViewer tableViewer = new TableViewer(toolkit.createTable(body, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER)); tableViewer.getTable().setLayoutData( new GridData(SWT.FILL, SWT.FILL, true, true)); tableViewer.getTable().setLinesVisible(true); tableViewer.getTable().setHeaderVisible(true); tableViewer.setContentProvider(new ArrayContentProvider()); tableViewer.setLabelProvider(new LabelProvider()); //inputs int size=200; List<String> list=new ArrayList<String>(size); for (int i = 0; i < size; i++) { list.add("Data_"+i); } tableViewer.setInput(list); } }
Created attachment 194825 [details] first open, with bad scrollbar behavior
Created attachment 194827 [details] other open, after first, with expected behavior
Created attachment 194828 [details] The full RAP application that can be launched to reproduce the issue - launch snippet.scrolling.launch - on the left view double-click on any node to open the editor - the first time you should see wrong scrollbars - then close the editor and reopen it, you should now see expected scrollbars
I can reproduce it with your snippet and CVS HEAD.
Just inform people facing this issue, as a workaround, setting a width and eight to the GridData solve the issue. for example in my snippet if tableViewer.getTable().setLayoutData( new GridData(SWT.FILL, SWT.FILL, true, true)); must be replaced with GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); layoutData.widthHint = 42; layoutData.heightHint = 42; tableViewer.getTable().setLayoutData(layoutData);
Still valid with RAP 2.3M3. When you open the editor for the first time editor scrollbar is shown, the second time table scrollbar. Probably related to text size determination.