browse.setText(browseButtonLabel);
GridData data3 = new GridData(GridData.FILL_HORIZONTAL);
browse.setLayoutData(data3);
browse.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
IType baseType;
try {
baseType = getPackageFragmentRoot().getJavaProject().findType(
baseClassName);
// edit this to limit the scope
SelectionDialog dialog = JavaUI.createTypeDialog(
composite.getShell(), new ProgressMonitorDialog(composite
.getShell()), SearchEngine.createHierarchyScope(baseType),
IJavaElementSearchConstants.CONSIDER_CLASSES, false);
dialog.setMessage("&Choose a type:");
dialog.setBlockOnOpen(true);
dialog.setTitle(dialogTitle);
dialog.open();
if ((dialog.getReturnCode() == Window.OK)
&& (dialog.getResult().length > 0)) {
IType type = (IType) dialog.getResult()[0];
text.setText(type.getFullyQualifiedName());
}
} catch (JavaModelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}