/** * Marks all visible connectors dirty, starting from the given connector and * going downwards in the hierarchy. * * @param c * The component to start iterating downwards from */ private void markConnectorsDirtyRecursively(ClientConnector c) { if (c instanceof Component && !((Component) c).isVisible()) { return; } markDirty(c); for (ClientConnector child : AbstractClientConnector .getAllChildrenIterable(c)) { markConnectorsDirtyRecursively(child); } }
if (!child.isVisible()) { return false;
@Override public boolean isVisible() throws MException { if (componentLabel != null && componentLabel.isVisible()) return true; if (componentError != null && componentError.isVisible()) return true; if (componentEditor != null && componentEditor.isVisible()) return true; if (componentWizard != null && componentWizard.isVisible()) return true; return false; }
/** * Returns visibility state of the filter field for the given column ID * * @param columnId * Column/Property ID of the filter field to query * @return true if filter is visible, false if it's hidden */ public boolean isFilterFieldVisible(Object columnId) { Component component = columnIdToFilterMap.get(columnId); if (component != null) { return component.isVisible(); } return false; }
/** * Returns visibility state of the filter field for the given column ID * * @param columnId * Column/Property ID of the filter field to query * @return true if filter is visible, false if it's hidden */ public boolean isFilterFieldVisible(Object columnId) { Component component = columnIdToFilterMap.get(columnId); if (component != null) { return component.isVisible(); } return false; }
@Override public boolean apply(Component component) { return component.isVisible(); } });
@Override public boolean isVisible() throws MException { return getComponent().isVisible(); } @Override
@Override public boolean isVisible() { return getComposition().isVisible(); }
@Override public boolean isVisible() { return getComposition().isVisible(); }
@Override public Iterator<Component> iterator() { Set<Component> children = new HashSet<Component>(); if (_visibleComponents != null) { children.addAll(_visibleComponents); } if (initDone && filtersVisible) { for (Object key : columnIdToFilterMap.keySet()) { Component filter = columnIdToFilterMap.get(key); if (equals(filter.getParent()) && filter.isVisible()) { children.add(filter); } } } return children.iterator(); }
protected void updateCompositionStylesTopPanelVisible() { if (topPanel != null) { boolean hasChildren = topPanel.getComponentCount() > 0; boolean anyChildVisible = false; for (com.vaadin.ui.Component childComponent : topPanel) { if (childComponent.isVisible()) { anyChildVisible = true; break; } } boolean topPanelVisible = hasChildren && anyChildVisible; if (!topPanelVisible) { componentComposition.removeStyleName(HAS_TOP_PANEL_STYLENAME); internalStyles.remove(HAS_TOP_PANEL_STYLENAME); } else { componentComposition.addStyleName(HAS_TOP_PANEL_STYLENAME); if (!internalStyles.contains(HAS_TOP_PANEL_STYLENAME)) { internalStyles.add(HAS_TOP_PANEL_STYLENAME); } } } }
protected void updateCompositionStylesTopPanelVisible() { if (topPanel != null) { boolean hasChildren = topPanel.getComponentCount() > 0; boolean anyChildVisible = false; for (Component childComponent : topPanel) { if (childComponent.isVisible()) { anyChildVisible = true; break; } } boolean topPanelVisible = hasChildren && anyChildVisible; if (!topPanelVisible) { componentComposition.removeStyleName(HAS_TOP_PANEL_STYLE_NAME); internalStyles.remove(HAS_TOP_PANEL_STYLE_NAME); } else { componentComposition.addStyleName(HAS_TOP_PANEL_STYLE_NAME); if (!internalStyles.contains(HAS_TOP_PANEL_STYLE_NAME)) { internalStyles.add(HAS_TOP_PANEL_STYLE_NAME); } } } }
protected void updateCompositionStylesTopPanelVisible() { if (topPanel != null) { boolean hasChildren = topPanel.getComponentCount() > 0; boolean anyChildVisible = false; for (Component childComponent : topPanel) { if (childComponent.isVisible()) { anyChildVisible = true; break; } } boolean topPanelVisible = hasChildren && anyChildVisible; if (!topPanelVisible) { componentComposition.removeStyleName(HAS_TOP_PANEL_STYLENAME); internalStyles.remove(HAS_TOP_PANEL_STYLENAME); } else { componentComposition.addStyleName(HAS_TOP_PANEL_STYLENAME); if (!internalStyles.contains(HAS_TOP_PANEL_STYLENAME)) { internalStyles.add(HAS_TOP_PANEL_STYLENAME); } } } }
@Override public void setContent(Component content) { final Component currentContent = super.getContent(); if (currentContent != null) { content.setVisible(currentContent.isVisible()); } super.setContent(content); }
@Override public void setVisible(boolean visible) throws MException { if (componentLabel != null) componentLabel.setVisible(visible); if (componentError != null && componentError.isVisible()) componentError.setVisible(visible); if (componentEditor != null) componentEditor.setVisible(visible); if (componentWizard != null) componentWizard.setVisible(visible); }
/** * Checks if the component should be visible to the client. Returns false if * the child should not be sent to the client, true otherwise. * * @param child The child to check * @return true if the child is visible to the client, false otherwise */ public static boolean isComponentVisibleToClient(Component child) { if (!child.isVisible()) { return false; } HasComponents parent = child.getParent(); if (parent instanceof SelectiveRenderer) { if (!((SelectiveRenderer) parent).isRendered(child)) { return false; } } if (parent != null) { return isComponentVisibleToClient(parent); } else { if (child instanceof UI) { // UI has no parent and visibility was checked above return true; } else { // Component which is not attached to any UI return false; } } }
/** * Tests if component visible and its container visible. * * @param child component * @return component visibility */ public static boolean isComponentVisible(Component child) { if (child.getParent() instanceof TabSheet) { TabSheet tabSheet = (TabSheet) child.getParent(); TabSheet.Tab tab = tabSheet.getTab(child); if (!tab.isVisible()) { return false; } } if (child.getParent() instanceof CubaGroupBox) { // ignore groupbox content container visibility return isComponentVisible(child.getParent()); } return child.isVisible() && (child.getParent() == null || isComponentVisible(child.getParent())); }