1 /* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Eclipse Public License, Version 1.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.eclipse.org/org/documents/epl-v10.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ide.eclipse.adt.internal.editors.manifest.descriptors; 18 19 import com.android.ide.common.api.IAttributeInfo; 20 import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils; 21 import com.android.ide.eclipse.adt.internal.editors.descriptors.ITextAttributeCreator; 22 import com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor; 23 import com.android.ide.eclipse.adt.internal.editors.manifest.model.UiManifestPkgAttrNode; 24 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode; 25 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; 26 27 /** 28 * Describes a package XML attribute. It is displayed by a {@link UiManifestPkgAttrNode}. 29 * <p/> 30 * Used by the override for .../targetPackage in {@link AndroidManifestDescriptors}. 31 */ 32 public class ManifestPkgAttrDescriptor extends TextAttributeDescriptor { 33 34 /** 35 * Used by {@link DescriptorsUtils} to create instances of this descriptor. 36 */ 37 public static final ITextAttributeCreator CREATOR = new ITextAttributeCreator() { 38 public TextAttributeDescriptor create(String xmlLocalName, 39 String uiName, String nsUri, String tooltip, 40 IAttributeInfo attrInfo) { 41 return new ManifestPkgAttrDescriptor(xmlLocalName, uiName, nsUri, tooltip, attrInfo); 42 } 43 }; 44 45 public ManifestPkgAttrDescriptor(String xmlLocalName, String uiName, String nsUri, 46 String tooltip, IAttributeInfo attrInfo) { 47 super(xmlLocalName, uiName, nsUri, tooltip, attrInfo); 48 } 49 50 /** 51 * @return A new {@link UiManifestPkgAttrNode} linked to this descriptor. 52 */ 53 @Override 54 public UiAttributeNode createUiNode(UiElementNode uiParent) { 55 return new UiManifestPkgAttrNode(this, uiParent); 56 } 57 } 58