/** * Creates a scrolled composite * * @param parent the parent to add to * @param columns the number of columns for the composite * @param hspan the horizontal span to take up in the parent * @param marginwidth the width of the margins * @param marginheight the height of the margins * @return a new scrolled composite */ public static SharedScrolledComposite createScrolledComposite(Composite parent, int columns, int hspan, int marginwidth, int marginheight) { SharedScrolledComposite comp = new SharedScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL) {}; GridLayout layout = new GridLayout(columns, false); layout.marginHeight = marginheight; layout.marginWidth = marginwidth; comp.setLayout(layout); GridData gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = hspan; comp.setLayoutData(gd); comp.setExpandHorizontal(true); comp.setExpandVertical(true); return comp; }
/** * Creates a scrolled composite * * @param parent the parent to add to * @param columns the number of columns for the composite * @param hspan the horizontal span to take up in the parent * @param marginwidth the width of the margins * @param marginheight the height of the margins * @return a new scrolled composite */ public static SharedScrolledComposite createScrolledComposite(Composite parent, int columns, int hspan, int marginwidth, int marginheight) { SharedScrolledComposite comp = new SharedScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL) {}; GridLayout layout = new GridLayout(columns, false); layout.marginHeight = marginheight; layout.marginWidth = marginwidth; comp.setLayout(layout); GridData gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = hspan; comp.setLayoutData(gd); comp.setExpandHorizontal(true); comp.setExpandVertical(true); return comp; }
/** * Creates a scrolled composite * * @param parent the parent to add to * @param style the style bits for the composite * @param columns the number of columns for the composite * @param hspan the horizontal span to take up in the parent * @param marginwidth the width of the margins * @param marginheight the height of the margins * @return a new scrolled composite */ public static SharedScrolledComposite createScrolledComposite(Composite parent, int style, int columns, int hspan, int marginwidth, int marginheight) { SharedScrolledComposite comp = new SharedScrolledComposite(parent, style) {}; GridLayout layout = new GridLayout(columns, false); layout.marginHeight = marginheight; layout.marginWidth = marginwidth; comp.setLayout(layout); GridData gd = new GridData(GridData.FILL_BOTH); gd.horizontalSpan = hspan; comp.setLayoutData(gd); comp.setExpandHorizontal(true); comp.setExpandVertical(true); return comp; }