GridData gridData;
GridLayout layout;
Composite cSection = new Composite(parent, SWT.NULL);
gridData = new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL);
cSection.setLayoutData(gridData);
layout = new GridLayout();
layout.numColumns = 2;
cSection.setLayout(layout);
int userMode = COConfigurationManager.getIntParameter("User Mode");
if (userMode < REQUIRED_MODE) {
Label label = new Label(cSection, SWT.WRAP);
gridData = new GridData();
label.setLayoutData(gridData);
final String[] modeKeys = {
"ConfigView.section.mode.beginner",
"ConfigView.section.mode.intermediate",
"ConfigView.section.mode.advanced" };
String param1, param2;
if (REQUIRED_MODE < modeKeys.length)
param1 = MessageText.getString(modeKeys[REQUIRED_MODE]);
else
param1 = String.valueOf(REQUIRED_MODE);
if (userMode < modeKeys.length)
param2 = MessageText.getString(modeKeys[userMode]);
else
param2 = String.valueOf(userMode);
label.setText(MessageText.getString("ConfigView.notAvailableForMode",
new String[] { param1, param2 }));
return cSection;
}
// Place SWT config items here
return cSection;