use of org.bndtools.api.ProjectLayout in project bndtools by bndtools.
the class ProjectLayoutGroup method createControl.
public Control createControl(Composite parent) {
Group group = new Group(parent, SWT.NONE);
group.setText(groupTitle);
group.setLayout(new GridLayout(Math.max(4, ProjectLayout.values().length), true));
SelectionListener radioListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Button button : layoutChoices) {
if (button.getSelection()) {
assert (button.getData() instanceof ProjectLayout);
chosenProjectLayout = (ProjectLayout) button.getData();
return;
}
}
}
};
for (ProjectLayout projectLayout : ProjectLayout.values()) {
ProjectPaths projectPaths = ProjectPaths.DEFAULT;
final Button radioButton = new Button(group, SWT.RADIO);
radioButton.setText(projectPaths.getTitle());
radioButton.setData(projectLayout);
radioButton.setSelection(this.chosenProjectLayout == projectLayout);
radioButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
radioButton.setToolTipText(projectPaths.getToolTip());
radioButton.addSelectionListener(radioListener);
layoutChoices.add(radioButton);
}
return group;
}
Aggregations