});
Button browse = SWTUtil.createButton(this, Messages.LHttpdRuntimeComposite_Browse);
browse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
DirectoryDialog dialog = new DirectoryDialog(LHttpdRuntimeComposite.this.getShell());
dialog.setMessage(Messages.LHttpdRuntimeComposite_SelectApacheXamppInstallDir);
dialog.setFilterPath(installDir.getText());
String selectedDirectory = dialog.open();
if (selectedDirectory != null)
installDir.setText(selectedDirectory);
}
});
installLabel = new Label(this, SWT.RIGHT);
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalIndent = 10;
installLabel.setLayoutData(data);
install = SWTUtil.createButton(this, Messages.LHttpdRuntimeComposite_Install);
install.setEnabled(false);
install.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
String license = null;
try {
license = ir.getLicense(new NullProgressMonitor());
} catch (CoreException e) {
PEXServerPlugin.logError("Error getting license", e); //$NON-NLS-1$
}
TaskModel taskModel = new TaskModel();
taskModel.putObject(LicenseWizardFragment.LICENSE, license);
TaskWizard wizard2 = new TaskWizard(Messages.LHttpdRuntimeComposite_TitleDownloadAndInstall, new WizardFragment() {
protected void createChildFragments(List<WizardFragment> list) {
list.add(new LicenseWizardFragment());
}
}, taskModel);
WizardDialog dialog2 = new WizardDialog(getShell(), wizard2);
if (dialog2.open() == Window.CANCEL)
return;
DirectoryDialog dialog = new DirectoryDialog(LHttpdRuntimeComposite.this.getShell());
dialog.setMessage(Messages.LHttpdRuntimeComposite_SelectXamppInstallDir);
dialog.setFilterPath(installDir.getText());
String selectedDirectory = dialog.open();
if (selectedDirectory != null) {
final IPath installPath = new Path(selectedDirectory);
installRuntimeJob = new Job(Messages.LHttpdRuntimeComposite_TaskInstallingRuntime) {
public boolean belongsTo(Object family) {
return PEXServerUiPlugin.PLUGIN_ID.equals(family);