IOpenable typeContainer = _componentType.getOpenable(); if (typeContainer instanceof IClassFile) { IClassFile classFile = (IClassFile) typeContainer; IJavaElement parent = classFile.getParent(); if (parent instanceof IPackageFragment) { IPackageFragment parentPackage = (IPackageFragment) parent; IPath packagePath = parentPackage.getPath(); IPath apiPath = packagePath.removeLastSegments(2).append(_componentType.getElementName()).addFileExtension("api"); File apiFile = apiPath.toFile(); System.out.println("WODCompletionProcessor.fillInAssociationNameCompletionProposals: " + apiPath); if (apiFile.exists()) { System.out.println("WODCompletionProcessor.fillInAssociationNameCompletionProposals: exists"); } } } else if (typeContainer instanceof ICompilationUnit) { ICompilationUnit cu = (ICompilationUnit) typeContainer; } */
try { IOpenable typeContainer = _elementType.getOpenable(); if (typeContainer instanceof IClassFile) { IClassFile classFile = (IClassFile) typeContainer; IJavaElement parent = classFile.getParent(); if (parent instanceof IPackageFragment) { IPackageFragment parentPackage = (IPackageFragment) parent; IPath packagePath = parentPackage.getPath(); IPath apiPath = packagePath.removeLastSegments(2).append(_elementType.getElementName()).addFileExtension("api"); File apiFile = apiPath.toFile(); boolean fileExists = apiFile.exists(); if (!fileExists && parentPackage.getElementName().startsWith("com.webobjects")) { apiFile = new File("/Developer/Applications/WebObjects/WebObjects Builder.app/Contents/Resources/WebObjectDefinitions.xml"); fileExists = apiFile.exists(); } if (fileExists) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document apiDoc = db.parse(apiFile); NodeList woNodes = apiDoc.getDocumentElement().getElementsByTagName("wo"); int woNodesLength = woNodes.getLength(); for (int i = 0; i < woNodesLength; i++) { System.out.println("WODCompletionProcessor.fillInAssociationNameCompletionProposals: " + woNodes.item(i).getNodeName()); } } } } else if (typeContainer instanceof ICompilationUnit) { ICompilationUnit cu = (ICompilationUnit) typeContainer; } } catch (Throwable t) {  t.printStackTrace(); } */
  protected void fillInAssociationNameCompletionProposals(IJavaProject _project, IType _componentType, IPath _wodFilePath, String _token, int _tokenOffset, int _offset, List _completionProposalsList) throws JavaModelException {    String partialToken = partialToken(_token, _tokenOffset, _offset).toLowerCase();    ITypeHierarchy typeHierarchy = _componentType.newSupertypeHierarchy(null);    IType[] types = typeHierarchy.getAllTypes();    for (int typeNum = 0; typeNum < types.length; typeNum++) {      IField[] fields = types[typeNum].getFields();      for (int fieldNum = 0; fieldNum < fields.length; fieldNum++) {        findMemberProposals(fields[fieldNum], partialToken, WODCompletionProcessor.FIELD_PREFIXES, _token, _tokenOffset, _offset, _completionProposalsList, 1, false);      }      IMethod[] methods = types[typeNum].getMethods();      for (int methodNum = 0; methodNum < methods.length; methodNum++) {        findMemberProposals(methods[methodNum], partialToken, WODCompletionProcessor.SET_METHOD_PREFIXES, _token, _tokenOffset, _offset, _completionProposalsList, 1, false);      }    }    /*    IOpenable typeContainer = _componentType.getOpenable();    if (typeContainer instanceof IClassFile) {      IClassFile classFile = (IClassFile) typeContainer;      IJavaElement parent = classFile.getParent();      if (parent instanceof IPackageFragment) {        IPackageFragment parentPackage = (IPackageFragment) parent;        IPath packagePath = parentPackage.getPath();        IPath apiPath = packagePath.removeLastSegments(2).append(_componentType.getElementName()).addFileExtension("api");        File apiFile = apiPath.toFile();        System.out.println("WODCompletionProcessor.fillInAssociationNameCompletionProposals: " + apiPath);        if (apiFile.exists()) {          System.out.println("WODCompletionProcessor.fillInAssociationNameCompletionProposals: exists");        }      }    }    else if (typeContainer instanceof ICompilationUnit) {      ICompilationUnit cu = (ICompilationUnit) typeContainer;    }    */  }