private void browseForBuilderClass() { try { IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { getType().getJavaProject() }); SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, "*ToString", fExtension); //$NON-NLS-1$ dialog.setTitle(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_windowTitle); dialog.setMessage(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_message); dialog.open(); if (dialog.getReturnCode() == OK) { IType type= (IType)dialog.getResult()[0]; fBuilderClassName.setText(type.getFullyQualifiedParameterizedName()); List<String> suggestions= fValidator.getAppendMethodSuggestions(type); if (!suggestions.contains(fAppendMethodName.getText())) fAppendMethodName.setText(suggestions.get(0)); suggestions= fValidator.getResultMethodSuggestions(type); if (!suggestions.contains(fResultMethodName.getText())) fResultMethodName.setText(suggestions.get(0)); } } catch (JavaModelException e) { JavaPlugin.log(e); } } }
private void browseForBuilderClass() { try { IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[] { getType().getJavaProject() }); SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), PlatformUI.getWorkbench().getProgressService(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, "*ToString", fExtension); //$NON-NLS-1$ dialog.setTitle(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_windowTitle); dialog.setMessage(JavaUIMessages.GenerateToStringDialog_customBuilderConfig_classSelection_message); dialog.open(); if (dialog.getReturnCode() == OK) { IType type= (IType)dialog.getResult()[0]; fBuilderClassName.setText(type.getFullyQualifiedParameterizedName()); List<String> suggestions= fValidator.getAppendMethodSuggestions(type); if (!suggestions.contains(fAppendMethodName.getText())) fAppendMethodName.setText(suggestions.get(0)); suggestions= fValidator.getResultMethodSuggestions(type); if (!suggestions.contains(fResultMethodName.getText())) fResultMethodName.setText(suggestions.get(0)); } } catch (JavaModelException e) { JavaPlugin.log(e); } } }