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; }
public void createPartControl(Composite parent) { ViewForm topComp = new ViewForm(parent, SWT.NONE); topComp.setLayout(new FillLayout()); createTableViewer(topComp); tv.setContentProvider(new SmsContentProvider()); tv.setLabelProvider(new TableViewerLabelProvider()); ArchiveRecentReadEditorActionGroup actionGroup = new ArchiveRecentReadEditorActionGroup(tv); ToolBar toolBar = new ToolBar(topComp, SWT.FLAT); ToolBarManager toolBarManager = new ToolBarManager(toolBar); actionGroup.fillActionToolBars(toolBarManager); topComp.setContent(tv.getControl()); topComp.setTopLeft(toolBar); actionGroup.fireFirstAction(); }
/** * 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; }