private IJavaProject getJavaProject(ContentAssistRequest request) {
   if (request != null) {
     IStructuredDocumentRegion region = request.getDocumentRegion();
     if (region != null) {
       IDocument document = region.getParentDocument();
       return MybatipseXmlUtil.getJavaProject(document);
     }
   }
   return null;
 }
  public static IProject getProject(ContentAssistRequest request) {

    if (request != null) {
      IStructuredDocumentRegion region = request.getDocumentRegion();
      if (region != null) {
        IDocument document = region.getParentDocument();
        return getProject(document);
      }
    }
    return null;
  }
 /**
  * @param sdRegion
  * @return
  */
 protected ITypedRegion getPartition(IStructuredDocumentRegion sdRegion) {
   ITypedRegion tr = null;
   if (!sdRegion.isDeleted())
     tr = getPartition(sdRegion.getParentDocument(), sdRegion.getStartOffset());
   return tr;
 }