Example usage for java.awt Container isEnabled

List of usage examples for java.awt Container isEnabled

Introduction

In this page you can find the example usage for java.awt Container isEnabled.

Prototype

public boolean isEnabled() 

Source Link

Document

Determines whether this component is enabled.

Usage

From source file:com.haulmont.cuba.desktop.gui.components.DesktopWindow.java

protected java.awt.Component getComponentToFocus(java.awt.Container component) {
    if (component.isFocusable() && component.isEnabled()
            && DesktopComponentsHelper.isRecursivelyVisible(component)) {
        if (component instanceof JComboBox || component instanceof JCheckBox || component instanceof JTable
                || component instanceof JTree) {
            return component;
        } else if (component instanceof JTextComponent && ((JTextComponent) component).isEditable()) {
            return component;
        }/*from  w  w  w .j av a2  s.co m*/
    }
    for (java.awt.Component child : component.getComponents()) {
        if (child instanceof JTabbedPane) {
            // #PL-3176
            // we don't know about selected tab after request
            // may be focused component lays on not selected tab
            continue;
        }
        if (child instanceof java.awt.Container) {
            java.awt.Component result = getComponentToFocus((java.awt.Container) child);
            if (result != null) {
                return result;
            }
        } else {
            return child;
        }
    }
    return null;
}