Example usage for com.vaadin.ui Component getParent

List of usage examples for com.vaadin.ui Component getParent

Introduction

In this page you can find the example usage for com.vaadin.ui Component getParent.

Prototype

@Override
public HasComponents getParent();

Source Link

Document

Gets the parent component of the component.

Usage

From source file:org.vaadin.jefferson.Composite.java

License:Open Source License

void update(Component oldPresentation, Component newPresentation) {
    P ownPresentation = getPresentation();
    if (ownPresentation != null) {
        if (oldPresentation != null && oldPresentation.getParent() == ownPresentation) {
            if (newPresentation != null) {
                ownPresentation.replaceComponent(oldPresentation, newPresentation);
            } else {
                ownPresentation.removeComponent(oldPresentation);
            }/*from   w ww  .  ja v a 2s  .c  o m*/
        } else if (newPresentation != null) {
            ownPresentation.addComponent(newPresentation);
        }
    }
}

From source file:org.vaadin.jefferson.Presenter.java

License:Open Source License

/**
 * Convenience method for setting the rendition's expand ratio to 1.
 * /*from www . j a  va  2 s. c o m*/
 * @see AbstractOrderedLayout#setExpandRatio(Component, float)
 */
protected static void expand(Component rendition) {
    Component parentRendition = rendition.getParent();
    if (parentRendition instanceof AbstractOrderedLayout) {
        ((AbstractOrderedLayout) parentRendition).setExpandRatio(rendition, 1);
    }
}

From source file:ru.codeinside.gses.webui.form.GridForm.java

License:Mozilla Public License

static GridForm getGridForm(Button.ClickEvent event) {
    Component c = event.getButton().getParent();
    while (!(c instanceof GridForm)) {
        c = c.getParent();
    }//  w  ww . ja  v  a  2 s.  c o m
    return (GridForm) c;
}

From source file:ru.codeinside.gses.webui.form.ValuesExtractor.java

License:Mozilla Public License

private boolean formIsParent(Component com) {
    if (form instanceof GridForm) {
        while (com != null) {
            if (com == form.getLayout()) {
                return true;
            }/*from   w w w  .jav  a  2 s .c  om*/
            com = com.getParent();
        }
    } else {
        return true;
    }
    return false;
}

From source file:ru.codeinside.gses.webui.form.ValuesExtractor.java

License:Mozilla Public License

private boolean isFormless(Component component) {
    Component parent = component.getParent();
    while (parent != null) {
        if (parent instanceof Form) {
            return false;
        }/*from   www.  j av  a  2 s.  c  o  m*/
        component = parent;
        parent = component.getParent();
    }
    return false;
}