PageBook on FormDialog [message #1458293] |
Sat, 01 November 2014 07:28 |
|
Hi RAP Team,
We have a little case where we put SWT Text component on PageBook which
reside on a FormDialog. When focus in on the Text and user presses Enter
key a Widget is disposed exception is thrown.
Below is the snippet:
Button button = toolkit.createButton(container, "PageBook Dialog",
SWT.PUSH);
button.setLayoutData(GridDataFactory.swtDefaults().hint(150,
SWT.DEFAULT).create());
button.addSelectionListener
(
new SelectionAdapter()
{
private static final long serialVersionUID = 8745498441542541616L;
@Override
public void widgetSelected(SelectionEvent e)
{
FormDialog dialog = new FormDialog(container.getShell())
{
private static final long serialVersionUID = -8404073274862848632L;
@Override
protected void createFormContent(IManagedForm managedForm)
{ Composite parent = managedForm.getForm().getBody();
parent.setLayout(GridLayoutFactory.fillDefaults().create());
FormToolkit toolkit = managedForm.getToolkit();
Composite composite = toolkit.createComposite(parent);
composite.setLayout(GridLayoutFactory.fillDefaults().create());
composite.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).create());
PageBook pageBook = new PageBook(composite, SWT.NONE);
pageBook.setLayout(GridLayoutFactory.fillDefaults().create());
pageBook.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).create());
toolkit.adapt(pageBook, true, true);
Composite page = toolkit.createComposite(pageBook);
page.setLayout(GridLayoutFactory.fillDefaults().create());
page.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).create());
Text text = toolkit.createText(page, null);
text.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).create());
pageBook.showPage(page);
}
};
dialog.open();
}
}
);
If we remove the PageBook all works fine.
Any help would be greatly appreciated.
Regards,
Setya
|
|
|
Re: PageBook on FormDialog [message #1465205 is a reply to message #1458293] |
Sat, 08 November 2014 06:08 |
|
Hi Team,
Anybody can confirm this problem.
I'm on RAP 1.5 and so far unable to reproduce it on RCP.
Regards,
Setya
On 11/01/2014 02:28 PM, Setya wrote:
> Hi RAP Team,
>
> We have a little case where we put SWT Text component on PageBook which
> reside on a FormDialog. When focus in on the Text and user presses Enter
> key a Widget is disposed exception is thrown.
>
> Below is the snippet:
>
> Button button = toolkit.createButton(container, "PageBook Dialog",
> SWT.PUSH);
>
> button.setLayoutData(GridDataFactory.swtDefaults().hint(150,
> SWT.DEFAULT).create());
>
> button.addSelectionListener
> (
> new SelectionAdapter()
> {
> private static final long serialVersionUID = 8745498441542541616L;
>
> @Override
> public void widgetSelected(SelectionEvent e)
> {
> FormDialog dialog = new FormDialog(container.getShell())
> {
> private static final long serialVersionUID = -8404073274862848632L;
> @Override
> protected void createFormContent(IManagedForm managedForm)
> {
> Composite parent = managedForm.getForm().getBody();
> parent.setLayout(GridLayoutFactory.fillDefaults().create());
>
> FormToolkit toolkit = managedForm.getToolkit();
> Composite composite =
> toolkit.createComposite(parent);
> composite.setLayout(GridLayoutFactory.fillDefaults().create());
> composite.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).create());
>
>
> PageBook pageBook = new PageBook(composite, SWT.NONE);
> pageBook.setLayout(GridLayoutFactory.fillDefaults().create());
> pageBook.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).create());
>
> toolkit.adapt(pageBook, true, true);
> Composite page =
> toolkit.createComposite(pageBook);
> page.setLayout(GridLayoutFactory.fillDefaults().create());
> page.setLayoutData(GridDataFactory.fillDefaults().grab(true,true).create());
>
> Text text =
> toolkit.createText(page, null);
> text.setLayoutData(GridDataFactory.fillDefaults().grab(true,false).create());
>
> pageBook.showPage(page);
> }
> };
>
> dialog.open();
> }
> }
> );
>
> If we remove the PageBook all works fine.
>
> Any help would be greatly appreciated.
>
>
> Regards,
> Setya
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03809 seconds