com.vaadin.flow.component.crud.CrudEditorPosition Maven / Gradle / Ivy
/**
* Copyright 2000-2024 Vaadin Ltd.
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See {@literal } for the full
* license.
*/
package com.vaadin.flow.component.crud;
import java.util.Arrays;
/**
* Enum with the possible values for the crud's editor position.
*/
public enum CrudEditorPosition {
/**
* Editor form is positioned inside the overlay
*/
OVERLAY(""),
/**
* Editor form is positioned below the grid
*/
BOTTOM("bottom"),
/**
* Editor form is positioned on the grid side
*
* - right
- if ltr
* - left
- if rtl
*/
ASIDE("aside");
private final String editorPosition;
CrudEditorPosition(String editorPosition) {
this.editorPosition = editorPosition;
}
String getEditorPosition() {
return editorPosition;
}
static CrudEditorPosition toPosition(String editorPosition,
CrudEditorPosition defaultValue) {
return Arrays.stream(values())
.filter(alignment -> alignment.getEditorPosition()
.equals(editorPosition))
.findFirst().orElse(defaultValue);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy