@Override protected void setResult(List newResult) { List<IType> resultToReturn= new ArrayList<>(); for (int i= 0; i < newResult.size(); i++) { if (newResult.get(i) instanceof TypeNameMatch) { IType type= ((TypeNameMatch) newResult.get(i)).getType(); if (type.exists()) { // items are added to history in the // org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#computeResult() // method resultToReturn.add(type); } else { TypeNameMatch typeInfo= (TypeNameMatch) newResult.get(i); IPackageFragmentRoot root= typeInfo.getPackageFragmentRoot(); String containerName= JavaElementLabels.getElementLabel(root, JavaElementLabels.ROOT_QUALIFIED); String message= Messages.format(JavaUIMessages.FilteredTypesSelectionDialog_dialogMessage, new String[] { TypeNameMatchLabelProvider.getText(typeInfo, TypeNameMatchLabelProvider.SHOW_FULLYQUALIFIED), containerName }); MessageDialog.openError(getShell(), fTitle, message); getSelectionHistory().remove(typeInfo); } } } super.setResult(resultToReturn); }
protected void setResult(List newResult) { List resultToReturn= new ArrayList(); for (int i= 0; i < newResult.size(); i++) { if (newResult.get(i) instanceof TypeNameMatch) { IType type= ((TypeNameMatch) newResult.get(i)).getType(); if (type.exists()) { // items are added to history in the // org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#computeResult() // method resultToReturn.add(type); } else { TypeNameMatch typeInfo= (TypeNameMatch) newResult.get(i); IPackageFragmentRoot root= typeInfo.getPackageFragmentRoot(); String containerName= JavaElementLabels.getElementLabel(root, JavaElementLabels.ROOT_QUALIFIED); String message= Messages.format(JavaUIMessages.FilteredTypesSelectionDialog_dialogMessage, new String[] { typeInfo.getFullyQualifiedName(), containerName }); MessageDialog.openError(getShell(), fTitle, message); getSelectionHistory().remove(typeInfo); } } } super.setResult(resultToReturn); }
@Override protected void setResult(List newResult) { List<IType> resultToReturn= new ArrayList<>(); for (int i= 0; i < newResult.size(); i++) { if (newResult.get(i) instanceof TypeNameMatch) { IType type= ((TypeNameMatch) newResult.get(i)).getType(); if (type.exists()) { // items are added to history in the // org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#computeResult() // method resultToReturn.add(type); } else { TypeNameMatch typeInfo= (TypeNameMatch) newResult.get(i); IPackageFragmentRoot root= typeInfo.getPackageFragmentRoot(); String containerName= JavaElementLabels.getElementLabel(root, JavaElementLabels.ROOT_QUALIFIED); String message= Messages.format(JavaUIMessages.FilteredTypesSelectionDialog_dialogMessage, new String[] { TypeNameMatchLabelProvider.getText(typeInfo, TypeNameMatchLabelProvider.SHOW_FULLYQUALIFIED), containerName }); MessageDialog.openError(getShell(), fTitle, message); getSelectionHistory().remove(typeInfo); } } } super.setResult(resultToReturn); }