Java Code Examples for com.vaadin.flow.component.html.Div#setHeightFull()

The following examples show how to use com.vaadin.flow.component.html.Div#setHeightFull() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DnDDisabledView.java    From flow with Apache License 2.0 6 votes vote down vote up
private void createEventLog() {
    eventLog = new Div();
    eventLog.add(new Text("Events:"));
    eventLog.add(new NativeButton("Clear", event -> {
        eventLog.getChildren().filter(component -> component instanceof Div)
                .forEach(eventLog::remove);
        eventCounter = 0;
    }));
    eventLog.add(new NativeButton("Data: " + data, event -> {
        data = !data;
        event.getSource().setText("Data: " + data);
    }));
    eventLog.setHeightFull();
    eventLog.setWidth("400px");
    eventLog.getStyle().set("display", "inline-block").set("border",
            "2px " + "solid");
}
 
Example 2
Source File: AbstractLeftAppLayoutBase.java    From vaadin-app-layout with Apache License 2.0 5 votes vote down vote up
AbstractLeftAppLayoutBase() {
    getClassNames().addAll(asList("app-layout-behaviour-" + getStyleName(), Styles.APP_LAYOUT));
    FlexLayout appBarContentHolder = new FlexLayout(titleWrapper, appBarElementWrapper);
    appBarContentHolder.setSizeFull();
    appBarContentHolder.getElement().setAttribute("slot", "app-bar-content");

    appBarElementWrapper.getStyle().set("flex", "0 1 0px");
    appBarElementWrapper.add(appBarElementContainer);
    appBarElementWrapper.getStyle().set("flex-direction", "var(--app-layout-app-bar-flex-direction)");
    appBarElementWrapper.setWidthFull();
    appBarElementWrapper.setJustifyContentMode(FlexComponent.JustifyContentMode.END);

    appBarElementContainer.getStyle().set("flex-direction", "var(--app-layout-app-bar-flex-direction)");
    appBarElementContainer.setWidthFull();
    titleWrapper.getStyle().set("flex-direction", "var(--app-layout-app-bar-flex-direction)");
    titleWrapper.setWidthFull();

    menuElements = new Div();
    menuElements.setHeightFull();
    menuElements.getElement().setAttribute("slot", "drawer-content");
    contentHolder = new Div();
    contentHolder.setSizeFull();
    contentHolder.getElement().setAttribute("slot", "application-content");

    titleWrapper.setHeightFull();
    titleWrapper.setAlignItems(FlexComponent.Alignment.CENTER);

    titleWrapper.getElement().getStyle().set("flex", "1 1").set("overflow", "hidden");
    getElement().getClassList().add("app-layout");

    getElement().appendChild(appBarContentHolder.getElement(), menuElements.getElement(), contentHolder.getElement());
    menuButton.setIcon(VaadinIcon.MENU.create());
    menuButton.addThemeNames(ButtonVariant.LUMO_TERTIARY.getVariantName(), ButtonVariant.LUMO_ICON.getVariantName(), ButtonVariant.LUMO_LARGE.getVariantName());
}
 
Example 3
Source File: DnDView.java    From flow with Apache License 2.0 5 votes vote down vote up
private Div createLane(String identifier) {
    Div lane = new Div();
    lane.add(identifier);
    lane.setId("lane-" + identifier);
    lane.getStyle().set("margin", "20px").set("border", "1px solid black")
            .set("display", "inline-block");
    lane.setHeightFull();
    lane.setWidth("150px");
    return lane;
}
 
Example 4
Source File: DnDDisabledView.java    From flow with Apache License 2.0 5 votes vote down vote up
private Div createLane(String identifier) {
    Div lane = new Div();
    lane.add(identifier);
    lane.setId("lane-" + identifier);
    lane.getStyle().set("margin", "20px").set("border", "1px solid black")
            .set("display", "inline-block");
    lane.setHeightFull();
    lane.setWidth("150px");
    return lane;
}
 
Example 5
Source File: TopLayouts.java    From vaadin-app-layout with Apache License 2.0 4 votes vote down vote up
public TopLarge() {
    contentPanel.setSizeFull();

    paperTabWrapper.getElement().getStyle()
            .set("flex-grow", "1")
            .set("flex-shrink", "1")
            .set("align-self", "flex-end");
    paperTabWrapper.setWidthFull();
    paperTabWrapper.setHeight("var(--app-layout-bar-height)");
    paperTabWrapper.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER);

    getElement().getClassList().addAll(Arrays.asList("app-layout-behaviour-" + getStyleName(), "app-layout"));
    appBar.add(titleWrapper, appBarElementWrapper);
    appBar.setFlexGrow(1.0, titleWrapper);
    appBar.setWidthFull();
    appBar.setHeightFull();
    appBarWrapper.add(appBar, paperTabWrapper);
    appBarWrapper.setMargin(false);
    appBarWrapper.setPadding(false);
    appBarWrapper.setSpacing(false);
    appBarElements = new Div();
    appBarElements.setHeightFull();
    appBarElements.getElement().setAttribute("slot", "app-bar-content");
    contentElement = new Div();
    contentElement.setHeightFull();
    contentElement.setWidthFull();
    contentElement.getElement().setAttribute("slot", "application-content");
    appBarElements.add(appBarWrapper);
    appBarElementWrapper.setSpacing(false);
    appBarElementWrapper.add(appBarElementContainer);
    appBarElementContainer.setHeightFull();
    appBarElementWrapper.setAlignItems(FlexComponent.Alignment.START);
    titleWrapper.setHeightFull();
    titleWrapper.setWidthFull();
    titleWrapper.setAlignItems(FlexComponent.Alignment.CENTER);
    titleWrapper.setHeight("var(--app-layout-bar-height)");

    appBarElementWrapper.setAlignItems(FlexComponent.Alignment.START);
    appBarElementWrapper.setHeight("var(--app-layout-bar-height)");
    menuButton.setIcon(VaadinIcon.ARROW_LEFT.create());
    menuButton.addThemeNames(ButtonVariant.LUMO_TERTIARY.getVariantName(), ButtonVariant.LUMO_ICON.getVariantName(), ButtonVariant.LUMO_LARGE.getVariantName());
    getElement().appendChild(appBarElements.getElement(), contentElement.getElement());
}
 
Example 6
Source File: DnDView.java    From flow with Apache License 2.0 4 votes vote down vote up
public DnDView() {
    setWidth("1000px");
    setHeight("800px");
    getStyle().set("display", "flex");

    eventLog = new Div();
    eventLog.add(new Text("Events:"));
    eventLog.add(new NativeButton("Clear", event -> {
        eventLog.getChildren().filter(component -> component instanceof Div)
                .forEach(eventLog::remove);
        eventCounter = 0;
    }));
    eventLog.add(new NativeButton("Data: " + data, event -> {
        data = !data;
        event.getSource().setText("Data: " + data);
    }));
    eventLog.setHeightFull();
    eventLog.setWidth("400px");
    eventLog.getStyle().set("display", "inline-block").set("border",
            "2px " + "solid");
    add(eventLog);

    Div startLane = createLane("start");
    startLane.add(createDraggableBox(null));
    Stream.of(EffectAllowed.values()).map(this::createDraggableBox)
            .forEach(startLane::add);

    Div noEffectLane = createDropLane(null);
    Div copyDropLane = createDropLane(DropEffect.COPY);
    Div moveDropLane = createDropLane(DropEffect.MOVE);
    Div linkDropLane = createDropLane(DropEffect.LINK);
    Div noneDropLane = createDropLane(DropEffect.NONE);

    Div deactivatedLane = createDropLane(DropEffect.COPY);
    deactivatedLane.setId("lane-deactivated");
    deactivatedLane.getChildren().findFirst().ifPresent(
            component -> component.getElement().setText("deactivated"));
    DropTarget.configure(deactivatedLane, false);

    eventLog.add(createToggleDropTargetsButton(noEffectLane, copyDropLane,
            moveDropLane, linkDropLane, noneDropLane));
    eventLog.add(createToggleDragSourcesButton(startLane));

    add(startLane, noEffectLane, copyDropLane, moveDropLane, linkDropLane,
            noneDropLane, deactivatedLane);
}