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

com.vaadin.ui.DeclarativeItemEnabledProvider Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */
package com.vaadin.ui;

import java.util.HashSet;
import java.util.Set;

import com.vaadin.server.SerializablePredicate;

/**
 * Item enabled provider class for declarative support.
 * 

* Provides a straightforward mapping between an item and its enable state. * * @param * item type */ class DeclarativeItemEnabledProvider implements SerializablePredicate { private Set disabled = new HashSet<>(); @Override public boolean test(T item) { return !disabled.contains(item); } /** * Adds the {@code item} to disabled items list. * * @param item * a data item */ protected void addDisabled(T item) { disabled.add(item); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy