All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.imunity.furms.ui.components.FurmsViewComponent Maven / Gradle / Ivy

There is a newer version: 4.3.1
Show newest version
/*
 * Copyright (c) 2020 Bixbit s.c. All rights reserved.
 * See LICENSE file for licensing information.
 */
package io.imunity.furms.ui.components;

import com.vaadin.flow.component.Composite;
import com.vaadin.flow.component.Key;
import com.vaadin.flow.component.Shortcuts;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.function.SerializablePredicate;
import com.vaadin.flow.router.BeforeEvent;
import com.vaadin.flow.router.HasDynamicTitle;
import com.vaadin.flow.router.HasUrlParameter;
import com.vaadin.flow.router.OptionalParameter;
import io.imunity.furms.ui.components.layout.BreadCrumbParameter;

import java.util.Optional;


public abstract class FurmsViewComponent extends Composite
implements HasUrlParameter, HasDynamicTitle { public FurmsViewComponent() { getContent().setClassName("furms-view"); getContent().setHeightFull(); } public Optional getParameter(){ return Optional.empty(); } @Override public void setParameter(BeforeEvent event, @OptionalParameter String parameter) {} @Override public String getPageTitle() { return getTranslation(getClass().getAnnotation(PageTitle.class).key()); } protected SerializablePredicate getNotEmptyStringValidator() { return value -> value != null && !value.isBlank(); } protected void addPreventionForMultiEnterClick() { Shortcuts.addShortcutListener(getContent(), event -> {}, Key.ENTER); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy