Button button = toolkit.createButton(composite, ClickPlugin.getString("action.browse"), SWT.PUSH);
button.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent evt){
Shell shell = text.getShell();
try {
SelectionDialog dialog = JavaUI.createTypeDialog(
shell,new ProgressMonitorDialog(shell),
SearchEngine.createJavaSearchScope(new IJavaElement[]{project}),
IJavaElementSearchConstants.CONSIDER_CLASSES,false);
if(dialog.open() == SelectionDialog.OK){
Object[] result = dialog.getResult();
String className = ((IType)result[0]).getFullyQualifiedName();
if(ClickUtils.isNotEmpty(packageName) && className.startsWith(packageName)){
className = className.substring(packageName.length() + 1);
}
text.setText(className);