protected void addInstallDirSection(Composite composite) {
Label label = new Label(composite, SWT.NONE);
label.setText(Messages.sourceZipFile);
GridData data = new GridData();
data.horizontalSpan = 3;
label.setLayoutData(data);
String tooltipLoc = Messages.bind(Messages.tooltipLoc, getRuntimeName());
label.setToolTipText(tooltipLoc);
srcLoc = new Text(composite, SWT.BORDER);
IPath currentLocation = getRuntimeDelegate().getRuntimeSourceLocation();
if (currentLocation != null) {
srcLoc.setText(currentLocation.toOSString());
}
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
srcLoc.setLayoutData(data);
srcLoc.setToolTipText(tooltipLoc);
srcLoc.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
getRuntimeDelegate().setRuntimeSourceLocation(srcLoc.getText());
}
});
final Composite browseComp = composite;
Button browse = SWTUtil.createButton(composite, Messages.browse);
browse.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
FileDialog dialog = new FileDialog(browseComp.getShell());
dialog.setText(Messages.browseSrcDialog);
dialog.setFilterPath(srcLoc.getText());
String selected = dialog.open();
if (selected != null)
srcLoc.setText(selected);
}
});
}
|