Search in sources :

Example 6 with ContainerList

use of com.codename1.ui.list.ContainerList in project CodenameOne by codenameone.

the class ComponentTreeModel method getIndexOfChild.

public int getIndexOfChild(Object parent, Object child) {
    Component cmp = (Component) parent;
    Component chd = (Component) child;
    if (cmp instanceof List || cmp instanceof ContainerList) {
        if (chd.hasFocus()) {
            return 1;
        }
        return 0;
    }
    if (cmp instanceof Container) {
        return ((Container) cmp).getComponentIndex(chd);
    }
    return -1;
}
Also used : Container(com.codename1.ui.Container) ContainerList(com.codename1.ui.list.ContainerList) ContainerList(com.codename1.ui.list.ContainerList) List(com.codename1.ui.List) Component(com.codename1.ui.Component)

Aggregations

List (com.codename1.ui.List)4 ContainerList (com.codename1.ui.list.ContainerList)4 Component (com.codename1.ui.Component)3 Container (com.codename1.ui.Container)3 Form (com.codename1.ui.Form)3 Button (com.codename1.ui.Button)2 CheckBox (com.codename1.ui.CheckBox)2 Dialog (com.codename1.ui.Dialog)2 Label (com.codename1.ui.Label)2 RadioButton (com.codename1.ui.RadioButton)2 Slider (com.codename1.ui.Slider)2 Tabs (com.codename1.ui.Tabs)2 TextArea (com.codename1.ui.TextArea)2 BorderLayout (com.codename1.ui.layouts.BorderLayout)2 BoxLayout (com.codename1.ui.layouts.BoxLayout)2 FlowLayout (com.codename1.ui.layouts.FlowLayout)2 GridLayout (com.codename1.ui.layouts.GridLayout)2 LayeredLayout (com.codename1.ui.layouts.LayeredLayout)2 Layout (com.codename1.ui.layouts.Layout)2 DefaultListModel (com.codename1.ui.list.DefaultListModel)2