aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2011-01-20 14:25:22 -0800
committerTor Norbye <tnorbye@google.com>2011-01-20 14:25:22 -0800
commitd5cd92b446e43e8de625142415f560ee54636317 (patch)
tree32adb2cb5e3c10dc5c47d60b2d0b5347e4f4df70 /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
parent3a6b7dce85229abeb836605102913081caa078e1 (diff)
downloadsdk-d5cd92b446e43e8de625142415f560ee54636317.tar.gz
Add palette category metadata
This changeset contains some background work for the palette preview work, separated out to make that changeset smaller. First, it creates a new metadata XML file, which augments the metadata provided by the platform, defining things like palette categories, a natural order for the views within each category. The older code-based metadata for fill preferences (used to decide how to set the width and height attributes on drop) are also moved into this XML file. There will be more metadata added to this file in the next changeset, where for example XML fragments defining how to render a view for preview purposes will be defined there. Second, change the signature on the view and layout descriptor lists passed around such that we don't have to do instanceof ViewElementDescriptor in various places. Fix sentence capitalization for a couple of undo label strings. Change-Id: I66191ccf4cc0f4105c2331d496f3674ac1ad8b9d
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
index 0b1f2b706..e3faf4b1e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
@@ -18,7 +18,6 @@ package com.android.ide.eclipse.adt.internal.editors.layout.descriptors;
import com.android.ide.common.resources.platform.ViewClassInfo;
import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
import com.android.sdklib.IAndroidTarget;
@@ -201,7 +200,7 @@ public final class CustomViewDescriptorService {
private ViewElementDescriptor createViewDescriptor(IType type, IProject project,
ITypeHierarchy typeHierarchy) {
// check if the type is a built-in View class.
- List<ElementDescriptor> builtInList = null;
+ List<ViewElementDescriptor> builtInList = null;
Sdk currentSdk = Sdk.getCurrent();
if (currentSdk != null) {
@@ -220,12 +219,9 @@ public final class CustomViewDescriptorService {
String fqcn = type.getFullyQualifiedName();
if (builtInList != null) {
- for (ElementDescriptor desc : builtInList) {
- if (desc instanceof ViewElementDescriptor) {
- ViewElementDescriptor viewDescriptor = (ViewElementDescriptor)desc;
- if (fqcn.equals(viewDescriptor.getFullClassName())) {
- return viewDescriptor;
- }
+ for (ViewElementDescriptor viewDescriptor : builtInList) {
+ if (fqcn.equals(viewDescriptor.getFullClassName())) {
+ return viewDescriptor;
}
}
}