下面列出了org.eclipse.swt.widgets.Group#getLayoutData ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Create the contents of the dialog.
*/
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("preferenceBuilderDialogDescriptionLabel").replaceAll("%s", builder.getDescription()));
GridData dgd = new GridData(GridData.FILL_HORIZONTAL);
dgd.horizontalSpan = 2;
descrLabel.setLayoutData(dgd);
addFileBrowser(composite);
addArgumentsField(composite);
if (builder.getInputFormat() != null && builder.getInputFormat().length() > 0
&& builder.getOutputFormat() != null && builder.getOutputFormat().length() > 0) {
addFormatsField(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.setText(resolveStatus());
statusField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
statusField.setToolTipText(TexlipsePlugin.getResourceString("preferenceBuilderDialogStatusTooltip"));
return composite;
}
/**
* 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;
}
/**
* Refreshes the specified group to re-set the default spacings that have
* been trashed by the field editors
*
* @param group
*/
void initGroup(Group group) {
GridData gd = (GridData) group.getLayoutData();
gd.grabExcessHorizontalSpace = true;
GridLayout lo = (GridLayout) group.getLayout();
lo.marginWidth = 5;
lo.marginHeight = 5;
}