protected ViewForm createViewForm() { ViewForm viewForm = new ViewForm(container, SWT.NONE); GridData gd = new GridData(GridData.FILL_BOTH); viewForm.setLayoutData(gd); viewForm.setLayout(new FillLayout()); return viewForm; }
/** * Creates a {@link ViewForm} * * @param parent * @param style * @param cols * @param span * @param fill * @param marginwidth * @param marginheight * @return a new {@link ViewForm} * @since 3.6 */ public static ViewForm createViewform( Composite parent, int style, int cols, int span, int fill, int marginwidth, int marginheight) { ViewForm form = new ViewForm(parent, style); form.setFont(parent.getFont()); GridLayout layout = new GridLayout(cols, false); layout.marginWidth = marginwidth; layout.marginHeight = marginheight; form.setLayout(layout); GridData gd = new GridData(fill); gd.horizontalSpan = span; form.setLayoutData(gd); return form; }