private PopupView buildCheckInPopupView() { attendeeInformationVerified = new CheckBox("Information Verified"); parentalConsentFormReceived = new CheckBox("Parental Consent Form Received"); btnInfoReceived = new Button("Save"); btnInfoReceived.setEnabled(false); VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true); layout.addComponent(attendeeInformationVerified); layout.addComponent(parentalConsentFormReceived); layout.addComponent(btnInfoReceived); attendeeInformationVerified.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent -> btnInfoReceived.setEnabled(validateCheckInFields())); parentalConsentFormReceived.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent -> btnInfoReceived.setEnabled(validateCheckInFields())); btnInfoReceived.addClickListener((Button.ClickListener) clickEvent -> attendeeInformationVerified()); return new PopupView(null, layout); }
@Override protected Component initContent() { entityContent = new PopupClientContent(); popupView = new PopupView(entityContent); popupView.setHideOnMouseOut(false); return popupView; }
private PopupView popupRowOnClick() { VerticalLayout popupContent = new VerticalLayout(); popupContent.setSizeFull(); PopupView popup = new PopupView(null, popupContent); grid.addItemClickListener(e -> { popup.setData(e.getItem()); popup.setPopupVisible(true); }); popup.addPopupVisibilityListener(event -> { if (event.isPopupVisible()) { popupContent.removeAllComponents(); PropertyItem item = (PropertyItem) popup.getData(); Label popupTitle = new Label("<h2>Property details</h2>", ContentMode.HTML); popupTitle.setSizeFull(); Button popupClose = new Button(VaadinIcons.CLOSE); popupClose.addClickListener(e -> popup.setPopupVisible(false)); HorizontalLayout title = new HorizontalLayout(popupTitle, popupClose); title.setSizeFull(); title.setExpandRatio(popupTitle, 3); title.setExpandRatio(popupClose, 1); title.setComponentAlignment(popupClose, Alignment.TOP_RIGHT); Label propertyKey= new Label(String.format("Key: '%s'", item.getKey()), ContentMode.TEXT); Label propertyValue = new Label(String.format("Value: '%s'", item.getValue()), ContentMode.TEXT); propertyValue.setSizeFull(); Label propertyOrigin = new Label(String.format("Origin: '%s'", item.getOrigin()), ContentMode.TEXT); popupContent.addComponents(title, propertyKey, propertyValue, propertyOrigin); } }); popup.setHideOnMouseOut(false); popup.setSizeFull(); return popup; }
public MVerticalLayout getWrapContent() { PopupView.Content content = getContent(); return (MVerticalLayout) content.getPopupComponent(); }
@Override protected Component initContent() { final PopupView popup = new PopupView(new PopupContent()); return popup; }
public void forceLinkagePopRepaint(){ registerLinkageListeners(); HorizontalLayout toolBar=new HorizontalLayout(); toolBar.setWidth("100%"); HorizontalLayout popupLayout = new HorizontalLayout(); linkage_one_panel = new PopupView("1st Linkage",popupLayout); if(field_linkage_position.isEnabled() || field_anomeric_carbon.isEnabled() || field_anomeric_state.isEnabled() || field_chirality.isEnabled() || field_ring_size.isEnabled()){ linkage_one_panel.setEnabled(true); }else{ linkage_one_panel.setEnabled(false); } popupLayout.addStyleName("1st_linkage_panel"); popupLayout.addComponent(field_anomeric_state); popupLayout.addComponent(field_anomeric_carbon); popupLayout.addComponent(field_linkage_position); popupLayout.addComponent(field_chirality); popupLayout.addComponent(field_ring_size); // boolean enabled=linkage_two_panel.isEnabled(); // linkage_two_panel = new PopupButton("2nd Linkage"); // linkage_two_panel.setEnabled(enabled); // linkage_two_panel.setComponent(popupLayout2); // linkage_one_panel.addStyleName(BaseTheme.BUTTON_LINK); // linkage_two_panel.addStyleName("link"); linkage_two_panel.addStyleName("igg-glycan-builder-linkage-toolbar-panel-item"); linkage_one_panel.addStyleName("igg-glycan-builder-linkage-toolbar-panel-item"); field_second_bond.addStyleName("igg-glycan-builder-linkage-toolbar-panel-item"); toolBar.addComponent(linkage_one_panel); popupLayout2.addComponent(field_second_child_position); popupLayout2.addComponent(field_second_parent_position); toolBar.addComponent(field_second_bond); toolBar.addComponent(linkage_two_panel); HorizontalLayout filler = new HorizontalLayout(); toolBar.addComponent(filler); toolBar.setExpandRatio(filler, 1f); //linkagePanel.removeAllComponents(); linkagePanel.setContent(toolBar); }
/** * Set the visibility of the popup. Does not hide the minimal * representation. * * @param visible true for visible, false otherwise * @return this for method chaining * @see PopupView#setPopupVisible(boolean) */ @SuppressWarnings("unchecked") public default THIS withPopupVisible(boolean visible) { ((PopupView) this).setPopupVisible(visible); return (THIS) this; }
/** * Should the popup automatically hide when the user takes the mouse cursor * out of the popup area? If this is false, the user must click outside the * popup to close it. The default is true. * * @param hideOnMouseOut true for auto hide the popup on mouse out, otherwise false * @return this for method chaining * @see PopupView#setHideOnMouseOut(boolean) */ @SuppressWarnings("unchecked") public default THIS withHideOnMouseOut(boolean hideOnMouseOut) { ((PopupView) this).setHideOnMouseOut(hideOnMouseOut); return (THIS) this; }