public class Loader extends Object
Customize the component can be done by overwriting classes provided by LoaderStyles
For example:
Loader.create(element, LoaderEffect.PULSE)
.setLoadingText("Loading ...")
.start();
| Modifier and Type | Class and Description |
|---|---|
static class |
Loader.LoadingTextPosition
An enum representing the position of the loading text based on the loader effect
|
| Modifier and Type | Method and Description |
|---|---|
static Loader |
create(elemental2.dom.HTMLElement target,
LoaderEffect effect)
Creates a loader for a target element with an effect
|
static Loader |
create(org.jboss.elemento.IsElement<?> target,
LoaderEffect effect)
Creates a loader for a target element with an effect
|
IsLoader |
getLoaderElement() |
Loader.LoadingTextPosition |
getLoadingTextPosition() |
boolean |
isStarted() |
Loader |
setLoadingText(String text)
Sets a loading text which will be shown when the loader starts loading
|
Loader |
setLoadingTextPosition(Loader.LoadingTextPosition loadingTextPosition)
Sets the position of the loading text
|
Loader |
setRemoveLoadingText(boolean removeLoadingText)
Removes the loading text when loader is shown
|
Loader |
setSize(String width,
String height)
Sets the width and height for the loader
|
Loader |
start()
Starts the loading, the loader will keep loading until
stop() is called |
Loader |
start(int timeout)
Starts the loading, the loader will keep loading until
stop() is called |
Loader |
stop()
Stops the loading
|
public static Loader create(elemental2.dom.HTMLElement target, LoaderEffect effect)
target - the target elementeffect - the LoaderEffectpublic static Loader create(org.jboss.elemento.IsElement<?> target, LoaderEffect effect)
target - the target elementeffect - the LoaderEffectpublic Loader start()
stop() is calledpublic Loader start(int timeout)
stop() is calledtimeout - int delay in milliseconds before automatically stopping the loader.public Loader stop()
public Loader setLoadingText(String text)
text - the loading textpublic Loader setSize(String width, String height)
width - the widthheight - the heightpublic Loader setRemoveLoadingText(boolean removeLoadingText)
removeLoadingText - true to remove the loading text, false otherwisepublic boolean isStarted()
public Loader.LoadingTextPosition getLoadingTextPosition()
Loader.LoadingTextPositionpublic Loader setLoadingTextPosition(Loader.LoadingTextPosition loadingTextPosition)
loadingTextPosition - the Loader.LoadingTextPositionpublic IsLoader getLoaderElement()
Copyright © 2019–2022 Dominokit. All rights reserved.