GridLayout

This commit is contained in:
Alexander Lobas
2012-04-22 22:02:43 +04:00
parent f942b9ee61
commit f18ecfd87b
4 changed files with 99 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

@@ -0,0 +1,51 @@
/*
* 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.grid;
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 RadGridLayout extends RadViewLayoutWithData {
private static final String[] LAYOUT_PARAMS = {"GridLayout_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;
}
return null;
}
}
@@ -0,0 +1,24 @@
/*
* 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.grid;
import com.intellij.android.designer.model.RadViewContainer;
/**
* @author Alexander Lobas
*/
public class RadGridLayoutComponent extends RadViewContainer {
}
@@ -1137,6 +1137,29 @@
</creation>
</meta>
<meta model="com.intellij.android.designer.model.grid.RadGridLayoutComponent"
layout="com.intellij.android.designer.model.grid.RadGridLayout"
class="android.widget.GridLayout"
tag="GridLayout">
<properties important="orientation rowCount columnCount"
top="rowCount columnCount orientation"
expert="layout:gravity.clip_vertical layout:gravity.clip_horizontal"
/>
<palette title="GridLayout" icon="/com/intellij/android/designer/icons/GridLayout.png"
tooltip="A layout that places its children in a rectangular grid."/>
<creation>
<![CDATA[
<GridLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</GridLayout>
]]>
</creation>
</meta>
<!-- ================= Palette ================= -->
<palette>
@@ -1200,6 +1223,7 @@
<item tag="LinearLayout"/>
<item tag="TableLayout"/>
<item tag="TableRow"/>
<item tag="GridLayout"/>
</group>
</palette>