List of usage examples for com.vaadin.ui HorizontalLayout removeAllComponents
@Override public void removeAllComponents()
From source file:pt.ist.vaadinframework.ui.PaginatedSorterViewer.java
License:Open Source License
public void setSorter(Alignment position, Object[] sorterIds, boolean[] initialAscending, String[] sorterLabels) {// w w w . ja v a 2 s .com HorizontalLayout controls = new HorizontalLayout(); controls.setSpacing(true); if (sorterIds.length > 0) { controls.setVisible(true); controls.addComponent(new Label(VaadinResources.getString(COMMONS_SORTBY_LABEL) + ":")); currentSorter = new SorterControl(sorterIds[0], initialAscending[0], sorterLabels[0]); controls.addComponent(currentSorter); for (int i = 1; i < sorterIds.length; i++) { controls.addComponent(new Label("|")); controls.addComponent(new SorterControl(sorterIds[i], initialAscending[i], sorterLabels[i])); } } else { controls.removeAllComponents(); controls.setVisible(false); } addControls(controls, position); }
From source file:pt.ist.vaadinframework.ui.PaginatedSorterViewer.java
License:Open Source License
public void setFilter(Alignment position, Object[] filterIds, String[] filterLabels) { HorizontalLayout controls = new HorizontalLayout(); controls.setSpacing(true);//from ww w.j a v a 2 s . com if (filterIds.length > 0) { controls.setVisible(true); controls.addComponent(new Label(VaadinResources.getString(COMMONS_FILTERBY_LABEL) + ":")); for (int i = 0; i < filterIds.length; i++) { controls.addComponent(new FilterControl(filterIds[i], filterLabels[i])); } } else { controls.removeAllComponents(); controls.setVisible(false); } addControls(controls, position); }
From source file:ro.zg.netcell.vaadin.action.application.OpenSelectedEntityHandler.java
License:Apache License
private void refreshHeaderActionLinks(Entity entity, OpenGroupsApplication app, ActionContext ac) { // UserActionList headerActions = getAvailableActions(entity, // ActionLocations.HEADER); // if (headerActions != null && headerActions.getActions() != null) { // HorizontalLayout actionsContainer = (HorizontalLayout) // entity.getHeaderActionLinksContainer(); // actionsContainer.removeAllComponents(); // for (final UserAction ha : headerActions.getActions().values()) { // Button actButton = getButtonForAction(ha, entity, app); // actionsContainer.addComponent(actButton); // }/*from w ww . ja v a2s . c om*/ // } UserActionList headerActions = getAvailableActions(entity, ActionLocations.HEADER); boolean allowRefresh = app.getAppConfigManager().getComplexEntityBooleanParam(entity.getComplexType(), ComplexEntityParam.ALLOW_REFRESH); boolean hasHeaderActions = headerActions != null && headerActions.getActions() != null; if (allowRefresh || hasHeaderActions) { HorizontalLayout actionsContainer = (HorizontalLayout) entity.getHeaderActionLinksContainer(); actionsContainer.removeAllComponents(); /* add refresh button */ if (allowRefresh) { actionsContainer.addComponent(getRefreshButton(entity, app, ac)); } if (hasHeaderActions) { for (final UserAction ha : headerActions.getActions().values()) { Button actButton = getButtonForAction(ha, entity, app, ac); actionsContainer.addComponent(actButton); } } } }