OSDN Git Service

android-2.1_r1 snapshot
[android-x86/sdk.git] / eclipse / plugins / com.android.ide.eclipse.adt / src / com / android / ide / eclipse / adt / internal / editors / resources / descriptors / ItemElementDescriptor.java
1 /*
2  * Copyright (C) 2008 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.resources.descriptors;
18
19 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
20 import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
21 import com.android.ide.eclipse.adt.internal.editors.resources.uimodel.UiItemElementNode;
22 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
23
24 /**
25  * {@link ItemElementDescriptor} is a special version of {@link ElementDescriptor} that
26  * uses a specialized {@link UiItemElementNode} for display.
27  */
28 public class ItemElementDescriptor extends ElementDescriptor {
29
30     /**
31      * Constructs a new {@link ItemElementDescriptor} based on its XML name, UI name,
32      * tooltip, SDK url, attributes list, children list and mandatory.
33      * 
34      * @param xml_name The XML element node name. Case sensitive.
35      * @param ui_name The XML element name for the user interface, typically capitalized.
36      * @param tooltip An optional tooltip. Can be null or empty.
37      * @param sdk_url An optional SKD URL. Can be null or empty.
38      * @param attributes The list of allowed attributes. Can be null or empty.
39      * @param children The list of allowed children. Can be null or empty.
40      * @param mandatory Whether this node must always exist (even for empty models). A mandatory
41      *  UI node is never deleted and it may lack an actual XML node attached. A non-mandatory
42      *  UI node MUST have an XML node attached and it will cease to exist when the XML node
43      *  ceases to exist.
44      */
45     public ItemElementDescriptor(String xml_name, String ui_name,
46             String tooltip, String sdk_url, AttributeDescriptor[] attributes,
47             ElementDescriptor[] children, boolean mandatory) {
48         super(xml_name, ui_name, tooltip, sdk_url, attributes, children, mandatory);
49     }
50
51     @Override
52     public UiElementNode createUiNode() {
53         return new UiItemElementNode(this);
54     }
55 }