@Override public void addComponents(Component... components) { for (Component c : components) { addComponent(c); } }
@Override public void moveComponentsFrom(ComponentContainer source) { final LinkedList<Component> components = new LinkedList<>(); for (final Iterator<Component> i = source.getComponentIterator(); i .hasNext();) { components.add(i.next()); } for (final Component c : components) { source.removeComponent(c); addComponent(c); } }
super.addComponent(tabComponent);
/** * Sets the second component of this split panel. Depending on the direction * the second component is shown at the bottom or to the right. * * @param c * The component to use as second component */ public void setSecondComponent(Component c) { if (getSecondComponent() == c) { // Nothing to do return; } if (getSecondComponent() != null) { // detach old removeComponent(getSecondComponent()); } getState().secondChild = c; if (c != null) { super.addComponent(c); } }
/** * Sets the first component of this split panel. Depending on the direction * the first component is shown at the top or to the left. * * @param c * The component to use as first component */ public void setFirstComponent(Component c) { if (getFirstComponent() == c) { // Nothing to do return; } if (getFirstComponent() != null) { // detach old removeComponent(getFirstComponent()); } getState().firstChild = c; if (c != null) { super.addComponent(c); } }
@Override public void addComponent(Component c) { if ((!(c instanceof AbstractLeafletLayer)) && (!(c instanceof LLayerGroup))) { throw new IllegalArgumentException( "only instances of AbstractLeafletLayer or LLayerGroup allowed"); } super.addComponent(c); components.add(c); markAsDirty(); }
/** * Constructs a {@link TabBarView} that is 100% wide and high. */ public TabBarView() { super(); setSizeFull(); super.addComponent(toolbar); }
@Override public void addComponent(Component c) { // Check first if this is the same as the currently shown, eliminates flicker if (children.isEmpty() || children.getLast() != c) { super.addComponent(c); if (children.contains(c)) { children.remove(c); } children.addLast(c); markAsDirty(); } }
@Override public void addComponent(Component c) { if (!(c instanceof LeafletLayer)) { throw new IllegalArgumentException( "only instances of LeafletLayer (AbstractLeafletLayer or LLayerGroup) allowed"); } super.addComponent(c); components.add(c); markAsDirty(); // ?? is this really needed }
/** * Sets the toolbar component, usually a {@link Toolbar}. If a previous * toolbar is set, it is removed from the layout and forgotten. * * @param toolbar * The component to put in the toolbar slot. */ public void setToolbar(Component toolbar) { if (this.toolbar != null && this.toolbar != toolbar) { super.removeComponent(this.toolbar); } this.toolbar = toolbar; if (toolbar != null) { super.addComponent(toolbar); } }
public void addComponent(Component component, int index) { if (children.contains(component)) { if (children.indexOf(component) != index) { children.remove(component); children.add(index, component); markAsDirty(); } } else { children.add(index, component); super.addComponent(component); } markAsDirty(); }
@Override public void replaceComponent(Component oldComponent, Component newComponent) { int index = children.indexOf(oldComponent); if (index != -1) { children.remove(index); children.add(index, newComponent); super.removeComponent(oldComponent); super.addComponent(newComponent); markAsDirty(); } }
@Override public void buildAndBind(AbstractComponentContainer panel, String[] fields, BeanItem<? extends ValidationObject> itemDataSource) { Map<String,Field<?>> fieldList = buildAndBind(Arrays.asList(fields),itemDataSource); panel.removeAllComponents(); for (Field<?> f: fieldList.values()) { panel.addComponent(f); } } /* (non-Javadoc)
@Override public void buildAndBind(AbstractComponentContainer panel, List<String> fields, BeanItem<? extends ValidationObject> itemDataSource) { Map<String,Field<?>> fieldList = buildAndBind(fields,itemDataSource); panel.removeAllComponents(); for (Field<?> f: fieldList.values()) { panel.addComponent(f); } } @Override
/** * Constructs a NavigationView with the given caption and content. * * @param caption * the caption * @param content * the content */ public NavigationView(String caption, Component content) { registerRpc(rpc); mainComponent = content; super.addComponent(getContent()); super.addComponent(getNavigationBar()); setCaption(caption); }
protected void doAddTab(final MagnoliaTab tab) { super.addComponent(tab); tabs.add(tab); if (getState().activeTab == null) { setActiveTab(tab); } else { updateTabContentVisibility(); } }
/** * Sets the contents of an info window to a single Vaadin component which may, * of course, be a layout. * * @param window the info window which contents should be modified * @param content the contents for the info window */ public void setInfoWindowContents(GoogleMapInfoWindow window, Component content) { super.addComponent(content); infoWindowContents.put(window, content); String contentIdentifier = "content-for-infowindow-" + window.getId(); content.addStyleName(contentIdentifier); window.setContent("Loading..."); getState().infoWindowContentIdentifiers .put(window.getId(), contentIdentifier); }
/** * Sets the main content of the NavigationView. If null, an empty * {@link CssLayout} will be used. * * @param c * the component to set as the content */ public void setContent(Component c) { if (mainComponent == c) { return; } if (mainComponent != null) { super.removeComponent(mainComponent); } if (c == null) { c = new CssLayout(); } super.addComponent(c); mainComponent = c; markAsDirty(); }
protected void setContent(AbstractComponent c) { AbstractComponentContainer x = (AbstractComponentContainer) content.getContent(); if (x == null) { x = new VerticalLayout(); content.setContent(x); } x.removeAllComponents(); x.addComponent(c); }
/** * Sets the component in the right slot. * * @param c * the component to put in the right slot. */ public void setRightComponent(Component c) { if (navigationBarComponent != null) { super.removeComponent(navigationBarComponent); } if (c != null) { super.addComponent(c); } getState().setRightComponent(c); navigationBarComponent = c; markAsDirty(); }