Java Code Examples for com.intellij.psi.PsiJavaFile#getPackageName()

The following examples show how to use com.intellij.psi.PsiJavaFile#getPackageName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileManager.java    From Intellij-Plugin with Apache License 2.0 5 votes vote down vote up
public static String getJavaFileName(PsiFile value) {
    PsiJavaFile javaFile = (PsiJavaFile) value;
    if (!javaFile.getPackageName().equals("")) {
        return javaFile.getPackageName() + "." + javaFile.getName();
    }
    return javaFile.getName();
}
 
Example 2
Source File: FileFQN.java    From intellij-reference-diagram with Apache License 2.0 4 votes vote down vote up
public static FileFQN from(PsiJavaFile psiJavaFile) {
    return new FileFQN(psiJavaFile.getPackageName(), psiJavaFile.getName(), psiJavaFile);
}