/** @param context will contain instances of scanned components. This method will clear scanners, as they are no * longer expected to be needed. * @param contextDestroyer used to register destruction callbacks. */ private void initiateRegularComponents(final Context context, final ContextDestroyer contextDestroyer) { final Array<Class<?>> componentTypes = GdxArrays.newArray(); for (final Entry<Class<?>, ClassScanner> scannerData : scanners) { componentTypes.addAll(scannerData.value.findClassesAnnotatedWith(scannerData.key, scannedAnnotations)); } final Array<Object> components = createComponents(componentTypes, context); // Manually added components are already mapped. Now they will be initiated: components.addAll(manuallyAddedComponents); manuallyAddedComponents.clear(); initiateComponents(components, context, contextDestroyer); // Scanners no longer needed, all components found: if (clearProcessors) { scanners.clear(); } }
/** @param context will contain instances of scanned annotation procesors. * @param contextDestroyer used to register destruction callbacks. */ private void initiateMetaComponents(final Context context, final ContextDestroyer contextDestroyer) { final Array<Class<?>> metaComponentTypes = GdxArrays.newArray(); for (final Entry<Class<?>, ClassScanner> scannerData : scanners) { metaComponentTypes .addAll(scannerData.value.findClassesAnnotatedWith(scannerData.key, scannedMetaAnnotations)); } final Array<Object> metaComponents = createComponents(metaComponentTypes, context); metaComponents.addAll(manuallyAddedProcessors); manuallyAddedProcessors.clear(); initiateComponents(metaComponents, context, contextDestroyer); }
private boolean selectFirstEnabledTab () { for (Entry<Tab, TabButtonTable> entry : tabsButtonMap) { if (entry.value.button.isDisabled() == false) { switchTab(entry.key); return true; } } return false; }