本文整理汇总了Java中com.intellij.ide.projectView.impl.ProjectRootsUtil.isModuleSourceRoot方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectRootsUtil.isModuleSourceRoot方法的具体用法?Java ProjectRootsUtil.isModuleSourceRoot怎么用?Java ProjectRootsUtil.isModuleSourceRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.impl.ProjectRootsUtil
的用法示例。
在下文中一共展示了ProjectRootsUtil.isModuleSourceRoot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isModuleInProjectViewPopup
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
protected static boolean isModuleInProjectViewPopup(AnActionEvent e) {
if (ActionPlaces.PROJECT_VIEW_POPUP.equals(e.getPlace())) {
final Project project = getEventProject(e);
final Module module = LangDataKeys.MODULE.getData(e.getDataContext());
if (project != null && module != null) {
final VirtualFile moduleFolder = CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
if (moduleFolder == null) {
return false;
}
if (ProjectRootsUtil.isModuleContentRoot(moduleFolder, project) || ProjectRootsUtil.isModuleSourceRoot(moduleFolder, project)) {
return true;
}
}
}
return false;
}
示例2: getNavigateActionText
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public String getNavigateActionText(boolean focusEditor) {
VirtualFile file = getVirtualFile();
Project project = getProject();
if (file != null && project != null) {
if (ProjectRootsUtil.isModuleContentRoot(file, project) || ProjectRootsUtil.isModuleSourceRoot(file, project)) {
return "Open Module Settings";
}
if (ProjectRootsUtil.isLibraryRoot(file, project)) {
return "Open Library Settings";
}
}
return null;
}
示例3: canNavigate
import com.intellij.ide.projectView.impl.ProjectRootsUtil; //导入方法依赖的package包/类
@Override
public boolean canNavigate() {
VirtualFile file = getVirtualFile();
Project project = getProject();
ProjectSettingsService service = ProjectSettingsService.getInstance(myProject);
return file != null && ((ProjectRootsUtil.isModuleContentRoot(file, project) && service.canOpenModuleSettings()) ||
(ProjectRootsUtil.isModuleSourceRoot(file, project) && service.canOpenContentEntriesSettings()) ||
(ProjectRootsUtil.isLibraryRoot(file, project) && service.canOpenModuleLibrarySettings()));
}