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

public class CoatMux extends com.diffplug.common.swt.ControlWrapper.AroundControl<Composite>
A widget that switches between multiple `Coat`s.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    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
    Constructor
    Description
     
    CoatMux(Composite parent, int style)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addCoat(com.diffplug.common.swt.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.
    addCoat(com.diffplug.common.swt.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>
    CoatMux.Layer<T>
    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 com.diffplug.common.swt.ControlWrapper>
    CoatMux.Layer<T>
    Adds a persistent CoatMux.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>
    T
    Sets the current content of this `CoatMux`, gets disposed as soon as anything else becomes the top layer.
    void
    Sets the mux to be empty.
    <T extends com.diffplug.common.swt.ControlWrapper>
    T
    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

      public CoatMux(Composite parent)
    • CoatMux

      public CoatMux(Composite parent, int style)
  • Method Details

    • rxCurrent

      public RxGetter<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 persistent CoatMux.Layer which 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 persistent CoatMux.Layer which 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(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.

    • addWrapper

      public <T extends com.diffplug.common.swt.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.

    • 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(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 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.