private int getGroupsWithoutToBeContinuedLabel(final int amountOfRolloutGroups) { if (amountOfRolloutGroups < groupsLegend.getComponentCount()) { return groupsLegend.getComponentCount(); } return groupsLegend.getComponentCount() - 1; }
private int getGroupsWithoutToBeContinuedLabel(final int amountOfRolloutGroups) { if (amountOfRolloutGroups < groupsLegend.getComponentCount()) { return groupsLegend.getComponentCount(); } return groupsLegend.getComponentCount() - 1; }
private boolean hasLessGroupsToShowAsLimit(final List<?> listOfTargetCountPerGroup) { return groupsLegend.getComponentCount() > listOfTargetCountPerGroup.size(); }
private boolean hasLessGroupsToShowAsLimit(final List<?> listOfTargetCountPerGroup) { return groupsLegend.getComponentCount() > listOfTargetCountPerGroup.size(); }
@Override public int calculateHeight(){ return (((VerticalLayout)getContent()).getComponentCount() * (rowHeight + 5) + 15); } }
/** * Removes the event panel. * * @param layout the layout */ private void removeEventPanel(final VerticalLayout layout) { if (layout.getComponentCount() > 1) layout.removeComponent(layout.getComponent(1)); }
/** * Scroll into view. */ private void scrollIntoView() { final VerticalLayout layout = (VerticalLayout) getContent(); if (getUI() != null && layout.getComponentCount() > 0) getUI().scrollIntoView(layout.getComponent(layout.getComponentCount() - 1)); }
/** * Resets the display of the legend and total targets. */ public void reset() { totalTargetsLabel.setVisible(false); populateGroupsLegendByTargetCounts(Collections.emptyList()); if (groupsLegend.getComponentCount() > MAX_GROUPS_TO_BE_DISPLAYED) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(false); } }
/** * Resets the display of the legend and total targets. */ public void reset() { totalTargetsLabel.setVisible(false); populateGroupsLegendByTargetCounts(Collections.emptyList()); if (groupsLegend.getComponentCount() > MAX_GROUPS_TO_BE_DISPLAYED) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(false); } }
private void onMove(VerticalLayout root, VerticalLayout formLayout, MoveDirection moveDirection) { int currentPosition = root.getComponentIndex(formLayout); int newPosition = moveDirection == MoveDirection.UP ? currentPosition - 1 : currentPosition + 1; if (currentPosition == 0 && moveDirection.equals(MoveDirection.UP)) { return; } if (newPosition >= root.getComponentCount() - 1) { return; } Collections.swap(formOrder, currentPosition, newPosition); root.replaceComponent(root.getComponent(currentPosition), root.getComponent(newPosition)); }
TextField t2 = null; for (int i=0; i< ((VerticalLayout) o1).getComponentCount() ; i++) for (int i=0; i< ((VerticalLayout) o2).getComponentCount() ; i++)
private void showOrHideToBeContinueLabel(final List<?> listOfTargetCountPerGroup) { if (hasMoreGroupsToShowAsLimit(listOfTargetCountPerGroup)) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(true); } else if (hasLessGroupsToShowAsLimit(listOfTargetCountPerGroup)) { groupsLegend.getComponent(groupsLegend.getComponentCount() - 1).setVisible(false); } }
private void showOrHideToBeContinueLabel(final List<?> listOfTargetCountPerGroup) { if (hasMoreGroupsToShowAsLimit(listOfTargetCountPerGroup)) { groupsLegend.getComponent(MAX_GROUPS_TO_BE_DISPLAYED).setVisible(true); } else if (hasLessGroupsToShowAsLimit(listOfTargetCountPerGroup)) { groupsLegend.getComponent(groupsLegend.getComponentCount() - 1).setVisible(false); } }
/** * Places the buttons formerly moved to the sub menu back into the toolbar.<p> */ private void unfoldButtons() { m_itemsRight.removeComponent(m_foldedButtonsMenu); while (m_leftButtons.getComponentCount() > 0) { Component comp = m_leftButtons.getComponent(0); if (!isAlwaysShow(comp)) { m_leftButtons.removeComponent(comp); m_itemsLeft.addComponent(comp); } } int index = 0; while (m_rightButtons.getComponentCount() > 0) { Component comp = m_rightButtons.getComponent(0); m_rightButtons.removeComponent(comp); m_itemsRight.addComponent(comp, index); index++; } m_buttonsFolded = false; markAsDirtyRecursive(); } }
final long unassigned = validation.getTotalTargets() - validation.getTargetsInGroups(); final int labelsToUpdate = (unassigned > 0) ? (getGroupsWithoutToBeContinuedLabel(groups.size()) - 1) : groupsLegend.getComponentCount(); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i);
final long unassigned = validation.getTotalTargets() - validation.getTargetsInGroups(); final int labelsToUpdate = (unassigned > 0) ? (getGroupsWithoutToBeContinuedLabel(groups.size()) - 1) : groupsLegend.getComponentCount(); for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) { final Component component = groupsLegend.getComponent(i);
@Override public void showCustomPopupActions(List<Action> actions) { VerticalLayout customContextMenu = new VerticalLayout(); customContextMenu.setMargin(false); customContextMenu.setSpacing(false); customContextMenu.setWidthUndefined(); customContextMenu.setStyleName("c-cm-container"); for (Action action : actions) { CubaButton contextMenuButton = createContextMenuButton(); initContextMenuButton(contextMenuButton, action); customContextMenu.addComponent(contextMenuButton); } if (customContextMenu.getComponentCount() > 0) { component.showCustomPopup(customContextMenu); component.setCustomPopupAutoClose(true); } }
VerticalLayout layout = property.getValue(); for(int i=0; i<layout.getComponentCount(); i++) layout = targetProperty.getValue(); for(int i=0; i<layout.getComponentCount(); i++)
private EditorView<T> addSubForm(VerticalLayout parent, ItemProviderStrategy<T> itemProvider) { // create subform MultiFormDefinition<T> multiFormDefinitionClone = MutableWrapper.wrap(definition); FormDefinitionMutator.accessMutable(multiFormDefinitionClone.getForm()) .setName(getSubFormName(multiFormDefinitionClone)); if (itemProvider == null) { itemProvider = () -> multiFormItemProvider.read().map(t -> orderHandler.getOrCreate(t, multiFormDefinitionClone.getForm().getName(), locale)); } EditorView<T> subForm = getViewProvider().create(multiFormDefinitionClone.getForm(), itemProvider); forms.put(subForm, itemProvider); formOrder.add(subForm); // setup buttons, listeners and layout VerticalLayout wrapLayout = new VerticalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.addComponents( new Button(MagnoliaIcons.ARROW2_N, e -> onMove(parent, wrapLayout, MoveDirection.UP)), new Button(MagnoliaIcons.ARROW2_S, e -> onMove(parent, wrapLayout, MoveDirection.DOWN)), new Button(MagnoliaIcons.TRASH, e -> onDelete(parent, subForm))); buttonLayout.forEach(button -> button.addStyleName(ResurfaceTheme.BUTTON_ICON)); wrapLayout.addComponents(subForm.asVaadinComponent(), buttonLayout); parent.addComponent(wrapLayout, parent.getComponentCount() - 1); return subForm; }
if (m_leftButtons.getComponentCount() == 0) { mainPV.removeComponent(m_leftButtons); } else { if (m_rightButtons.getComponentCount() == 0) { mainPV.removeComponent(m_rightButtons); } else {