*/
public final class LayoutDescriptors implements IDescriptorProvider {
+ /**
+ * The XML name of the special <include> layout tag.
+ * A synthetic element with that name is created as part of the view descriptors list
+ * returned by {@link #getViewDescriptors()}.
+ */
+ public static final String VIEW_INCLUDE = "include"; //$NON-NLS-1$
+
// Public attributes names, attributes descriptors and elements descriptors
public static final String ID_ATTR = "id"; //$NON-NLS-1$
* View descriptor and extract its layout attributes.
*/
private void insertInclude(ArrayList<ElementDescriptor> knownViews) {
- String xml_name = "include"; //$NON-NLS-1$
+ String xml_name = VIEW_INCLUDE;
// Create the include custom attributes
ArrayList<AttributeDescriptor> attributes = new ArrayList<AttributeDescriptor>();
package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
import org.eclipse.swt.SWT;
Toggle toggle = new Toggle(group, uiName);
for (ElementDescriptor desc : descriptors) {
+
+ // Exclude the <include> tag from the View palette.
+ // We don't have drop support for it right now, although someday we should.
+ if (LayoutDescriptors.VIEW_INCLUDE.equals(desc.getXmlName())) {
+ continue;
+ }
+
Item item = new Item(group, desc);
toggle.addItem(item);
GridData gd = new GridData();