diff --git a/plugins/android-designer/src/com/intellij/android/designer/icons/RelativeLayout.png b/plugins/android-designer/src/com/intellij/android/designer/icons/RelativeLayout.png new file mode 100644 index 000000000000..f34d73694e73 Binary files /dev/null and b/plugins/android-designer/src/com/intellij/android/designer/icons/RelativeLayout.png differ diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadRelativeLayout.java b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadRelativeLayout.java new file mode 100644 index 000000000000..e7b9b80d8f39 --- /dev/null +++ b/plugins/android-designer/src/com/intellij/android/designer/model/layout/RadRelativeLayout.java @@ -0,0 +1,52 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.android.designer.model.layout; + +import com.intellij.android.designer.designSurface.TreeDropToOperation; +import com.intellij.android.designer.model.RadViewLayoutWithData; +import com.intellij.designer.componentTree.TreeEditOperation; +import com.intellij.designer.designSurface.EditOperation; +import com.intellij.designer.designSurface.OperationContext; +import org.jetbrains.annotations.NotNull; + +/** + * @author Alexander Lobas + */ +public class RadRelativeLayout extends RadViewLayoutWithData { + private static final String[] LAYOUT_PARAMS = {"RelativeLayout_Layout", "ViewGroup_MarginLayout"}; + + @NotNull + @Override + public String[] getLayoutParams() { + return LAYOUT_PARAMS; + } + + @Override + public EditOperation processChildOperation(OperationContext context) { + if (context.isCreate() || context.isPaste() || context.isAdd() || context.isMove()) { + if (context.isTree()) { + if (TreeEditOperation.isTarget(myContainer, context)) { + return new TreeDropToOperation(myContainer, context); + } + return null; + } + // XXX + return null; + } + // XXX + return null; + } +} \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml index a655f11ac2a6..04577878fb0b 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml +++ b/plugins/android-designer/src/com/intellij/android/designer/model/views-meta-model.xml @@ -1160,6 +1160,26 @@ + + + + + + + + + + ]]> + + + @@ -1169,6 +1189,7 @@ +