Search in sources :

Example 1 with ContainsCondition

use of com.intellij.flex.uiDesigner.libraries.FlexLibrarySet.ContainsCondition in project intellij-plugins by JetBrains.

the class LibraryManager method getOrCreateFlexLibrarySet.

private FlexLibrarySet getOrCreateFlexLibrarySet(LibraryCollector libraryCollector, AssetCounter assetCounter) throws InitException {
    final String key = createKey(libraryCollector.sdkLibraries, true);
    FlexLibrarySet flexLibrarySet = (FlexLibrarySet) librarySets.get(key);
    if (flexLibrarySet == null) {
        final Set<CharSequence> globalDefinitions = getGlobalDefinitions(libraryCollector.getGlobalLibrary());
        final Condition<String> globalContains = name -> globalDefinitions.contains(name);
        final SortResult sortResult = sortLibraries(new LibrarySorter(new FlexDefinitionProcessor(libraryCollector.getFlexSdkVersion()), new FlexDefinitionMapProcessor(libraryCollector.getFlexSdkVersion(), globalContains)), libraryCollector, globalContains, key, true);
        flexLibrarySet = new FlexLibrarySet(sortResult, null, new ContainsCondition(globalDefinitions, sortResult.definitionMap), assetCounter, libraryCollector.getFlexSdkVersion());
        registerLibrarySet(key, flexLibrarySet);
    }
    return flexLibrarySet;
}
Also used : SortResult(com.intellij.flex.uiDesigner.libraries.LibrarySorter.SortResult) FlexUtils(com.intellij.lang.javascript.flex.FlexUtils) java.util(java.util) ArrayUtil(com.intellij.util.ArrayUtil) PropertiesFile(com.intellij.lang.properties.psi.PropertiesFile) VirtualFile(com.intellij.openapi.vfs.VirtualFile) THashSet(gnu.trove.THashSet) ModuleRootListener(com.intellij.openapi.roots.ModuleRootListener) THashMap(gnu.trove.THashMap) ReadAction(com.intellij.openapi.application.ReadAction) ProjectTopics(com.intellij.ProjectTopics) PsiManager(com.intellij.psi.PsiManager) AccessToken(com.intellij.openapi.application.AccessToken) StringBuilderSpinAllocator(com.intellij.util.StringBuilderSpinAllocator) InfoMap(org.jetbrains.io.InfoMap) Project(com.intellij.openapi.project.Project) Module(com.intellij.openapi.module.Module) AttachmentFactory(com.intellij.diagnostic.AttachmentFactory) ContainsCondition(com.intellij.flex.uiDesigner.libraries.FlexLibrarySet.ContainsCondition) com.intellij.flex.uiDesigner(com.intellij.flex.uiDesigner) StringUtil(com.intellij.openapi.util.text.StringUtil) IOException(java.io.IOException) ProjectComponentReferenceCounter(com.intellij.flex.uiDesigner.mxml.ProjectComponentReferenceCounter) Disposable(com.intellij.openapi.Disposable) Sdk(com.intellij.openapi.projectRoots.Sdk) File(java.io.File) NotificationType(com.intellij.notification.NotificationType) ClosedByInterruptException(java.nio.channels.ClosedByInterruptException) Notification(com.intellij.notification.Notification) Nullable(org.jetbrains.annotations.Nullable) ModuleRootEvent(com.intellij.openapi.roots.ModuleRootEvent) ExceptionUtil(com.intellij.util.ExceptionUtil) Pair(com.intellij.openapi.util.Pair) StringRegistry(com.intellij.flex.uiDesigner.io.StringRegistry) Attachment(com.intellij.openapi.diagnostic.Attachment) RetainCondition(org.jetbrains.io.RetainCondition) NotNull(org.jetbrains.annotations.NotNull) Condition(com.intellij.openapi.util.Condition) ContainsCondition(com.intellij.flex.uiDesigner.libraries.FlexLibrarySet.ContainsCondition) SortResult(com.intellij.flex.uiDesigner.libraries.LibrarySorter.SortResult)

Aggregations

ProjectTopics (com.intellij.ProjectTopics)1 AttachmentFactory (com.intellij.diagnostic.AttachmentFactory)1 com.intellij.flex.uiDesigner (com.intellij.flex.uiDesigner)1 StringRegistry (com.intellij.flex.uiDesigner.io.StringRegistry)1 ContainsCondition (com.intellij.flex.uiDesigner.libraries.FlexLibrarySet.ContainsCondition)1 SortResult (com.intellij.flex.uiDesigner.libraries.LibrarySorter.SortResult)1 ProjectComponentReferenceCounter (com.intellij.flex.uiDesigner.mxml.ProjectComponentReferenceCounter)1 FlexUtils (com.intellij.lang.javascript.flex.FlexUtils)1 PropertiesFile (com.intellij.lang.properties.psi.PropertiesFile)1 Notification (com.intellij.notification.Notification)1 NotificationType (com.intellij.notification.NotificationType)1 Disposable (com.intellij.openapi.Disposable)1 AccessToken (com.intellij.openapi.application.AccessToken)1 ReadAction (com.intellij.openapi.application.ReadAction)1 Attachment (com.intellij.openapi.diagnostic.Attachment)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 ModuleRootEvent (com.intellij.openapi.roots.ModuleRootEvent)1 ModuleRootListener (com.intellij.openapi.roots.ModuleRootListener)1