java - SWT: height of Group -
i want height of grpmodelproperties lower. should distances of above , bottom of text box in group same?
public void createcontrol(composite parent) { composite composite = new composite(parent, swt.null); composite.setlayout(new filllayout()); group grpmodelproperties = new group(composite, swt.shadow_in); grpmodelproperties.settext("etl transformation model"); grpmodelproperties.setlayout(new gridlayout(2, false)); griddata data = new griddata(griddata.fill_horizontal); text = new text(grpmodelproperties, swt.none); text.setlayoutdata(data); button button = new button(grpmodelproperties, swt.push); button.settext("file system..."); button.addselectionlistener(new selectionadapter() { public void widgetselected(selectionevent e) { filedialog dialog = new filedialog(getshell(), swt.null); string path = dialog.open(); if (path != null) { file file = new file(path); if (file.isfile()) displayfiles(new string[] { file.tostring()}); else displayfiles(file.list()); } }
you have specified filllayout composite containing group group being stretched fill dialog area.
use different layout composite:
composite composite = new composite(parent, swt.null); composite.setlayout(new gridlayout()); group grpmodelproperties = new group(composite, swt.shadow_in); grpmodelproperties.settext("etl transformation model"); grpmodelproperties.setlayout(new gridlayout(2, false)); // layout data group in composite, // fill row, stays @ top of dialog grpmodelproperties.setlayoutdata(new griddata(swt.fill, swt.top, true, false)); here have used gridlayout , set griddata group fill row.

Comments
Post a Comment