diff --git a/plugins/android-designer/src/com/intellij/android/designer/icons/requestFocus.png b/plugins/android-designer/src/com/intellij/android/designer/icons/requestFocus.png new file mode 100644 index 000000000000..ed239d4b4f99 Binary files /dev/null and b/plugins/android-designer/src/com/intellij/android/designer/icons/requestFocus.png differ diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/ModelParser.java b/plugins/android-designer/src/com/intellij/android/designer/model/ModelParser.java index c0312cdf44ac..060aa7b71f82 100644 --- a/plugins/android-designer/src/com/intellij/android/designer/model/ModelParser.java +++ b/plugins/android-designer/src/com/intellij/android/designer/model/ModelParser.java @@ -377,12 +377,7 @@ public class ModelParser extends XmlRecursiveElementVisitor { public static void updateRootComponent(RadViewComponent rootComponent, RenderSession session, RootView nativeComponent) { - List views = session.getRootViews(); - List children = rootComponent.getChildren(); - int size = children.size(); - for (int i = 0; i < size; i++) { - updateComponent((RadViewComponent)children.get(i), views.get(i), nativeComponent, 0, 0); - } + updateChildren(rootComponent, session.getRootViews(), nativeComponent, 0, 0); rootComponent.setNativeComponent(nativeComponent); rootComponent.setBounds(0, 0, nativeComponent.getWidth(), nativeComponent.getHeight()); @@ -407,12 +402,18 @@ public class ModelParser extends XmlRecursiveElementVisitor { component.setBounds(left, top, Math.max(width, EMPTY_COMPONENT_SIZE), Math.max(height, EMPTY_COMPONENT_SIZE)); - List views = view.getChildren(); + updateChildren(component, view.getChildren(), nativeComponent, left, top); + } + + private static void updateChildren(RadViewComponent component, List views, RootView nativeComponent, int left, int top) { List children = component.getChildren(); int size = children.size(); - for (int i = 0; i < size; i++) { - updateComponent((RadViewComponent)children.get(i), views.get(i), nativeComponent, left, top); + for (int componentIndex = 0, viewIndex = 0; componentIndex < size; componentIndex++) { + RadViewComponent childComponent = (RadViewComponent)children.get(componentIndex); + if (!(childComponent instanceof RadRequestFocus)) { + updateComponent(childComponent, views.get(viewIndex++), nativeComponent, left, top); + } } } } \ No newline at end of file diff --git a/plugins/android-designer/src/com/intellij/android/designer/model/RadRequestFocus.java b/plugins/android-designer/src/com/intellij/android/designer/model/RadRequestFocus.java new file mode 100644 index 000000000000..16553e1f84b5 --- /dev/null +++ b/plugins/android-designer/src/com/intellij/android/designer/model/RadRequestFocus.java @@ -0,0 +1,34 @@ +/* + * 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; + +import com.intellij.designer.propertyTable.Property; + +import java.util.Collections; +import java.util.List; + +/** + * @author Alexander Lobas + */ +public class RadRequestFocus extends RadViewComponent { + public RadRequestFocus() { + super.setProperties(Collections.emptyList()); + } + + @Override + public void setProperties(List properties) { + } +} \ 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 ece7ef65ba27..5c36a1947d6a 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 @@ -19,6 +19,15 @@ + + + + + +