1f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael/* 2f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * Copyright (C) 2009 The Android Open Source Project 3f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * 4f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * Licensed under the Eclipse Public License, Version 1.0 (the "License"); 5f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * you may not use this file except in compliance with the License. 6f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * You may obtain a copy of the License at 7f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * 8f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * http://www.eclipse.org/org/documents/epl-v10.php 9f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * 10f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * Unless required by applicable law or agreed to in writing, software 11f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * distributed under the License is distributed on an "AS IS" BASIS, 12f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * See the License for the specific language governing permissions and 14f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * limitations under the License. 15f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael */ 16f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael 1769425d803b34589309a69eddc53a338e1409b30cXavier Ducrohetpackage com.android.ide.eclipse.adt.internal.editors.manifest.descriptors; 18f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael 192be70bde5a6dcd6447c32ef55866020be372f96cTor Norbyeimport com.android.ide.common.api.IAttributeInfo; 2050ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Mollimport com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils; 2150ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Mollimport com.android.ide.eclipse.adt.internal.editors.descriptors.ITextAttributeCreator; 2269425d803b34589309a69eddc53a338e1409b30cXavier Ducrohetimport com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor; 2369425d803b34589309a69eddc53a338e1409b30cXavier Ducrohetimport com.android.ide.eclipse.adt.internal.editors.manifest.model.UiManifestPkgAttrNode; 2469425d803b34589309a69eddc53a338e1409b30cXavier Ducrohetimport com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode; 2569425d803b34589309a69eddc53a338e1409b30cXavier Ducrohetimport com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; 26f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael 27f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael/** 28f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * Describes a package XML attribute. It is displayed by a {@link UiManifestPkgAttrNode}. 2950ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll * <p/> 3050ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll * Used by the override for .../targetPackage in {@link AndroidManifestDescriptors}. 31f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael */ 32f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphaelpublic class ManifestPkgAttrDescriptor extends TextAttributeDescriptor { 33f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael 3450ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll /** 3550ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll * Used by {@link DescriptorsUtils} to create instances of this descriptor. 3650ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll */ 3750ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { 38ab36f4e7488358dea4ab6b54ee2b7bef3da0232bTor Norbye @Override 3950ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll public TextAttributeDescriptor create(String xmlLocalName, 406b09013b6cb0fdcb48350a60bb3ed924ac9f562dTor Norbye String nsUri, IAttributeInfo attrInfo) { 416b09013b6cb0fdcb48350a60bb3ed924ac9f562dTor Norbye return new ManifestPkgAttrDescriptor(xmlLocalName, nsUri, attrInfo); 4250ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll } 4350ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll }; 4450ccfaad36b6570a54c96bf6c5aa862c16c4c608Raphael Moll 456b09013b6cb0fdcb48350a60bb3ed924ac9f562dTor Norbye public ManifestPkgAttrDescriptor(String xmlLocalName, String nsUri, IAttributeInfo attrInfo) { 466b09013b6cb0fdcb48350a60bb3ed924ac9f562dTor Norbye super(xmlLocalName, nsUri, attrInfo); 47f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael } 48953aeea61efb31402198b969478d1bda5dcbe613Raphael Moll 49f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael /** 50f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael * @return A new {@link UiManifestPkgAttrNode} linked to this descriptor. 51f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael */ 52f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael @Override 53f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael public UiAttributeNode createUiNode(UiElementNode uiParent) { 54f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael return new UiManifestPkgAttrNode(this, uiParent); 55f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael } 56f63f5bea4d1f5c4a55790c7e85c5cadc5867e35aRaphael} 57