false, false, 1, 1);
gd_btnCommandSourceFile.widthHint = 258;
btnCommandSourceFile.setLayoutData(gd_btnCommandSourceFile);
btnCommandSourceFile.setText("Command Source File");
final CCombo combo = new CCombo(grpSourceFileType, SWT.BORDER);
combo.setItems(new String[] { "Empty Main Function", "Main Function with Parameters", "Simple Web Server" });
combo.select(0);
combo.setEnabled(false);
combo.setEditable(false);
GridData gd_combo = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
gd_combo.widthHint = 231;
combo.setLayoutData(gd_combo);
combo.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) { eval();}
@Override
public void widgetDefaultSelected(SelectionEvent e) { eval();}
public void eval() {
switch (combo.getSelectionIndex()){
case 0:
sourceFileType = SourceFileType.MAIN_DEFAULT;
return;
case 1:
sourceFileType = SourceFileType.MAIN_WITH_PARAMETERS;
return;
case 2:
sourceFileType = SourceFileType.MAIN_WEBSERVER;
return;
}
}
});
btnCommandSourceFile.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
eval();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
eval();
}
public void eval() {
if (btnCommandSourceFile.getSelection()) {
combo.setEnabled(true);
switch (combo.getSelectionIndex()){
case 0:
sourceFileType = SourceFileType.MAIN_DEFAULT;
break;
case 1:
sourceFileType = SourceFileType.MAIN_WITH_PARAMETERS;
break;
case 2:
sourceFileType = SourceFileType.MAIN_WEBSERVER;
break;
}
//Update the filename
sourceFilename.setText(getNewFileName(sourceFilename.getText(), false));
} else {
combo.setEnabled(false);
}
}
});
final Button btnTestSourceFile = new Button(grpSourceFileType, SWT.RADIO);