List of usage examples for com.vaadin.ui ComponentContainer getComponentCount
public int getComponentCount();
From source file:com.esofthead.mycollab.module.project.view.bug.components.BugRowComponent.java
License:Open Source License
private void deleteBug() { IGroupComponent root = UIUtils.getRoot(this, IGroupComponent.class); ComponentContainer parent = (ComponentContainer) this.getParent(); if (parent != null) { parent.removeComponent(this); if (root != null) { ComponentContainer parentRoot = (ComponentContainer) root.getParent(); if (parentRoot != null && parent.getComponentCount() == 0) { parentRoot.removeComponent(root); }//from www . j a v a 2 s .com } } }
From source file:com.esofthead.mycollab.module.project.view.task.components.TaskRowRenderer.java
License:Open Source License
private void deleteTask() { IGroupComponent root = UIUtils.getRoot(this, IGroupComponent.class); ComponentContainer parent = (ComponentContainer) this.getParent(); if (parent != null) { parent.removeComponent(this); if (root != null) { ComponentContainer parentRoot = (ComponentContainer) root.getParent(); if (parentRoot != null && parent.getComponentCount() == 0) { parentRoot.removeComponent(root); }/*from www . ja v a 2 s .c om*/ } } }
From source file:com.haulmont.cuba.web.gui.components.WebRelatedEntities.java
License:Apache License
protected void refreshNavigationActions() { ComponentContainer actionContainer = (ComponentContainer) vPopupComponent; actionContainer.removeAllComponents(); actionOrder.clear();// w w w.j a v a2s. c o m if (listComponent != null) { MetaClass metaClass = listComponent.getDatasource().getMetaClass(); Pattern excludePattern = null; if (excludeRegex != null) { excludePattern = Pattern.compile(excludeRegex); } for (MetaProperty metaProperty : metaClass.getProperties()) { if (RelatedEntitiesSecurity.isSuitableProperty(metaProperty, metaClass) && (excludePattern == null || !excludePattern.matcher(metaProperty.getName()).matches())) { addNavigationAction(metaClass, metaProperty); } } if (actionContainer.getComponentCount() == 0) { Messages messages = AppBeans.get(Messages.NAME); actionContainer.addComponent(new Label(messages.getMainMessage("actions.Related.Empty"))); } } }