float expandRatio = getExpandRatio(oldComponent); removeComponent(oldComponent); addComponent(newComponent, oldLocation); applyLayoutSettings(newComponent, alignment, expandRatio);
/** * Adds a component into this container. The component is added to the left * or on top of the other components. * * @param c * the component to be added. */ public void addComponentAsFirst(Component c) { // If c is already in this, we must remove it before proceeding // see ticket #7668 if (equals(c.getParent())) { removeComponent(c); } components.addFirst(c); try { super.addComponent(c); } catch (IllegalArgumentException e) { components.remove(c); throw e; } componentAdded(c); }
/** * Adds a component into indexed position in this container. * * @param c * the component to be added. * @param index * the index of the component position. The components currently * in and after the position are shifted forwards. */ public void addComponent(Component c, int index) { // If c is already in this, we must remove it before proceeding // see ticket #7668 if (equals(c.getParent())) { // When c is removed, all components after it are shifted down if (index > getComponentIndex(c)) { index--; } removeComponent(c); } components.add(index, c); try { super.addComponent(c); } catch (IllegalArgumentException e) { components.remove(c); throw e; } componentAdded(c); }
@Override public void remove(Component childComponent) { component.removeComponent(WebComponentsHelper.getComposition(childComponent)); ownComponents.remove(childComponent); childComponent.setParent(null); }
@Override public void remove(Component childComponent) { getComponentContent().removeComponent(WebComponentsHelper.getComposition(childComponent)); ownComponents.remove(childComponent); childComponent.setParent(null); }
@Override public void remove(Component childComponent) { getContent().removeComponent(childComponent.unwrapComposition(com.vaadin.ui.Component.class)); ownComponents.remove(childComponent); childComponent.setParent(null); }
m_layout.removeComponent(sourceComponent);
layout.removeComponent(comp);
layout.removeComponent(comp);