Search in sources :

Example 1 with PublicInheritorFilter

use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.

the class BCUtils method getMainClassFilter.

public static PublicInheritorFilter getMainClassFilter(@NotNull Module module, @Nullable FlexBuildConfiguration bc, final boolean rlm, final boolean includeTests, boolean caching) {
    final String baseClass = rlm ? FlashRunConfigurationForm.MODULE_BASE_CLASS_NAME : FlashRunConfigurationForm.SPRITE_CLASS_NAME;
    final GlobalSearchScope filterScope = bc == null ? module.getModuleWithDependenciesAndLibrariesScope(includeTests) : FlexUtils.getModuleWithDependenciesAndLibrariesScope(module, bc, includeTests);
    return new PublicInheritorFilter(module.getProject(), baseClass, filterScope, true, caching);
}
Also used : PublicInheritorFilter(com.intellij.lang.javascript.psi.impl.PublicInheritorFilter) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope)

Example 2 with PublicInheritorFilter

use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.

the class ActionScriptCompletionInTextFieldTest method doTestCustomScope.

private void doTestCustomScope(String activeBcName, String selectedBcName, int numberOfVariants) throws Exception {
    String filename = getTestName(false).replaceAll("\\d+", "");
    configureByFiles(null, BASE_PATH + filename + "_2.mxml", BASE_PATH + filename + "_3.mxml");
    final Sdk sdk = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
    FlexTestUtils.modifyConfigs(myProject, e -> {
        {
            final ModifiableFlexBuildConfiguration bc = e.getConfigurations(myModule)[0];
            bc.setName("Flex");
            bc.setNature(new BuildConfigurationNature(TargetPlatform.Web, false, OutputType.Application));
            FlexTestUtils.setSdk(bc, sdk);
        }
        {
            final ModifiableFlexBuildConfiguration bc = e.createConfiguration(myModule);
            bc.setName("AIR");
            bc.setNature(new BuildConfigurationNature(TargetPlatform.Desktop, false, OutputType.Application));
            FlexTestUtils.setSdk(bc, sdk);
        }
    });
    final FlexBuildConfigurationManager manager = FlexBuildConfigurationManager.getInstance(myModule);
    manager.setActiveBuildConfiguration(manager.findConfigurationByName(activeBcName));
    final ModuleWithDependenciesScope scope = FlexUtils.getModuleWithDependenciesAndLibrariesScope(myModule, manager.findConfigurationByName(selectedBcName), false);
    PublicInheritorFilter filter = new PublicInheritorFilter(myProject, FlashRunConfigurationForm.SPRITE_CLASS_NAME, scope, true);
    PsiFile fragment = JSReferenceEditor.forClassName("", myProject, null, GlobalSearchScope.moduleScope(myModule), null, filter, "").getPsiFile();
    doTestForEditorTextField((JSExpressionCodeFragment) fragment, "", "js2", BASE_PATH + filename + ".txt");
    if (numberOfVariants == 0) {
        assertNull(myItems);
    } else {
        assertEquals(numberOfVariants, myItems.length);
    }
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature) PublicInheritorFilter(com.intellij.lang.javascript.psi.impl.PublicInheritorFilter) FlexBuildConfigurationManager(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager) ModuleWithDependenciesScope(com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope) PsiFile(com.intellij.psi.PsiFile) Sdk(com.intellij.openapi.projectRoots.Sdk) ModifiableFlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)

Example 3 with PublicInheritorFilter

use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.

the class CreateFlexSkinDialog method createHostComponentCombo.

public static JSReferenceEditor createHostComponentCombo(String text, Module module) {
    final GlobalSearchScope scope = getHostComponentScope(module);
    Condition<JSClass> filter = new PublicInheritorFilter(module.getProject(), SKINNABLE_COMPONENT_CLASS, scope, true);
    return JSReferenceEditor.forClassName(text, module.getProject(), HOST_COMPONENT_RECENT_KEY, scope, null, filter, FlexBundle.message("choose.host.component"));
}
Also used : PublicInheritorFilter(com.intellij.lang.javascript.psi.impl.PublicInheritorFilter) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) JSClass(com.intellij.lang.javascript.psi.ecmal4.JSClass)

Aggregations

PublicInheritorFilter (com.intellij.lang.javascript.psi.impl.PublicInheritorFilter)3 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)2 BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)1 FlexBuildConfigurationManager (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager)1 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)1 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)1 ModuleWithDependenciesScope (com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 PsiFile (com.intellij.psi.PsiFile)1