本文整理匯總了Java中com.intellij.openapi.module.Module.getModuleFilePath方法的典型用法代碼示例。如果您正苦於以下問題:Java Module.getModuleFilePath方法的具體用法?Java Module.getModuleFilePath怎麽用?Java Module.getModuleFilePath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.module.Module
的用法示例。
在下文中一共展示了Module.getModuleFilePath方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: composeModulesArgument
import com.intellij.openapi.module.Module; //導入方法依賴的package包/類
private String composeModulesArgument(Project project) {
Module[] modules = ModuleManager.getInstance(project).getModules();
StringBuilder builder = new StringBuilder();
for(int i = 0; i < modules.length; i++) {
Module module = modules[i];
String path = module.getModuleFilePath();
builder.append(i == 0 ? "" : ":").append(path);
}
return builder.toString();
}
示例2: getFileTitle
import com.intellij.openapi.module.Module; //導入方法依賴的package包/類
@Override
public String getFileTitle(@NotNull Project project, @NotNull VirtualFile virtualFile) {
String fileCustomTitle;
try {
Module fileModule = FileIndexFacade.getInstance(project).getModuleForFile(virtualFile);
String projectDefaultTitle = defaultBuilder.getProjectTitle(project);
String projectName = project.getName();
String projectPath = project.getBasePath();
String fileDefaultTitle = defaultBuilder.getFileTitle(project, virtualFile);
String fileName = virtualFile.getName();
String filePath = virtualFile.getPath();
String fileExt = virtualFile.getExtension();
String moduleName = null;
String modulePath = null;
if (fileModule != null) {
moduleName = fileModule.getName();
modulePath = fileModule.getModuleFilePath();
}
fileCustomTitle = engine.eval("fileTemplate({" +
"projectDefaultTitle: '" + projectDefaultTitle + "'," +
"projectName: '" + projectName + "'," +
"projectPath: '" + projectPath + "'," +
"fileDefaultTitle: '" + fileDefaultTitle + "'," +
"fileName: '" + fileName + "'," +
"filePath: '" + filePath + "'," +
"fileExt: '" + fileExt + "'," +
"moduleName: '" + moduleName + "'," +
"modulePath: '" + modulePath + "'" +
"})").toString();
} catch (Exception e) {
fileCustomTitle = defaultBuilder.getFileTitle(project, virtualFile);
}
return fileCustomTitle;
}