Button browseDescriptor = new Button(descriptorGroup, SWT.NONE);
browseDescriptor.setText("Browse ...");
browseDescriptor.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
new WorkbenchLabelProvider(), new WorkbenchContentProvider());
dialog.setTitle("Select descriptor");
dialog.setMessage("Select descriptor");
dialog.setInput(getWorkspaceRoot());
dialog.setInitialSelection(getWorkspaceRoot().findMember(descriptorText.getText()));
if (dialog.open() == IDialogConstants.OK_ID) {
IResource resource = (IResource) dialog.getFirstResult();
if (resource != null) {
String fileLoc = resource.getFullPath().toString();
descriptorText.setText(fileLoc);
}
}
}
});
// Input Resource Group
Group inputResourceGroup = new Group(projectComposite, SWT.None);
inputResourceGroup.setText("Input Resource:");
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).
grab(true, false).applyTo(inputResourceGroup);
GridLayout inputResourceGroupLayout = new GridLayout(2, false);
inputResourceGroup.setLayout(inputResourceGroupLayout);
inputText = new Text(inputResourceGroup, SWT.BORDER);
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).
grab(true, false).applyTo(inputText);
inputText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
updateLaunchConfigurationDialog();
}
});
Button browseInputResource = new Button(inputResourceGroup, SWT.NONE);
browseInputResource.setText("Browse ...");
browseInputResource.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
new WorkbenchLabelProvider(), new WorkbenchContentProvider());
dialog.setTitle("Select input folder or file");
dialog.setMessage("Select input folder or file");
dialog.setInput(getSelectedProject());
dialog.setInitialSelection(getWorkspaceRoot().findMember(inputText.getText()));
if (dialog.open() == IDialogConstants.OK_ID) {