下面列出了org.eclipse.swt.widgets.Layout#org.eclipse.swt.layout.GridData 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
protected Control createContents(Composite parent) {
Composite tparent = new Composite(parent, SWT.NONE);
tparent.setLayout(new GridLayout(1, false));
tparent.setLayoutData(new GridData(GridData.FILL_BOTH));
createGoogleTranslateArea(tparent);
createBingTranslateArea(tparent);
createIgnoreArea(tparent);
createTranslateSettingArea(tparent);
// 设置界面的值
setValues();
// 设置界面状态
setComponentsState();
return parent;
}
private void createCreateCheckboxGroup(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
final GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessVerticalSpace = true;
group.setLayoutData(gridData);
group.setText("CREATE");
final GridLayout layout = new GridLayout();
layout.numColumns = 2;
group.setLayout(layout);
createTablespace = CompositeFactory.createCheckbox(this, group, "label.tablespace", false);
createSequence = CompositeFactory.createCheckbox(this, group, "label.sequence", false);
createTrigger = CompositeFactory.createCheckbox(this, group, "label.trigger", false);
createView = CompositeFactory.createCheckbox(this, group, "label.view", false);
createIndex = CompositeFactory.createCheckbox(this, group, "label.index", false);
createTable = CompositeFactory.createCheckbox(this, group, "label.table", false);
createForeignKey = CompositeFactory.createCheckbox(this, group, "label.foreign.key", false);
createComment = CompositeFactory.createCheckbox(this, group, "label.comment", false);
}
@Test
public void testAll() throws Exception {
shell = new Shell();
shell.open();
shell.setLayout(new GridLayout(1, false));
final Canvas canvas = new Canvas(shell, SWT.None);
canvas.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
text = new Text(shell, SWT.READ_ONLY);
text.setFont(XYGraphMediaFactory.getInstance().getFont("default", 18,
SWT.BOLD));
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
final LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(getTestBench());
shell.setSize(800, 500);
testGetBeanInfo();
testWidget();
}
protected Control createDialogArea( Composite parent )
{
UIUtil.bindHelp( parent, IHelpContextIds.INSERT_EDIT_SORTKEY_DIALOG_ID );
Composite area = (Composite) super.createDialogArea( parent );
Composite contents = new Composite( area, SWT.NONE );
contents.setLayoutData( new GridData( GridData.FILL_BOTH ) );
contents.setLayout( new GridLayout( ) );
this.setTitle( title );
getShell( ).setText( title );
applyDialogFont( contents );
initializeDialogUnits( area );
createInputContents( contents );
Composite space = new Composite( contents, SWT.NONE );
GridData gdata = new GridData( GridData.FILL_HORIZONTAL );
gdata.heightHint = 10;
space.setLayoutData( gdata );
Label lb = new Label( contents, SWT.SEPARATOR | SWT.HORIZONTAL );
lb.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
return area;
}
protected Control createDialogArea( Composite parent )
{
Composite composite = (Composite) super.createDialogArea( parent );
ScrolledComposite sc = new ScrolledComposite( composite, SWT.V_SCROLL );
sc.setAlwaysShowScrollBars( false );
sc.setExpandHorizontal( true );
sc.setLayoutData( new GridData( GridData.FILL_BOTH ) );
Composite content = new Composite( sc, SWT.NONE );
sc.setContent( content );
content.setLayout( new GridLayout( ) );
// sc.setBackground( Display.getCurrent( ).getSystemColor(
// SWT.COLOR_BLACK ) );
// content.setBackground( Display.getCurrent( ).getSystemColor(
// SWT.COLOR_BLUE ) );
// composite.setBackground( Display.getCurrent( ).getSystemColor(
// SWT.COLOR_RED ) );
dialogHelper.setExpressionProvider( expressionProvider );
dialogHelper.createContent( content );
UIUtil.bindHelp( content, isTimePeriod || isEditTimePeriod()? IHelpContextIds.RELATIVE_TIME_PERIOD_DIALOG : IHelpContextIds.DATA_COLUMN_BINDING_DIALOG );
return content;
}
@Override
protected Group createExtraControlsGroup(Composite container) {
Group commandGroup = super.createExtraControlsGroup(container);
Label testnameLabel = new Label(commandGroup, SWT.NONE);
testnameLabel.setText(Messages.CargoTestTab_testName);
testnameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
testnameText = new Text(commandGroup, SWT.BORDER);
testnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
testnameText.addModifyListener(e -> {
setDirty(true);
updateLaunchConfigurationDialog();
});
new Label(commandGroup, SWT.NONE);
new Label(commandGroup, SWT.NONE);
Label testnameExplanation = new Label(commandGroup, SWT.NONE);
testnameExplanation.setText(Messages.CargoTestTab_testNameDescription);
testnameExplanation.setEnabled(false);
testnameExplanation.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
return commandGroup;
}
/**
* Create the composite.
* @param parent
* @param style
*/
public StatusPanel(Composite parent, int style) {
super(parent, style);
GridLayout gridLayout = new GridLayout(4, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 2;
gridLayout.horizontalSpacing = 1;
gridLayout.verticalSpacing = 0;
setLayout(gridLayout);
lblStatus = new Label(this, SWT.NONE);
lblStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
lblStatus.setText("Ok");
CheckForUpdates updateCheck = new CheckForUpdates(this, SWT.NONE);
updateCheck.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, true, 1, 1));
UsedCPUDisplay usedCPU = new UsedCPUDisplay(this, SWT.BORDER);
usedCPU.setToolTipText("CPU usage.");
usedCPU.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true, 1, 1));
UsedMemoryDisplay usedRAM = new UsedMemoryDisplay(this, SWT.BORDER);
usedRAM.setToolTipText("RAM usage.");
usedRAM.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, true, 1, 1));
}
protected Button addCheckBox(Composite parent, String label, Key key, String[] values, int indent) {
ControlData data = new ControlData(key, values);
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = 3;
gd.horizontalIndent = indent;
Button checkBox = new Button(parent, SWT.CHECK);
checkBox.setFont(JFaceResources.getDialogFont());
checkBox.setText(label);
checkBox.setData(data);
checkBox.setLayoutData(gd);
checkBox.addSelectionListener(getSelectionListener());
makeScrollableCompositeAware(checkBox);
String currValue = getValue(key);
checkBox.setSelection(data.getSelection(currValue) == 0);
fCheckBoxes.add(checkBox);
return checkBox;
}
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL));
composite.setFont(parent.getFont());
createToolBar(composite);
createElementViewer(composite);
createButtonsGroup(composite);
createProjectGroup(composite);
createOptionGroup(composite);
restoreWidgetValues();
updatePageCompletion();
setControl(composite);
}
/**
* @param parent
*/
private void createStyleGroup(Composite parent) {
Group other = new Group(parent, SWT.NONE);
other.setText("Style");
other.setLayout(new GridLayout());
other.setLayoutData(new GridData(GridData.FILL_VERTICAL));
borderStyle = new Button(other, SWT.CHECK);
borderStyle.setText("SWT.BORDER");
borderStyle.setSelection(true);
borderStyle.addListener(SWT.Selection, recreateListener);
readOnlyStyle = new Button(other, SWT.CHECK);
readOnlyStyle.setText("SWT.READ_ONLY");
readOnlyStyle.setSelection(true);
readOnlyStyle.addListener(SWT.Selection, recreateListener);
flatStyle = new Button(other, SWT.CHECK);
flatStyle.setText("SWT.FLAT");
flatStyle.addListener(SWT.Selection, recreateListener);
}
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite cmp_container = (Composite) super.createDialogArea(parent);
GridLayout gridLayout = (GridLayout) cmp_container.getLayout();
gridLayout.verticalSpacing = 10;
gridLayout.horizontalSpacing = 10;
Label lbl_specify = new Label(cmp_container, SWT.NONE);
lbl_specify.setText(I18n.ISECALC_Title);
Label lbl_separator = new Label(cmp_container, SWT.SEPARATOR | SWT.HORIZONTAL);
lbl_separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
Combo cmb_scope = new Combo(cmp_container, SWT.READ_ONLY);
this.cmb_scope[0] = cmb_scope;
cmb_scope.setItems(new String[] {I18n.ISECALC_ScopeFile, I18n.ISECALC_ScopeSelection});
cmb_scope.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
cmb_scope.setText(cmb_scope.getItem(is.getScope()));
cmb_scope.select(is.getScope());
cmp_container.pack();
return cmp_container;
}
protected void createInsets( Composite cmpRight, boolean bEnableUI )
{
icInsets = getContext( ).getUIFactory( )
.createChartInsetsComposite( cmpRight,
SWT.NONE,
2,
getSeriesForProcessing( ).getLabel( ).getInsets( ),
getChart( ).getUnits( ),
getContext( ).getUIServiceProvider( ),
getContext( ),
defSeries.getLabel( ).getInsets( ) );
{
GridData gdICInsets = new GridData( GridData.FILL_HORIZONTAL );
gdICInsets.grabExcessVerticalSpace = false;
icInsets.setLayoutData( gdICInsets );
icInsets.setEnabled( bEnableUI );
}
}
@Override
protected Control createDialogArea(Composite parent) {
Composite tparent = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginWidth = 10;
layout.marginTop = 10;
tparent.setLayout(layout);
GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
tparent.setLayoutData(data);
createStatusComp(tparent);
createActiveComp(tparent);
createBarComp(tparent);
return super.createDialogArea(parent);
}
/**
* Builds the buttons
*/
private void buildButtons() {
final Button buttonOK = new Button(shell, SWT.PUSH);
buttonOK.setText(ResourceManager.getLabel(ResourceManager.OK));
final GridData gridDataOk = new GridData(GridData.END, GridData.END, true, false);
gridDataOk.widthHint = 100;
buttonOK.setLayoutData(gridDataOk);
buttonOK.addListener(SWT.Selection, e -> {
returnedValue = true;
shell.dispose();
});
shell.setDefaultButton(buttonOK);
final Button buttonCancel = new Button(shell, SWT.PUSH);
buttonCancel.setText(ResourceManager.getLabel(ResourceManager.CANCEL));
final GridData gridDataCancel = new GridData(GridData.BEGINNING, GridData.END, false, false);
gridDataCancel.widthHint = 100;
buttonCancel.setLayoutData(gridDataCancel);
buttonCancel.addListener(SWT.Selection, e -> {
returnedValue = false;
shell.dispose();
});
}
private SourceViewer createEditor(final Composite parent) {
final SourceViewer viewer = createViewer(parent);
int numberOfLines = viewer.getDocument().getNumberOfLines();
if (numberOfLines < 7) {
numberOfLines = 7;
} else if (numberOfLines > 14) {
numberOfLines = 14;
}
final Control control = viewer.getControl();
final GridData data = new GridData(GridData.FILL_BOTH);
data.widthHint = convertWidthInCharsToPixels(80);
data.heightHint = convertHeightInCharsToPixels(numberOfLines);
control.setLayoutData(data);
return viewer;
}
public NumberDataElementComposite( Composite parent, DataElement data )
{
super( parent,
SWT.BORDER | SWT.SINGLE,
TextEditorComposite.TYPE_NUMBERIC );
GridData gd = new GridData( );
gd.widthHint = 80;
this.setLayoutData( gd );
this.setDefaultValue( "" ); //$NON-NLS-1$
setDataElement( data );
}
@Override
protected Control createDialogArea(Composite parent){
Composite ret = new Composite(parent, SWT.NONE);
ret.setLayout(new GridLayout());
ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
Label lblSelectState = new Label(ret, SWT.NONE);
lblSelectState.setText(Messages.RnDialogs_pleaseNewStateForMulti);
cbStates = new Combo(ret, SWT.READ_ONLY);
cbStates.setItems(RnStatus.getStatusTexts());
cbStates.setVisibleItemCount(RnStatus.getStatusTexts().length);
cbStates.select(rechnungen.get(0).getStatus());
cbStates.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
tableViewer = new TableViewer(ret, SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
GridData gd_Table = new GridData();
gd_Table.grabExcessHorizontalSpace = true;
gd_Table.horizontalSpan = 1;
gd_Table.minimumHeight = 150;
gd_Table.heightHint = 150;
tableViewer.getTable().setLayoutData(gd_Table);
tableViewer.getTable().setHeaderVisible(true);
tableViewer.getTable().setLinesVisible(false);
tableViewer.setContentProvider(new ArrayContentProvider());
TableViewerColumn colRnNumber = new TableViewerColumn(tableViewer, SWT.NONE);
colRnNumber.getColumn().setWidth(200);
colRnNumber.getColumn().setText(Messages.RnDialogs_invoiceNumber);
colRnNumber.setLabelProvider(new ColumnLabelProvider());
tableViewer.setInput(rnNumbers);
return ret;
}
/**
* Creates the text field showing the commit message.
*
* @param parent the parent composite of the text field
* @return the text field
*/
private static Text createCommitMessageText(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
GridDataFactory.fillDefaults().span(2, 1).applyTo(composite);
new Label(composite, SWT.NONE).setText("Commit Message: ");
final Text text = new Text(composite, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
text.setEditable(false);
return text;
}
/**
* Creates a Group widget
* @param parent the parent composite to add this group to
* @param text the text for the heading of the group
* @param columns the number of columns within the group
* @param hspan the horizontal span the group should take up on the parent
* @param fill the style for how this composite should fill into its parent
* @return the new group
*/
public static Group createGroup(Composite parent, String text, int columns, int hspan, int fill) {
Group g = new Group(parent, SWT.NONE);
g.setLayout(new GridLayout(columns, false));
g.setText(text);
g.setFont(parent.getFont());
GridData gd = new GridData(fill);
gd.horizontalSpan = hspan;
g.setLayoutData(gd);
return g;
}
/**
* Sets width and height hint for the button control.
* <b>Note:</b> This is a NOP if the button's layout data is not
* an instance of <code>GridData</code>.
*
* @param the button for which to set the dimension hint
*/
public static void setButtonDimensionHint(Button button) {
Assert.isNotNull(button);
Object gd= button.getLayoutData();
if (gd instanceof GridData) {
((GridData)gd).widthHint= getButtonWidthHint(button);
((GridData)gd).horizontalAlignment = GridData.FILL;
}
}
@Override
protected Control createDialogArea(Composite parent) {
Composite tparent = (Composite) super.createDialogArea(parent);
GridLayoutFactory.swtDefaults().spacing(0, 0).numColumns(1).applyTo(tparent);
GridDataFactory.fillDefaults().hint(750, 500).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tparent);
createMenu();
createToolBar(tparent);
table = new Table(tparent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
Composite cmpStatus = new Composite(tparent, SWT.BORDER);
cmpStatus.setLayout(new GridLayout(2, true));
cmpStatus.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
lblRowCount = new Label(cmpStatus, SWT.None);
lblRowCount.setText(MessageFormat.format(Messages.getString("dialog.CSV2TMXConverterDialog.lblRowCount"), 0));
lblRowCount.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
lblColCount = new Label(cmpStatus, SWT.None);
lblColCount.setText(MessageFormat.format(Messages.getString("dialog.CSV2TMXConverterDialog.lblColCount"), 0));
lblColCount.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
tparent.layout();
getShell().layout();
return tparent;
}
/**
* Create contents of the window.
*/
protected void createContents() {
shell = new Shell(SWT.NO_TRIM | SWT.ON_TOP);
shell.setSize(width, height);
shell.setBackground(display.getSystemColor(SWT.COLOR_DARK_MAGENTA));
shell.setLayoutData(new GridData(GridData.FILL_BOTH));
shell.setLayout(new GridLayout(1, true));
//shell.setText("SWT Application");
picture = new Label(shell,SWT.NULL);
picture.setLayoutData(new GridData(GridData.FILL_BOTH));
setImage();
}
protected Combo createWordCombo(final NormalColumn targetColumn) {
final GridData gridData = new GridData();
gridData.widthHint = 100;
final Combo wordCombo = new Combo(attributeTable, SWT.READ_ONLY);
initializeWordCombo(wordCombo);
wordCombo.setLayoutData(gridData);
setWordValue(wordCombo, targetColumn);
return wordCombo;
}
public void createControl(Composite parent) {
initData(); // 先初始化本页面需要的数据
Composite contents = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
contents.setLayout(layout);
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
contents.setLayoutData(gridData);
createFilesGroup(contents); // 文件列表区域
createPropertiesGroup(contents); // 源文件属性区域组
createConversionOptionsGroup(contents); // 转换选项组
bindValue(); // 数据绑定
try {
loadFiles(); // 加载文件列表
} catch (Exception e) {
e.printStackTrace();
}
filesTable.select(0); // 默认选中第一行数据
filesTable.notifyListeners(SWT.Selection, null);
Dialog.applyDialogFont(parent);
Point defaultMargins = LayoutConstants.getMargins();
GridLayoutFactory.fillDefaults().numColumns(1).margins(defaultMargins.x, defaultMargins.y)
.generateLayout(contents);
setControl(contents);
validate();
}
public void createControl(Composite parent) {
Composite composite= new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout());
composite.setLayoutData(
new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
createOptionsGroup(composite);
restoreWidgetValues();
setControl(composite);
update();
Dialog.applyDialogFont(composite);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.JAROPTIONS_WIZARD_PAGE);
}
/**
* Create "General" tab
*
* @param folder
*/
private void createGeneralTab(TabFolder folder) {
TabItem tab = new TabItem(folder, SWT.NONE);
tab.setText(TMUIMessages.GrammarPreferencePage_tab_general_text);
Composite parent = new Composite(folder, SWT.NONE);
parent.setLayout(new GridLayout());
parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
grammarInfoWidget = new GrammarInfoWidget(parent, SWT.NONE);
grammarInfoWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
tab.setControl(parent);
}
/**
* Create the contents of the dialog.
* @param parent parent component
*/
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridLayout gl = (GridLayout) composite.getLayout();
gl.numColumns = 2;
Label descrLabel = new Label(composite, SWT.LEFT);
descrLabel.setText(TexlipsePlugin.getResourceString("preferenceViewerDescriptionLabel"));
GridData dgd = new GridData(GridData.FILL_HORIZONTAL);
dgd.horizontalSpan = 2;
descrLabel.setLayoutData(dgd);
addConfigNameField(composite);
addFileBrowser(composite);
addArgumentsField(composite);
addDDEGroups(composite);
addFormatChooser(composite);
addInverseChooser(composite);
addForwardChooser(composite);
Group group = new Group(composite, SWT.SHADOW_IN);
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
((GridData)group.getLayoutData()).horizontalSpan = 2;
group.setLayout(new GridLayout());
statusField = new Label(group, SWT.LEFT);
statusField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
statusField.setToolTipText(TexlipsePlugin.getResourceString("preferenceViewerStatusTooltip"));
return composite;
}
@Override
protected StructuredViewer createViewer(Composite parent){
//by default return a checkbox table viewer
Table table = new Table(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 150;
gd.widthHint = 250;
table.setLayoutData(gd);
return new CheckboxTableViewer(table);
}
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(1, false));
Composite composite = new Composite(container, SWT.NONE);
GridLayout gl_composite = new GridLayout(2, false);
gl_composite.marginWidth = 0;
gl_composite.marginHeight = 0;
composite.setLayout(gl_composite);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
Label warningIcon = new Label(composite, SWT.NONE);
warningIcon.setImage(Display.getDefault().getSystemImage(SWT.ICON_WARNING));
Label msgLabel = new Label(composite, SWT.WRAP);
GridData gd_lblNewLabel = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
gd_lblNewLabel.heightHint = 75;
gd_lblNewLabel.widthHint = 460;
msgLabel.setLayoutData(gd_lblNewLabel);
msgLabel.setText(Messages.getString("license.InvalidateDialog.msg1"));
text = new Text(container, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP);
text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
text.setText(getValidateMessage());
return container;
}
/**
* Creates the 2 col composite.
*
* @param parent the parent
* @return the composite
*/
private Composite create2ColComposite(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
GridData data = new GridData();
data.verticalAlignment = GridData.FILL;
data.horizontalAlignment = GridData.FILL;
composite.setLayoutData(data);
return composite;
}