admin 管理员组

文章数量: 1184232


2023年12月22日发(作者:linux命令wq)

兼容性

获取 Component 实例获取 Application Component通过 ApplicationManager获取//获取application容器中的组件TestApplication testApplication = lication().getComponent();获取project通过action获取DataContext dataContext = aContext();// DataConstants 被标记为 @deprecatedmProject = (Project)a(T);Project project = a(T);通过PsiElement获取/** * The common base interface for all elements of the PSI tree. *

* Please see IntelliJ Platform Architectural Overview * for high-level overview. */public interface PsiElement extends UserDataHolder, Iconable { /** * The empty array of PSI elements which can be reused to avoid unnecessary allocations. */ PsiElement[] EMPTY_ARRAY = new PsiElement[0]; ArrayFactory ARRAY_FACTORY = count -> count == 0 ? EMPTY_ARRAY : new PsiElement[count]; /** * Returns the project to which the PSI element belongs. * * @return the project instance. * @throws PsiInvalidElementAccessException if this element is invalid */ @NotNull @Contract(pure=true) Project getProject() throws PsiInvalidElementAccessException;}获取module通过project获取TestModule testModule = ponent();通过action获取


本文标签: 获取 命令 作者 容器 实例