Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Scroll Bar in JFace Dialog(Need to place controls in Dialog which should render Scroll Bar)
Scroll Bar in JFace Dialog [message #888565] Mon, 18 June 2012 05:46 Go to next message
Aravindhan Annamalai is currently offline Aravindhan Annamalai
Messages: 88
Registered: July 2009
Location: Chennai
Member
Hi,

I have a JFace dialog, where the user can add n number of rows having controls using the "Add" button (Find the image file attached)

I need the Dialog, to render scroll bar if the rows exceed the size of the dialog.

The dialog uses scrolled form for rendering the controls.
@Override
protected Control createDialogArea(Composite parent) {
ScrolledForm form = m_toolkit.createScrolledForm(parent);
form.setBackground(parent.getBackground());
form.setLayoutData(new GridData(GridData.FILL_BOTH));
form.setExpandVertical(true);
form.setExpandHorizontal(true);

// Build the form body
Composite formBody = form.getBody();
TableWrapLayout tableWrapLayout = new TableWrapLayout();
tableWrapLayout.numColumns = 3;
tableWrapLayout.verticalSpacing = 1;
tableWrapLayout.horizontalSpacing = 1;
TableWrapData twd = new TableWrapData(TableWrapData.FILL_GRAB);
formBody.setLayout(tableWrapLayout);
formBody.setLayoutData(twd);

List<TestInfo> testInfos = getTestInfos();
TestPropertyRow = new TestPropertyRow(formBody, testInfos);
return parent;
}

Regards,
Aravind
  • Attachment: Criteria.PNG
    (Size: 4.26KB, Downloaded 71 times)
Re: Scroll Bar in JFace Dialog [message #888697 is a reply to message #888565] Mon, 18 June 2012 10:02 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 402
Registered: December 2009
Location: Prague
Senior Member
And where is the problem?
Re: Scroll Bar in JFace Dialog [message #889225 is a reply to message #888697] Mon, 18 June 2012 23:34 Go to previous messageGo to next message
Aravindhan Annamalai is currently offline Aravindhan Annamalai
Messages: 88
Registered: July 2009
Location: Chennai
Member
The Scroll Bar doesn't appear on the Dialog
Re: Scroll Bar in JFace Dialog [message #889363 is a reply to message #889225] Tue, 19 June 2012 02:57 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 402
Registered: December 2009
Location: Prague
Senior Member
Try to call form.reflow(true) whenever you add a new row.
Re: Scroll Bar in JFace Dialog [message #892348 is a reply to message #889363] Wed, 27 June 2012 16:31 Go to previous messageGo to next message
Timur Achmetow is currently offline Timur Achmetow
Messages: 36
Registered: April 2012
Member
Or add manually a ScrolledComposite.
Re: Scroll Bar in JFace Dialog [message #892943 is a reply to message #888565] Mon, 02 July 2012 01:44 Go to previous message
Aravindhan Annamalai is currently offline Aravindhan Annamalai
Messages: 88
Registered: July 2009
Location: Chennai
Member
Thanks Jan. form.reflow(true) worked for me.
Previous Topic:How to stop cell editing in ColumnViewer?
Next Topic:Multivalidator fires validate method twice
Goto Forum:
  


Current Time: Wed May 22 03:42:45 EDT 2013

Powered by FUDForum. Page generated in 0.01570 seconds