--- ClassAttrbuteRow.java 2008-01-11 01:08:23.383510657 +0100 +++ ClassAttrbuteRow.java 2008-01-11 01:11:00.531143327 +0100 @@ -86,14 +86,41 @@ } private void doOpenSelectionDialog() { IResource resource = getPluginBase().getModel().getUnderlyingResource(); - String type = PDEJavaHelperUI.selectType( + String type = selectType( resource, IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES, - text.getText()); + text.getText(), + getBaseOnType()); // fetch 'basedOn' attribute (FIXME: how?) if (type != null) text.setText(type); } + /* copied from PDEJavaHelperUI, added param superTypeName */ + public static String selectType(IResource resource, int scope, String filter, String superTypeName) + { + if (resource == null) return null; + IProject project = resource.getProject(); + try { + // [SH] start modification: create new scope (hierarchy): + IJavaProject javaProject= JavaCore.create(project); + IType superType= javaProject.findType(superTypeName); + IJavaSearchScope searchScope= new HierarchyScope(superType, DefaultWorkingCopyOwner.PRIMARY); + // [SH] end modification + SelectionDialog dialog = JavaUI.createTypeDialog( + PDEPlugin.getActiveWorkbenchShell(), + PlatformUI.getWorkbench().getProgressService(), + searchScope, // [SH] this arg modified + scope, + false, filter); //$NON-NLS-1$ + dialog.setTitle(PDEUIMessages.ClassAttributeRow_dialogTitle); + if (dialog.open() == Window.OK) { + IType type = (IType) dialog.getResult()[0]; + return type.getFullyQualifiedName('$'); + } + } catch (JavaModelException e) { + } + return null; + } private IPluginBase getPluginBase() { IBaseModel model = part.getPage().getPDEEditor().getAggregateModel(); return ((IPluginModelBase) model).getPluginBase();