Search in sources :

Example 11 with AndroidTargetData

use of org.jetbrains.android.sdk.AndroidTargetData in project android by JetBrains.

the class StateListPicker method doValidate.

/**
   * Returns a {@link ValidationInfo} in the case one of the state list state has a value that does not resolve to a valid resource,
   * or a value that is a private framework value. or if one of the state list component requires an API level higher than minApi.
   */
@Nullable
public /*if there is no error*/
ValidationInfo doValidate(int minApi) {
    IAndroidTarget target = myConfiguration.getRealTarget();
    assert target != null;
    final AndroidTargetData androidTargetData = AndroidTargetData.getTargetData(target, myModule);
    assert androidTargetData != null;
    ResourceRepository frameworkResources = myConfiguration.getFrameworkResources();
    assert frameworkResources != null;
    for (StateComponent component : myStateComponents) {
        ValidationInfo error = component.doValidate(minApi, androidTargetData);
        if (error != null) {
            return error;
        }
    }
    return null;
}
Also used : ValidationInfo(com.intellij.openapi.ui.ValidationInfo) IAndroidTarget(com.android.sdklib.IAndroidTarget) ResourceRepository(com.android.ide.common.resources.ResourceRepository) AndroidTargetData(org.jetbrains.android.sdk.AndroidTargetData) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

AndroidTargetData (org.jetbrains.android.sdk.AndroidTargetData)11 IAndroidTarget (com.android.sdklib.IAndroidTarget)8 AndroidPlatform (org.jetbrains.android.sdk.AndroidPlatform)5 Nullable (org.jetbrains.annotations.Nullable)5 Module (com.intellij.openapi.module.Module)3 Configuration (com.android.tools.idea.configurations.Configuration)2 IOException (java.io.IOException)2 AttributeDefinitions (org.jetbrains.android.dom.attrs.AttributeDefinitions)2 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)2 LayoutLibrary (com.android.ide.common.rendering.LayoutLibrary)1 ResourceVisibilityLookup (com.android.ide.common.repository.ResourceVisibilityLookup)1 FrameworkResources (com.android.ide.common.resources.FrameworkResources)1 ResourceRepository (com.android.ide.common.resources.ResourceRepository)1 FolderConfiguration (com.android.ide.common.resources.configuration.FolderConfiguration)1 LocaleQualifier (com.android.ide.common.resources.configuration.LocaleQualifier)1 ResourceType (com.android.resources.ResourceType)1 ConfigurationManager (com.android.tools.idea.configurations.ConfigurationManager)1 HtmlBuilder (com.android.utils.HtmlBuilder)1 ValidationInfo (com.intellij.openapi.ui.ValidationInfo)1 AttributeDefinition (org.jetbrains.android.dom.attrs.AttributeDefinition)1