1 /*
2  * Copyright (C) 2010 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.descriptors;
18 
19 import com.android.SdkConstants;
20 import com.android.ide.common.api.IAttributeInfo;
21 
22 
23 /**
24  * The {@link ITextAttributeCreator} interface is used by the appendAttribute(...) in
25  * {@link DescriptorsUtils} to allows callers to override the kind of
26  * {@link TextAttributeDescriptor} created for a given XML attribute name.
27  * <p/>
28  * The <code>create()</code> method must take arguments that are similar to the
29  * single constructor for {@link TextAttributeDescriptor}.
30  */
31 public interface ITextAttributeCreator {
32 
33     /**
34      * Creates a new {@link TextAttributeDescriptor} instance for the given XML name,
35      * UI name and tooltip.
36      *
37      * @param xmlLocalName The XML name of the attribute (case sensitive)
38      * @param nsUri The URI of the attribute. Can be null if attribute has no namespace.
39      *              See {@link SdkConstants#NS_RESOURCES} for a common value.
40      * @param attrInfo The {@link IAttributeInfo} of this attribute. Can't be null.
41      * @return A new {@link TextAttributeDescriptor} (or derived) instance.
42      */
create( String xmlLocalName, String nsUri, IAttributeInfo attrInfo)43     public TextAttributeDescriptor create(
44             String xmlLocalName,
45             String nsUri,
46             IAttributeInfo attrInfo);
47 }
48