Java Code Examples for org.eclipse.swt.widgets.Group#getLayoutData()

The following examples show how to use org.eclipse.swt.widgets.Group#getLayoutData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BuilderConfigDialog.java    From texlipse with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: ViewerConfigDialog.java    From texlipse with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: TypeScriptMainPreferencePage.java    From typescript.java with MIT License 5 votes vote down vote up
/**
 * 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;
}