Fields Summary |
---|
public static final int | DESCRIPTOR_MANIFEST |
public static final int | DESCRIPTOR_LAYOUT |
public static final int | DESCRIPTOR_MENU |
public static final int | DESCRIPTOR_XML |
public static final int | DESCRIPTOR_RESOURCES |
public static final int | DESCRIPTOR_SEARCHABLE |
public static final int | DESCRIPTOR_PREFERENCES |
public static final int | DESCRIPTOR_APPWIDGET_PROVIDER |
private final com.android.sdklib.IAndroidTarget | mTarget |
private com.android.ide.eclipse.adt.build.DexWrapper | mDexWrapper |
private Hashtable | mAttributeValuesmAttributeValues is a map { key => list [ values ] }.
The key for the map is "(element-xml-name,attribute-namespace:attribute-xml-local-name)".
The attribute namespace prefix must be:
- "android" for AndroidConstants.NS_RESOURCES
- "xmlns" for the XMLNS URI.
This is used for attributes that do not have a unique name, but still need to be populated
with values in the UI. Uniquely named attributes have their values in {@link #mEnumValueMap}. |
private com.android.ide.eclipse.common.resources.IResourceRepository | mSystemResourceRepository |
private com.android.ide.eclipse.editors.manifest.descriptors.AndroidManifestDescriptors | mManifestDescriptors |
private com.android.ide.eclipse.editors.layout.descriptors.LayoutDescriptors | mLayoutDescriptors |
private com.android.ide.eclipse.editors.menu.descriptors.MenuDescriptors | mMenuDescriptors |
private com.android.ide.eclipse.editors.xml.descriptors.XmlDescriptors | mXmlDescriptors |
private Map | mEnumValueMap |
private com.android.ide.eclipse.editors.resources.manager.ProjectResources | mFrameworkResources |
private LayoutBridge | mLayoutBridge |
private boolean | mLayoutBridgeInit |
Methods Summary |
---|
public java.lang.String[] | getAttributeValues(java.lang.String elementName, java.lang.String attributeName)Returns this list of possible values for an XML attribute.
This should only be called for attributes for which possible values depend on the
parent element node.
For attributes that have the same values no matter the parent node, use
{@link #getEnumValueMap()}.
String key = String.format("(%1$s,%2$s)", elementName, attributeName); //$NON-NLS-1$
return mAttributeValues.get(key);
|
public java.lang.String[] | getAttributeValues(java.lang.String elementName, java.lang.String attributeName, java.lang.String greatGrandParentElementName)Returns this list of possible values for an XML attribute.
This should only be called for attributes for which possible values depend on the
parent and great-grand-parent element node.
The typical example of this is for the 'name' attribute under
activity/intent-filter/action
For attributes that have the same values no matter the parent node, use
{@link #getEnumValueMap()}.
if (greatGrandParentElementName != null) {
String key = String.format("(%1$s,%2$s,%3$s)", //$NON-NLS-1$
greatGrandParentElementName, elementName, attributeName);
String[] values = mAttributeValues.get(key);
if (values != null) {
return values;
}
}
return getAttributeValues(elementName, attributeName);
|
public com.android.ide.eclipse.editors.descriptors.IDescriptorProvider | getDescriptorProvider(int descriptorId)Returns an {@link IDescriptorProvider} from a given Id.
The Id can be one of {@link #DESCRIPTOR_MANIFEST}, {@link #DESCRIPTOR_LAYOUT},
{@link #DESCRIPTOR_MENU}, or {@link #DESCRIPTOR_XML}.
All other values will throw an {@link IllegalArgumentException}.
switch (descriptorId) {
case DESCRIPTOR_MANIFEST:
return mManifestDescriptors;
case DESCRIPTOR_LAYOUT:
return mLayoutDescriptors;
case DESCRIPTOR_MENU:
return mMenuDescriptors;
case DESCRIPTOR_XML:
return mXmlDescriptors;
case DESCRIPTOR_RESOURCES:
// FIXME: since it's hard-coded the Resources Descriptors are not platform dependent.
return ResourcesDescriptors.getInstance();
case DESCRIPTOR_PREFERENCES:
return mXmlDescriptors.getPreferencesProvider();
case DESCRIPTOR_APPWIDGET_PROVIDER:
return mXmlDescriptors.getAppWidgetProvider();
case DESCRIPTOR_SEARCHABLE:
return mXmlDescriptors.getSearchableProvider();
default :
throw new IllegalArgumentException();
}
|
public com.android.ide.eclipse.adt.build.DexWrapper | getDexWrapper()
return mDexWrapper;
|
public java.util.Map | getEnumValueMap()Returns the enum values map.
The map defines the possible values for XML attributes. The key is the attribute name
and the value is a map of (string, integer) in which the key (string) is the name of
the value, and the Integer is the numerical value in the compiled binary XML files.
return mEnumValueMap;
|
public com.android.ide.eclipse.editors.resources.manager.ProjectResources | getFrameworkResources()Returns the {@link ProjectResources} containing the Framework Resources.
return mFrameworkResources;
|
public synchronized com.android.ide.eclipse.adt.sdk.AndroidTargetData$LayoutBridge | getLayoutBridge()Returns a {@link LayoutBridge} object possibly containing a {@link ILayoutBridge} object.
If {@link LayoutBridge#bridge} is null , {@link LayoutBridge#status} will
contain the reason (either {@link LoadStatus#LOADING} or {@link LoadStatus#FAILED}).
Valid {@link ILayoutBridge} objects are always initialized before being returned.
if (mLayoutBridgeInit == false && mLayoutBridge.bridge != null) {
mLayoutBridge.bridge.init(mTarget.getPath(IAndroidTarget.FONTS),
getEnumValueMap());
mLayoutBridgeInit = true;
}
return mLayoutBridge;
|
public com.android.ide.eclipse.editors.layout.descriptors.LayoutDescriptors | getLayoutDescriptors()Returns the layout Descriptors.
return mLayoutDescriptors;
|
public com.android.ide.eclipse.editors.manifest.descriptors.AndroidManifestDescriptors | getManifestDescriptors()Returns the manifest descriptors.
return mManifestDescriptors;
|
public com.android.ide.eclipse.editors.menu.descriptors.MenuDescriptors | getMenuDescriptors()Returns the menu descriptors.
return mMenuDescriptors;
|
public com.android.ide.eclipse.common.resources.IResourceRepository | getSystemResources()
return mSystemResourceRepository;
|
public com.android.ide.eclipse.editors.xml.descriptors.XmlDescriptors | getXmlDescriptors()Returns the XML descriptors
return mXmlDescriptors;
|
void | setDexWrapper(com.android.ide.eclipse.adt.build.DexWrapper wrapper)
mDexWrapper = wrapper;
|
void | setExtraData(com.android.ide.eclipse.common.resources.IResourceRepository systemResourceRepository, com.android.ide.eclipse.editors.manifest.descriptors.AndroidManifestDescriptors manifestDescriptors, com.android.ide.eclipse.editors.layout.descriptors.LayoutDescriptors layoutDescriptors, com.android.ide.eclipse.editors.menu.descriptors.MenuDescriptors menuDescriptors, com.android.ide.eclipse.editors.xml.descriptors.XmlDescriptors xmlDescriptors, java.util.Map enumValueMap, java.lang.String[] permissionValues, java.lang.String[] activityIntentActionValues, java.lang.String[] broadcastIntentActionValues, java.lang.String[] serviceIntentActionValues, java.lang.String[] intentCategoryValues, com.android.sdklib.IAndroidTarget.IOptionalLibrary[] optionalLibraries, com.android.ide.eclipse.editors.resources.manager.ProjectResources resources, com.android.ide.eclipse.adt.sdk.AndroidTargetData$LayoutBridge layoutBridge)Creates an AndroidTargetData object.
mSystemResourceRepository = systemResourceRepository;
mManifestDescriptors = manifestDescriptors;
mLayoutDescriptors = layoutDescriptors;
mMenuDescriptors = menuDescriptors;
mXmlDescriptors = xmlDescriptors;
mEnumValueMap = enumValueMap;
mFrameworkResources = resources;
mLayoutBridge = layoutBridge;
setPermissions(permissionValues);
setIntentFilterActionsAndCategories(activityIntentActionValues, broadcastIntentActionValues,
serviceIntentActionValues, intentCategoryValues);
setOptionalLibraries(optionalLibraries);
|
private void | setIntentFilterActionsAndCategories(java.lang.String[] activityIntentActions, java.lang.String[] broadcastIntentActions, java.lang.String[] serviceIntentActions, java.lang.String[] intentCategoryValues)
setValues("(activity,action,android:name)", activityIntentActions); //$NON-NLS-1$
setValues("(receiver,action,android:name)", broadcastIntentActions); //$NON-NLS-1$
setValues("(service,action,android:name)", serviceIntentActions); //$NON-NLS-1$
setValues("(category,android:name)", intentCategoryValues); //$NON-NLS-1$
|
private void | setOptionalLibraries(com.android.sdklib.IAndroidTarget.IOptionalLibrary[] optionalLibraries)
String[] values;
if (optionalLibraries == null) {
values = new String[0];
} else {
values = new String[optionalLibraries.length];
for (int i = 0; i < optionalLibraries.length; i++) {
values[i] = optionalLibraries[i].getName();
}
}
setValues("(uses-library,android:name)", values);
|
private void | setPermissions(java.lang.String[] permissionValues)Sets the permission values
setValues("(uses-permission,android:name)", permissionValues); //$NON-NLS-1$
setValues("(application,android:permission)", permissionValues); //$NON-NLS-1$
setValues("(activity,android:permission)", permissionValues); //$NON-NLS-1$
setValues("(receiver,android:permission)", permissionValues); //$NON-NLS-1$
setValues("(service,android:permission)", permissionValues); //$NON-NLS-1$
setValues("(provider,android:permission)", permissionValues); //$NON-NLS-1$
|
private void | setValues(java.lang.String name, java.lang.String[] values)Sets a (name, values) pair in the hash map.
If the name is already present in the map, it is first removed.
mAttributeValues.remove(name);
mAttributeValues.put(name, values);
|