com.vaadin.flow.component.progressbar.GeneratedVaadinProgressBar Maven / Gradle / Ivy
/*
* Copyright 2000-2022 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.flow.component.progressbar;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.vaadin.flow.component.Component;
import com.vaadin.flow.component.HasStyle;
import com.vaadin.flow.component.HasTheme;
import com.vaadin.flow.component.Tag;
import com.vaadin.flow.component.dependency.HtmlImport;
import com.vaadin.flow.component.dependency.JsModule;
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* {@code } is a Web Component for progress bars.
*
*
* <vaadin-progress-bar min="0" max="1"
* value="0.5"> </vaadin-progress-bar>
*
* Styling
*
* The following shadow DOM parts are available for styling:
*
*
*
*
* Part name
* Description
*
*
*
* {@code bar}
* Progress-bar's background
*
*
* {@code value}
* Progress-bar's foreground
*
*
*
*
* See
* ThemableMixin
* – how to apply styles for shadow parts
*
*
* The following custom properties are available:
*
*
*
*
* Custom property
* Description
* Default
*
*
*
* {@code --vaadin-progress-value}
* current progress value (between 0 and 1)
* 0
*
*
*
*
* The following state attributes are available for styling:
*
*
*
*
* Attribute
* Description
* Part name
*
*
*
* {@code indeterminate}
* Set to an indeterminate progress bar
* :host
*
*
*
*/
@Tag("vaadin-progress-bar")
@HtmlImport("frontend://bower_components/vaadin-progress-bar/src/vaadin-progress-bar.html")
@JsModule("@vaadin/vaadin-progress-bar/src/vaadin-progress-bar.js")
public abstract class GeneratedVaadinProgressBar>
extends Component implements HasStyle, HasTheme {
/**
* Adds theme variants to the component.
*
* @param variants
* theme variants to add
*/
public void addThemeVariants(ProgressBarVariant... variants) {
getThemeNames().addAll(
Stream.of(variants).map(ProgressBarVariant::getVariantName)
.collect(Collectors.toList()));
}
/**
* Removes theme variants from the component.
*
* @param variants
* theme variants to remove
*/
public void removeThemeVariants(ProgressBarVariant... variants) {
getThemeNames().removeAll(
Stream.of(variants).map(ProgressBarVariant::getVariantName)
.collect(Collectors.toList()));
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Current progress value.
*
* This property is not synchronized automatically from the client side, so
* the returned value may not be the same as in client side.
*
*
* @return the {@code value} property from the webcomponent
*/
protected double getValueDouble() {
return getElement().getProperty("value", 0.0);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Current progress value.
*
*
* @param value
* the double value to set
*/
protected void setValue(double value) {
getElement().setProperty("value", value);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Minimum bound of the progress bar.
*
* This property is not synchronized automatically from the client side, so
* the returned value may not be the same as in client side.
*
*
* @return the {@code min} property from the webcomponent
*/
protected double getMinDouble() {
return getElement().getProperty("min", 0.0);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Minimum bound of the progress bar.
*
*
* @param min
* the double value to set
*/
protected void setMin(double min) {
getElement().setProperty("min", min);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Maximum bound of the progress bar.
*
* This property is not synchronized automatically from the client side, so
* the returned value may not be the same as in client side.
*
*
* @return the {@code max} property from the webcomponent
*/
protected double getMaxDouble() {
return getElement().getProperty("max", 0.0);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Maximum bound of the progress bar.
*
*
* @param max
* the double value to set
*/
protected void setMax(double max) {
getElement().setProperty("max", max);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Indeterminate state of the progress bar. This property takes precedence
* over other state properties (min, max, value).
*
* This property is not synchronized automatically from the client side, so
* the returned value may not be the same as in client side.
*
*
* @return the {@code indeterminate} property from the webcomponent
*/
protected boolean isIndeterminateBoolean() {
return getElement().getProperty("indeterminate", false);
}
/**
*
* Description copied from corresponding location in WebComponent:
*
*
* Indeterminate state of the progress bar. This property takes precedence
* over other state properties (min, max, value).
*
*
* @param indeterminate
* the boolean value to set
*/
protected void setIndeterminate(boolean indeterminate) {
getElement().setProperty("indeterminate", indeterminate);
}
}