List of usage examples for org.eclipse.swt.widgets Composite getLayout
public Layout getLayout()
From source file:ShowPrefs.java
/** * Add buttons/*from w w w. ja va 2s. c o m*/ * * @param parent the parent composite */ protected void contributeButtons(Composite parent) { // Add a select all button Button selectAll = new Button(parent, SWT.PUSH); selectAll.setText("Select All"); selectAll.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { checkOne.setSelection(true); checkTwo.setSelection(true); checkThree.setSelection(true); } }); // Add a select all button Button clearAll = new Button(parent, SWT.PUSH); clearAll.setText("Clear All"); clearAll.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { checkOne.setSelection(false); checkTwo.setSelection(false); checkThree.setSelection(false); } }); // Add two columns to the parent's layout ((GridLayout) parent.getLayout()).numColumns += 2; }