本文整理汇总了Java中org.jetbrains.android.facet.AndroidFacet.getSystemResourceManager方法的典型用法代码示例。如果您正苦于以下问题:Java AndroidFacet.getSystemResourceManager方法的具体用法?Java AndroidFacet.getSystemResourceManager怎么用?Java AndroidFacet.getSystemResourceManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.android.facet.AndroidFacet
的用法示例。
在下文中一共展示了AndroidFacet.getSystemResourceManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: askForAttributeValue
import org.jetbrains.android.facet.AndroidFacet; //导入方法依赖的package包/类
@Nullable
private String askForAttributeValue(@NotNull PsiElement context) {
final AndroidFacet facet = AndroidFacet.getInstance(context);
final String message = "Specify value of attribute '" + myAttributeName + "'";
final String title = "Set Attribute Value";
if (facet != null) {
final SystemResourceManager srm = facet.getSystemResourceManager();
if (srm != null) {
final AttributeDefinitions attrDefs = srm.getAttributeDefinitions();
if (attrDefs != null) {
final AttributeDefinition def = attrDefs.getAttrDefByName(myAttributeName);
if (def != null) {
final String[] variants = def.getValues();
if (variants.length > 0) {
return Messages.showEditableChooseDialog(message, title, Messages.getQuestionIcon(), variants, variants[0], null);
}
}
}
}
}
return Messages.showInputDialog(context.getProject(), message, title, Messages.getQuestionIcon());
}
示例2: findAttributeDefinitionGlobally
import org.jetbrains.android.facet.AndroidFacet; //导入方法依赖的package包/类
@Nullable
private static AttributeDefinition findAttributeDefinitionGlobally(@NotNull AndroidFacet facet,
@NotNull String namespace,
@NotNull String localName) {
ResourceManager resourceManager;
if (ANDROID_URI.equals(namespace) || TOOLS_URI.equals(namespace)) {
resourceManager = facet.getSystemResourceManager();
}
else if (namespace.equals(AUTO_URI) || namespace.startsWith(URI_PREFIX)) {
resourceManager = facet.getLocalResourceManager();
}
else {
resourceManager = facet.getSystemResourceManager();
}
if (resourceManager != null) {
final AttributeDefinitions attrDefs = resourceManager.getAttributeDefinitions();
if (attrDefs != null) {
return attrDefs.getAttrDefByName(localName);
}
}
return null;
}
示例3: getAttrDefs
import org.jetbrains.android.facet.AndroidFacet; //导入方法依赖的package包/类
@Nullable
private static AttributeDefinitions getAttrDefs(AndroidFacet facet) {
final SystemResourceManager manager = facet.getSystemResourceManager();
return manager != null ? manager.getAttributeDefinitions() : null;
}
示例4: getInstance
import org.jetbrains.android.facet.AndroidFacet; //导入方法依赖的package包/类
@Nullable
public static SystemResourceManager getInstance(@NotNull ConvertContext context) {
AndroidFacet facet = AndroidFacet.getInstance(context);
return facet != null ? facet.getSystemResourceManager() : null;
}