com.vaadin.ui.
Class ProgressBar
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.ProgressBar
-
All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier
,MethodEventSource
,ClientConnector
,Sizeable
,Connector
,Component
,Serializable
public class ProgressBar extends AbstractComponent
A component for displaying progress.
The default mode is to show the current progress internally represented by a floating point value between 0 and 1 (inclusive). The progress bar can also be in an indeterminate mode showing an animation indicating that the task is running but without providing any information about the current progress.
Since:
8.0
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description ProgressBar()
Creates a new progress bar initially set to 0% progress.
ProgressBar(float progress)
Creates a new progress bar with the given initial value.
-
Method Summary
All Methods Modifier and Type Method Description protected ProgressBarState
getState()
Returns the shared state bean with information to be sent from the server to the client.
protected ProgressBarState
getState(boolean markAsDirty)
Returns the shared state for this connector.
float
getValue()
Gets the value of this progress bar.
boolean
isIndeterminate()
Gets whether or not this progress indicator is indeterminate.
void
readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Reads the component state from the given design.
void
reset()
Resets the value of this component, effectively displaying zero progress.
void
setIndeterminate(boolean indeterminate)
Sets whether or not this progress indicator is indeterminate.
void
setValue(float newValue)
Sets the value of this progress bar.
void
writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Writes the component state to the given design.
-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addStyleNames, getUI, removeStyleNames, setStyleName
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
-
-
-
Method Detail
-
getValue
public float getValue()
Gets the value of this progress bar. The value is a
float
between 0 and 1 where 0 represents no progress at all and 1 represents fully completed.Returns:
the current progress value
-
setValue
public void setValue(float newValue)
Sets the value of this progress bar. The value is a
float
between 0 and 1 where 0 represents no progress at all and 1 represents fully completed.Parameters:
newValue
- the current progress valueSince:
8.0
-
getState
protected ProgressBarState getState()
Description copied from class:
AbstractComponent
Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().
Overrides:
getState
in classAbstractComponent
Returns:
updated component shared state
-
getState
protected ProgressBarState getState(boolean markAsDirty)
Description copied from class:
AbstractClientConnector
Returns the shared state for this connector.
Overrides:
getState
in classAbstractComponent
Parameters:
markAsDirty
- true if the connector should automatically be marked dirty, false otherwiseReturns:
The shared state for this connector. Never null.
See Also:
-
setIndeterminate
public void setIndeterminate(boolean indeterminate)
Sets whether or not this progress indicator is indeterminate. In indeterminate mode there is an animation indicating that the task is running but without providing any information about the current progress.
Parameters:
indeterminate
-true
to set to indeterminate mode; otherwisefalse
-
isIndeterminate
public boolean isIndeterminate()
Gets whether or not this progress indicator is indeterminate. In indeterminate mode there is an animation indicating that the task is running but without providing any information about the current progress.
Returns:
true
if set to indeterminate mode; otherwisefalse
-
readDesign
public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Description copied from interface:
Component
Reads the component state from the given design.
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
Specified by:
readDesign
in interfaceComponent
Overrides:
readDesign
in classAbstractComponent
Parameters:
design
- The element to obtain the state fromdesignContext
- The DesignContext instance used for parsing the design
-
writeDesign
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Description copied from interface:
Component
Writes the component state to the given design.
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
Specified by:
writeDesign
in interfaceComponent
Overrides:
writeDesign
in classAbstractComponent
Parameters:
design
- The element to write the component state to. Any previous attributes or child nodes are not cleared.designContext
- The DesignContext instance used for writing the design
-
reset
public void reset()
Resets the value of this component, effectively displaying zero progress.
Since:
8.0
-
-