/** * Sets the form text to be managed by this scrolled form text. The * instance must be a direct child of this class. If this method is used, * <code>false</code> must be passed in either of the constructors to * avoid creating form text instance. * * @param formText * the form text instance to use. */ public void setFormText(FormText formText) { this.content = formText; super.setContent(content); content.setMenu(getMenu()); if (text != null) loadText(text); } /**
/** * Sets the form text to be managed by this scrolled form text. The * instance must be a direct child of this class. If this method is used, * <code>false</code> must be passed in either of the constructors to * avoid creating form text instance. * * @param formText * the form text instance to use. */ public void setFormText(FormText formText) { this.content = formText; super.setContent(content); content.setMenu(getMenu()); if (text != null) loadText(text); } /**
/** * Creates the form control as a child of the provided parent. * * @param parent * the parent widget */ public ScrolledForm(Composite parent, int style) { super(parent, style); super.setMenu(parent.getMenu()); content = new Form(this, SWT.NULL); super.setContent(content); content.setMenu(getMenu()); addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { if (!customMenu) setMenu(null); } }); }
/** * Creates the form control as a child of the provided parent. * * @param parent * the parent widget */ public ScrolledForm(Composite parent, int style) { super(parent, style); super.setMenu(parent.getMenu()); content = new Form(this, SWT.NULL); super.setContent(content); content.setMenu(getMenu()); addDisposeListener(e -> { if (!customMenu) setMenu(null); }); }