Example usage for com.vaadin.ui Component markAsDirty

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

Introduction

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

Prototype

public void markAsDirty();

Source Link

Document

Marks that this connector's state might have changed.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.CubaWidgetsTree.java

License:Apache License

protected void refreshRenderedComponents() {
    detachGeneratedComponents();//from   w  ww .  j  a  va 2s. com

    nodeWidgets.clear();
    itemIds.clear();

    if (widgetBuilder != null) {
        // Iterates through hierarchical tree using a stack of iterators
        final Stack<Iterator<?>> iteratorStack = new Stack<>();
        Collection<?> ids = rootItemIds();

        if (ids != null) {
            iteratorStack.push(ids.iterator());
        }

        while (!iteratorStack.isEmpty()) {

            // Gets the iterator for current tree level
            final Iterator<?> i = iteratorStack.peek();

            // If the level is finished, back to previous tree level
            if (!i.hasNext()) {

                // Removes used iterator from the stack
                iteratorStack.pop();
            } else {
                final Object itemId = i.next();

                itemIds.add(itemId);

                Component c = widgetBuilder.buildWidget(this, itemId, areChildrenAllowed(itemId));
                c.setParent(this);
                c.markAsDirty();

                nodeWidgets.add(c);

                if (hasChildren(itemId) && areChildrenAllowed(itemId)) {
                    iteratorStack.push(getChildren(itemId).iterator());
                }
            }
        }
    }
}

From source file:org.semanticsoft.vaaclipse.presentation.renderers.TrimBarRenderer.java

License:Open Source License

@Override
public void removeChildGui(MUIElement child, MElementContainer<MUIElement> element) {
    if (!(child instanceof MTrimElement && (MElementContainer<?>) element instanceof MTrimBar))
        return;/*w ww  . j  a v a  2  s .c  om*/

    super.removeChildGui(child, element);

    Component trimWidget = (Component) element.getWidget();

    MTrimBar trimBar = (MTrimBar) (MElementContainer<?>) element;
    refreshVisibility(trimBar);

    trimWidget.markAsDirty();
}