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:
com.diffplug.common.swt.ControlWrapper
A widget that switches between multiple `Coat`s.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Represents a persistent layer within this `CoatMux`.Nested classes/interfaces inherited from interface com.diffplug.common.swt.ControlWrapper
com.diffplug.common.swt.ControlWrapper.AroundControl<T extends Control>, com.diffplug.common.swt.ControlWrapper.AroundWrapper<T extends com.diffplug.common.swt.ControlWrapper>, com.diffplug.common.swt.ControlWrapper.Companion, com.diffplug.common.swt.ControlWrapper.Transparent<T extends Control>
-
Field Summary
Fields inherited from class com.diffplug.common.swt.ControlWrapper.AroundControl
wrapped
Fields inherited from interface com.diffplug.common.swt.ControlWrapper
Companion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> CoatMux.Layer<T>
addCoat
(com.diffplug.common.swt.Coat.Returning<T> coat) Adds a persistentCoatMux.Layer
which 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.Layer
which will be populated immediately by the given `Coat`, using `value` as the key.<T extends Control>
CoatMux.Layer<T>addControl
(Function<Composite, T> creator) Adds a persistentCoatMux.Layer
which will be populated immediately by the given `Function<Composite, Control>`, with the returned control as the key.<T extends com.diffplug.common.swt.ControlWrapper>
CoatMux.Layer<T>addWrapper
(Function<Composite, T> creator) Adds a persistentCoatMux.Layer
which will be populated immediately by the given `Function<Composite, Control>`, with the returned control as the key.The Control at the top of the stack (possibly null).The current layer (if any).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.<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.<T extends Control>
TsetControl
(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 com.diffplug.common.swt.ControlWrapper>
TsetWrapper
(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
-
Constructor Details
-
CoatMux
-
CoatMux
-
-
Method Details
-
rxCurrent
The current layer (if any). -
setEmpty
public void setEmpty()Sets the mux to be empty. -
getTopControl
The Control at the top of the stack (possibly null). -
addCoat
Adds a persistentCoatMux.Layer
which will be populated immediately by the given `Coat`, using `value` as the key. -
addCoat
Adds a persistentCoatMux.Layer
which will be populated immediately by the given `Coat.Returning`, using the return value as the key. -
addControl
Adds a persistentCoatMux.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.
-
addWrapper
public <T extends com.diffplug.common.swt.ControlWrapper> CoatMux.Layer<T> addWrapper(Function<Composite, T> creator) Adds a persistentCoatMux.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.
-
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
Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer. -
setWrapper
public <T extends com.diffplug.common.swt.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.
-