Example usage for com.vaadin.ui TabSheet.Tab isEnabled

List of usage examples for com.vaadin.ui TabSheet.Tab isEnabled

Introduction

In this page you can find the example usage for com.vaadin.ui TabSheet.Tab isEnabled.

Prototype

@Override
    public boolean isEnabled() 

Source Link

Usage

From source file:com.haulmont.cuba.web.gui.components.WebComponentsHelper.java

License:Apache License

/**
 * Tests if component enabled and visible and its container enabled.
 *
 * @param child component//  w w w .j  a  va  2 s  . com
 * @return component enabled state
 */
public static boolean isComponentEnabled(Component child) {
    if (child.getParent() instanceof TabSheet) {
        TabSheet tabSheet = (TabSheet) child.getParent();
        TabSheet.Tab tab = tabSheet.getTab(child);
        if (!tab.isEnabled()) {
            return false;
        }
    }

    return child.isEnabled() && (child.getParent() == null || isComponentEnabled(child.getParent()))
            && isComponentVisible(child);
}