Example usage for com.vaadin.ui AbstractOrderedLayout getComponent

List of usage examples for com.vaadin.ui AbstractOrderedLayout getComponent

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractOrderedLayout getComponent.

Prototype

public Component getComponent(int index) throws IndexOutOfBoundsException 

Source Link

Document

Returns the component at the given position.

Usage

From source file:edu.kit.dama.ui.admin.utils.UIComponentTools.java

License:Apache License

private static void setLockedComponents(AbstractOrderedLayout layout, boolean locked) {
    for (int i = 0; i < layout.getComponentCount(); i++) {
        if (layout.getComponent(i).getClass().equals(Button.class)) {
            layout.getComponent(i).setEnabled(!locked);
        } else if (layout.getComponent(i).getClass().equals(ComboBox.class)) {
            layout.getComponent(i).setEnabled(!locked);
            layout.getComponent(i).setReadOnly(locked);
        } else {//  w  w  w  .  j  av  a2s.co  m
            layout.getComponent(i).setReadOnly(locked);
        }
    }
}