Package com.intellij.psi

Examples of com.intellij.psi.JavaPsiFacade


    }
  }

  private static void toggleGrammarKitSrc(Module module, String testDataPath) throws Exception {
    String absolutePath = new File("").getAbsolutePath();
    JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
    boolean add = facade.findPackage("org.intellij.grammar.psi") == null;
    if (add) {
      VfsRootAccess.allowRootAccess(absolutePath);
    }
    else {
      VfsRootAccess.disallowRootAccess(absolutePath);
    }
    AccessToken accessToken = ApplicationManager.getApplication().acquireWriteActionLock(null);
    try {
      ModifiableRootModel model = ModuleRootManager.getInstance(module).getModifiableModel();
      String supportUrl = getUrl(testDataPath + "/../../support");
      String genUrl = getUrl(testDataPath + "/../../gen");
      if (add) {
        model.addContentEntry(supportUrl).addSourceFolder(supportUrl, false);
        model.addContentEntry(genUrl).addSourceFolder(genUrl, false);
      }
      else {
        for (ContentEntry entry : model.getContentEntries()) {
          if (supportUrl.equals(entry.getUrl()) || genUrl.equals(entry.getUrl())) {
            model.removeContentEntry(entry);
          }
        }
      }
      model.commit();
    }
    finally {
      accessToken.finish();
    }
    assertTrue("GrammarKit src problem", add == (null != facade.findPackage("org.intellij.grammar.psi")));
  }
View Full Code Here


                        return null;
                    }
                }
                case PACKAGE: {
                    String qualifiedName = PbPsiUtil.getQualifiedReferenceText(ref);
                    JavaPsiFacade facade = JavaPsiFacade.getInstance(ref.getManager().getProject());
                    return facade.findPackage(qualifiedName);
                }
                case MESSAGE_OR_GROUP:
                case MESSAGE_OR_ENUM_OR_GROUP:
                case MESSAGE_OR_PACKAGE_OR_GROUP:
                case EXTEND_FIELD: {
View Full Code Here

TOP

Related Classes of com.intellij.psi.JavaPsiFacade

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.