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); } } } }
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); } } } }
TextField t2 = null; for (int i=0; i< ((HorizontalLayout) o1).getComponentCount() ; i++) for (int i=0; i< ((HorizontalLayout) o2).getComponentCount() ; i++)
/** * Saves the changed apps setting.<p> */ void saveToUser() { List<String> apps = new ArrayList<String>(); HorizontalLayout appsLayout = m_userApps.getWrappedLayout(); int count = appsLayout.getComponentCount(); for (int i = 0; i < count; i++) { WrappedDraggableComponent wrapper = (WrappedDraggableComponent)appsLayout.getComponent(i); apps.add(wrapper.getItemId()); } try { OpenCms.getWorkplaceAppManager().setUserQuickLaunchApps(A_CmsUI.getCmsObject(), apps); } catch (CmsException e) { CmsErrorDialog.showErrorDialog("Could not write user Quicklaunch apps", e); } close(); } }
/** * Sets a component as content to the message dialog. * * @param messageComponent The component as content * @return The {@link MessageBox} instance itself */ public MessageBox withMessage(Component messageComponent) { if (this.messageComponent != null) { contentLayout.removeComponent(this.messageComponent); } this.messageComponent = messageComponent; if (messageComponent != null) { messageComponent.setSizeFull(); contentLayout.addComponent(messageComponent, contentLayout.getComponentCount()); contentLayout.setExpandRatio(messageComponent, 1.0f); contentLayout.setComponentAlignment(messageComponent, Alignment.MIDDLE_CENTER); } return this; }
@Override public void graphChanged(GraphContainer graphContainer) { final BreadcrumbCriteria criteria = Criteria.getSingleCriteriaForGraphContainer(graphContainer, BreadcrumbCriteria.class, true); final HorizontalLayout breadcrumbLayout = (HorizontalLayout) getCompositionRoot(); breadcrumbLayout.removeAllComponents(); // Verify that breadcrumbs are enabled if (graphContainer.getTopologyServiceClient().getBreadcrumbStrategy() == BreadcrumbStrategy.SHORTEST_PATH_TO_ROOT) { final Collection<Vertex> displayVertices = graphContainer.getGraph().getDisplayVertices(); if (!displayVertices.isEmpty()) { final PathTree pathTree = BreadcrumbPathCalculator.findPath(graphContainer.getTopologyServiceClient(), displayVertices.stream().map(v -> (VertexRef) v).collect(Collectors.toSet())); final List<Breadcrumb> breadcrumbs = pathTree.toBreadcrumbs(); criteria.setBreadcrumbs(breadcrumbs); } for (Breadcrumb eachBreadcrumb : criteria.getBreadcrumbs()) { if (breadcrumbLayout.getComponentCount() >= 1) { breadcrumbLayout.addComponent(new Label(" > ")); } breadcrumbLayout.addComponent(createButton(graphContainer, eachBreadcrumb)); } } }
/** * Shows the dialog. */ public void open() { // Ensure, that the dialog has at least one button if (!buttonAdded && BUTTON_ADD_CLOSE_PER_DEFAULT) { withCloseButton(); } // Apply some layouting options to the buttons for (int i = 0; i < buttonLayout.getComponentCount(); i++) { Component c = buttonLayout.getComponent(i); if (buttonWidth != null && c instanceof Button) { Button b = (Button) c; b.setWidth(buttonWidth); } buttonLayout.setComponentAlignment(c, Alignment.MIDDLE_CENTER); } // Add window to the UI if (DIALOG_DEFAULT_TRANSITION_LISTENER == null || (DIALOG_DEFAULT_TRANSITION_LISTENER != null && DIALOG_DEFAULT_TRANSITION_LISTENER.show(this))) { UI.getCurrent().addWindow(window); } immutable = true; }
for(int j=0; j<((HorizontalLayout) layout.getComponent(i)).getComponentCount(); j++) for(int j=0; j<((HorizontalLayout) layout.getComponent(i)).getComponentCount(); j++)
public static HorizontalLayout horizontalLayout(Alignment alignment, com.vaadin.ui.Component... components) { HorizontalLayout hl = new HorizontalLayout(); hl.setWidth(100, Sizeable.UNITS_PERCENTAGE); hl.setSpacing(true); if (components != null && components.length > 0) { for (com.vaadin.ui.Component c : components) { hl.addComponent(c); hl.setComponentAlignment(c, alignment); } if (alignment.isRight()) { hl.setExpandRatio(hl.getComponent(0), 1.0f); } else if (alignment.isLeft()) { hl.setExpandRatio(hl.getComponent(hl.getComponentCount() - 1), 1.0f); } } return hl; }
for (int i = m_itemsLeft.getComponentCount() - 1; i > -1; i--) { Component comp = m_itemsLeft.getComponent(i); if (!isAlwaysShow(comp)) { mainPV.addComponent(m_leftButtons, 0); for (int i = m_itemsRight.getComponentCount() - 1; i > -1; i--) { Component comp = m_itemsRight.getComponent(i); if (!isAlwaysShow(comp)) {