use of com.intellij.openapi.extensions.ExtensionsArea in project intellij-elixir by KronicDeth.
the class ParsingTestCase method setProjectSdkFromSdkHome.
private void setProjectSdkFromSdkHome(@NotNull String sdkHome) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
MessageBus messageBus = messageBus();
registerProjectFileIndex(messageBus);
ProjectRootManager projectRootManager = registerProjectRootManager();
assertTrue(pathIsValidSdkHome(sdkHome));
registerExtensionPoint(OrderRootType.EP_NAME, OrderRootType.class);
registerExtension(OrderRootType.EP_NAME, new JavadocOrderRootType());
getApplication().addComponent(VirtualFileManager.class, new VirtualFileManagerImpl(new VirtualFileSystem[] { new MockLocalFileSystem() }, messageBus));
ProjectJdkTable projectJdkTable = new ProjectJdkTableImpl();
registerApplicationService(ProjectJdkTable.class, projectJdkTable);
registerExtensionPoint(com.intellij.openapi.projectRoots.SdkType.EP_NAME, com.intellij.openapi.projectRoots.SdkType.class);
registerExtension(com.intellij.openapi.projectRoots.SdkType.EP_NAME, new ElixirSdkType());
Sdk sdk = ElixirSdkType.createMockSdk(sdkHome, elixirSdkRelease());
projectJdkTable.addJdk(sdk);
ExtensionsArea area = Extensions.getArea(myProject);
registerExtensionPoint(area, ProjectExtension.EP_NAME, ProjectExtension.class);
registerExtensionPoint(FilePropertyPusher.EP_NAME, FilePropertyPusher.class);
myProject.addComponent(PushedFilePropertiesUpdater.class, new PushedFilePropertiesUpdaterImpl(myProject));
projectRootManager.setProjectSdk(sdk);
}
use of com.intellij.openapi.extensions.ExtensionsArea in project intellij-community by JetBrains.
the class DumpExtensionsAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
List<ExtensionsArea> areas = new ArrayList<>();
areas.add(Extensions.getRootArea());
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project != null) {
areas.add(Extensions.getArea(project));
final Module[] modules = ModuleManager.getInstance(project).getModules();
if (modules.length > 0) {
areas.add(Extensions.getArea(modules[0]));
}
}
System.out.print(areas.size() + " extension areas: ");
for (ExtensionsArea area : areas) {
System.out.print(area.getAreaClass() + " ");
}
System.out.println("\n");
List<ExtensionPoint> points = new ArrayList<>();
for (ExtensionsArea area : areas) {
points.addAll(Arrays.asList(area.getExtensionPoints()));
}
System.out.println(points.size() + " extension points: ");
for (ExtensionPoint point : points) {
System.out.println(" " + point.getName());
}
List<Object> extensions = new ArrayList<>();
for (ExtensionPoint point : points) {
extensions.addAll(Arrays.asList(point.getExtensions()));
}
System.out.println("\n" + extensions.size() + " extensions:");
for (Object extension : extensions) {
if (extension instanceof Configurable) {
System.out.println("!!!! Configurable extension found. Kill it !!!");
}
System.out.println(extension);
}
}
use of com.intellij.openapi.extensions.ExtensionsArea in project intellij-community by JetBrains.
the class UsageNodeTreeBuilderTest method buildUsageTree.
private GroupNode buildUsageTree(int[] indices, UsageGroupingRule[] rules) {
Usage[] usages = new Usage[indices.length];
for (int i = 0; i < usages.length; i++) {
usages[i] = createUsage(indices[i]);
}
UsageViewPresentation presentation = new UsageViewPresentation();
presentation.setUsagesString("searching for mock usages");
ExtensionsArea area = Extensions.getRootArea();
ExtensionPoint<UsageGroupingRuleProvider> point = area.getExtensionPoint(UsageGroupingRuleProvider.EP_NAME);
UsageGroupingRuleProvider provider = new UsageGroupingRuleProvider() {
@NotNull
@Override
public UsageGroupingRule[] getActiveRules(Project project) {
return rules;
}
@NotNull
@Override
public AnAction[] createGroupingActions(UsageView view) {
return AnAction.EMPTY_ARRAY;
}
};
point.registerExtension(provider);
try {
UsageViewImpl usageView = new UsageViewImpl(getProject(), presentation, UsageTarget.EMPTY_ARRAY, null);
Disposer.register(getTestRootDisposable(), usageView);
for (Usage usage : usages) {
usageView.appendUsage(usage);
}
UIUtil.dispatchAllInvocationEvents();
return usageView.getRoot();
} finally {
point.unregisterExtension(provider);
}
}
use of com.intellij.openapi.extensions.ExtensionsArea in project android by JetBrains.
the class GradleRunnerCleanupTask method doCleanUp.
@Override
void doCleanUp(@NotNull Project project) {
ExtensionsArea area = Extensions.getArea(project);
ExtensionPoint<ConfigurableEP<Configurable>> projectConfigurable = area.getExtensionPoint(PROJECT_CONFIGURABLE);
// Disable the Gradle -> Runner settings.
for (ConfigurableEP<Configurable> configurableEP : projectConfigurable.getExtensions()) {
if (GradleConfigurable.class.getName().equals(configurableEP.instanceClass)) {
List<ConfigurableEP> children = new ArrayList<>();
for (ConfigurableEP child : configurableEP.children) {
if (!GradleRunnerConfigurable.class.getName().equals(child.instanceClass)) {
children.add(child);
}
}
configurableEP.children = children.toArray(new ConfigurableEP[children.size()]);
}
}
}
use of com.intellij.openapi.extensions.ExtensionsArea in project android by JetBrains.
the class ProjectPreferencesCleanUpTask method doCleanUp.
@Override
void doCleanUp(@NotNull Project project) {
ExtensionsArea area = Extensions.getArea(project);
ExtensionPoint<ConfigurableEP<Configurable>> projectConfigurable = area.getExtensionPoint(PROJECT_CONFIGURABLE);
cleanUpPreferences(projectConfigurable, PROJECT_PREFERENCES_TO_REMOVE);
}
Aggregations