public class CoatMux extends ControlWrapper.AroundControl<Composite>
A widget that switches between multiple Coat
s.
Modifier and Type | Class and Description |
---|---|
class |
CoatMux.Layer<T>
Represents a persistent layer within this
CoatMux . |
ControlWrapper.AroundControl<T extends Control>, ControlWrapper.AroundWrapper<T extends ControlWrapper>, ControlWrapper.Transparent<T extends Control>
wrapped
Constructor and Description |
---|
CoatMux(Composite parent) |
CoatMux(Composite parent,
int style) |
Modifier and Type | Method and Description |
---|---|
<T> CoatMux.Layer<T> |
addCoat(Coat.Returning<T> coat)
Adds a persistent
CoatMux.Layer which will be populated immediately by the given Coat.Returning , using the return value as the key. |
<T> CoatMux.Layer<T> |
addCoat(Coat coat,
T value)
Adds a persistent
CoatMux.Layer which will be populated immediately by the given Coat , using value as the key. |
<T extends Control> |
addControl(Function<Composite,T> creator)
Adds a persistent
CoatMux.Layer which will be populated immediately by the given Function<Composite, Control> , with the returned control as the key. |
<T extends ControlWrapper> |
addWrapper(Function<Composite,T> creator)
Adds a persistent
CoatMux.Layer which will be populated immediately by the given Function<Composite, Control> , with the returned control as the key. |
Control |
getTopControl()
The Control at the top of the stack (possibly null).
|
RxGetter<Optional<CoatMux.Layer<?>>> |
rxCurrent()
The current layer (if any).
|
void |
setCoat(Coat coat)
Sets the current content of this
CoatMux , gets disposed as soon as anything else becomes the top layer. |
<T> T |
setCoatReturning(Coat.Returning<T> coat)
Sets the current content of this
CoatMux , gets disposed as soon as anything else becomes the top layer. |
<T extends Control> |
setControl(Function<Composite,T> creator)
Sets the current content of this
CoatMux , gets disposed as soon as anything else becomes the top layer. |
void |
setEmpty()
Sets the mux to be empty.
|
<T extends ControlWrapper> |
setWrapper(Function<Composite,T> creator)
Sets the current content of this
CoatMux , gets disposed as soon as anything else becomes the top layer. |
getRootControl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose, getLayoutData, getParent, getShell, isDisposed, setLayoutData, setParent, transparent
public CoatMux(Composite parent)
public CoatMux(Composite parent, int style)
public RxGetter<Optional<CoatMux.Layer<?>>> rxCurrent()
The current layer (if any).
public void setEmpty()
Sets the mux to be empty.
public Control getTopControl()
The Control at the top of the stack (possibly null).
public <T> CoatMux.Layer<T> addCoat(Coat coat, @Nullable T value)
Adds a persistent CoatMux.Layer
which will be populated immediately by the given Coat
, using value
as the key.
public <T> CoatMux.Layer<T> addCoat(Coat.Returning<T> coat)
Adds a persistent CoatMux.Layer
which will be populated immediately by the given Coat.Returning
, using the return value as the key.
public <T extends Control> CoatMux.Layer<T> addControl(Function<Composite,T> creator)
Adds a persistent CoatMux.Layer
which will be populated immediately by the given Function<Composite, Control>
, with the returned control as the key.
The function must create exactly one child of the composite, and must return that child.
public <T extends ControlWrapper> CoatMux.Layer<T> addWrapper(Function<Composite,T> creator)
Adds a persistent CoatMux.Layer
which will be populated immediately by the given Function<Composite, Control>
, with the returned control as the key.
The function must create exactly one child of the composite, and it must return that child.
public void setCoat(Coat coat)
Sets the current content of this CoatMux
, gets disposed as soon as anything else becomes the top layer.
public <T> T setCoatReturning(Coat.Returning<T> coat)
Sets the current content of this CoatMux
, gets disposed as soon as anything else becomes the top layer.
public <T extends Control> T setControl(Function<Composite,T> creator)
Sets the current content of this CoatMux
, gets disposed as soon as anything else becomes the top layer.
public <T extends ControlWrapper> T setWrapper(Function<Composite,T> creator)
Sets the current content of this CoatMux
, gets disposed as soon as anything else becomes the top layer.