2 * Copyright (C) 2008 The Android Open Source Project
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
8 * http://www.eclipse.org/org/documents/epl-v10.php
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.
17 package com.android.ide.eclipse.adt.internal.editors.resources.descriptors;
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;
25 * {@link ItemElementDescriptor} is a special version of {@link ElementDescriptor} that
26 * uses a specialized {@link UiItemElementNode} for display.
28 public class ItemElementDescriptor extends ElementDescriptor {
31 * Constructs a new {@link ItemElementDescriptor} based on its XML name, UI name,
32 * tooltip, SDK url, attributes list, children list and mandatory.
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
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);
52 public UiElementNode createUiNode() {
53 return new UiItemElementNode(this);