private void createConfigDesc(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.VERTICAL); separator.setLayoutData(new GridData(GridData.FILL_VERTICAL)); Composite descComposite = new Composite(parent, SWT.NONE); descComposite.setLayout(new FillLayout()); descComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); descComposite.setBackground(parent.getBackground()); final FormToolkit toolkit = new FormToolkit(parent.getDisplay()); parent.addDisposeListener(e -> toolkit.dispose()); form = toolkit.createScrolledForm(descComposite); form.setBackground(parent.getBackground()); form.getBody().setLayout(new GridLayout()); configAreas = generator.createFilterConfigurationFields(); createFieldArea(toolkit, form, scopeArea, true); Iterator<FilterConfigurationArea> areas = configAreas.iterator(); while (areas.hasNext()) { createFieldArea(toolkit, form, areas.next(), true); } }
workArea.addDisposeListener(e -> toolkit.dispose()); final ScrolledForm form = toolkit.createScrolledForm(workArea); form.setBackground(workArea.getBackground()); form.getBody().setLayout(new GridLayout());
/** * Creates a scrolled form widget in the provided parent. If you do not * require scrolling because there is already a scrolled composite up the * parent chain, use 'createForm' instead. * * @param parent * the scrolled form parent * @return the form that can scroll itself * @see #createForm */ public ScrolledForm createScrolledForm(Composite parent) { ScrolledForm form = new ScrolledForm(parent, SWT.V_SCROLL | SWT.H_SCROLL | orientation); form.setExpandHorizontal(true); form.setExpandVertical(true); form.setBackground(colors.getBackground()); form.setForeground(colors.getColor(IFormColors.TITLE)); form.setFont(JFaceResources.getHeaderFont()); return form; }
/** * Creates a scrolled form widget in the provided parent. If you do not * require scrolling because there is already a scrolled composite up the * parent chain, use 'createForm' instead. * * @param parent * the scrolled form parent * @return the form that can scroll itself * @see #createForm */ public ScrolledForm createScrolledForm(Composite parent) { checkDisposed(); ScrolledForm form = new ScrolledForm(parent, SWT.V_SCROLL | SWT.H_SCROLL | orientation); form.setExpandHorizontal(true); form.setExpandVertical(true); form.setBackground(colors.getBackground()); form.setForeground(colors.getColor(IFormColors.TITLE)); form.setFont(JFaceResources.getHeaderFont()); return form; }