Package com.diffplug.common.swt
Class CoatMux
- java.lang.Object
-
- com.diffplug.common.swt.ControlWrapper.AroundControl<Composite>
-
- com.diffplug.common.swt.CoatMux
-
- All Implemented Interfaces:
ControlWrapper
public class CoatMux extends ControlWrapper.AroundControl<Composite>
A widget that switches between multiple `Coat`s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCoatMux.Layer<T>Represents a persistent layer within this `CoatMux`.-
Nested classes/interfaces inherited from interface com.diffplug.common.swt.ControlWrapper
ControlWrapper.AroundControl<T extends Control>, ControlWrapper.AroundWrapper<T extends ControlWrapper>, ControlWrapper.Transparent<T extends Control>
-
-
Field Summary
-
Fields inherited from class com.diffplug.common.swt.ControlWrapper.AroundControl
wrapped
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> CoatMux.Layer<T>addCoat(com.diffplug.common.swt.Coat.Returning<T> coat)Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Coat.Returning`, using the return value as the key.<T> CoatMux.Layer<T>addCoat(com.diffplug.common.swt.Coat coat, T value)Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Coat`, using `value` as the key.<T extends Control>
CoatMux.Layer<T>addControl(java.util.function.Function<Composite,T> creator)Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Function`, with the returned control as the key. <T extends ControlWrapper>
CoatMux.Layer<T>addWrapper(java.util.function.Function<Composite,T> creator)Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Function`, with the returned control as the key. ControlgetTopControl()The Control at the top of the stack (possibly null).RxGetter<java.util.Optional<CoatMux.Layer<?>>>rxCurrent()The current layer (if any).voidsetCoat(com.diffplug.common.swt.Coat coat)Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.<T> TsetCoatReturning(com.diffplug.common.swt.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>
TsetControl(java.util.function.Function<Composite,T> creator)Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.voidsetEmpty()Sets the mux to be empty.<T extends ControlWrapper>
TsetWrapper(java.util.function.Function<Composite,T> creator)Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.-
Methods inherited from class com.diffplug.common.swt.ControlWrapper.AroundControl
getRootControl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.diffplug.common.swt.ControlWrapper
dispose, getLayoutData, getParent, getShell, isDisposed, setLayoutData, setParent
-
-
-
-
Method Detail
-
rxCurrent
public RxGetter<java.util.Optional<CoatMux.Layer<?>>> rxCurrent()
The current layer (if any).
-
setEmpty
public void setEmpty()
Sets the mux to be empty.
-
getTopControl
public Control getTopControl()
The Control at the top of the stack (possibly null).
-
addCoat
public <T> CoatMux.Layer<T> addCoat(com.diffplug.common.swt.Coat coat, @Nullable T value)
Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Coat`, using `value` as the key.
-
addCoat
public <T> CoatMux.Layer<T> addCoat(com.diffplug.common.swt.Coat.Returning<T> coat)
Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Coat.Returning`, using the return value as the key.
-
addControl
public <T extends Control> CoatMux.Layer<T> addControl(java.util.function.Function<Composite,T> creator)
Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Function`, with the returned control as the key. The function must create exactly one child of the composite, and must return that child.
-
addWrapper
public <T extends ControlWrapper> CoatMux.Layer<T> addWrapper(java.util.function.Function<Composite,T> creator)
Adds a persistentCoatMux.Layerwhich will be populated immediately by the given `Function`, with the returned control as the key. The function must create exactly one child of the composite, and it must return that child.
-
setCoat
public void setCoat(com.diffplug.common.swt.Coat coat)
Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.
-
setCoatReturning
public <T> T setCoatReturning(com.diffplug.common.swt.Coat.Returning<T> coat)
Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.
-
setControl
public <T extends Control> T setControl(java.util.function.Function<Composite,T> creator)
Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.
-
setWrapper
public <T extends ControlWrapper> T setWrapper(java.util.function.Function<Composite,T> creator)
Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.
-
-