Interface ViewSupplier<M>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ViewSupplier<M>
A provider of a view, usually a view model or a simple data model with the purpose of making it possible to dynamically creating sub-views for inside a view for a given sub-view model.

See:
UIForAnySwing.add(Val, ViewSupplier),
UIForAnySwing.addAll(Vals, ViewSupplier),
UIForAnySwing.add(String, Val, ViewSupplier),
UIForAnySwing.addAll(String, Vals, ViewSupplier),
UIForAnySwing.add(AddConstraint, Val, ViewSupplier),
UIForAnySwing.addAll(AddConstraint, Vals, ViewSupplier),

  • Method Summary

    Modifier and Type
    Method
    Description
    createViewFor(M viewModel)
    Creates a view representing an instance of the type M, which is a view model or a simple data model.
  • Method Details

    • createViewFor

      UIForAnySwing<?,?> createViewFor(M viewModel) throws Exception
      Creates a view representing an instance of the type M, which is a view model or a simple data model.
      Note that this method deliberately requires the handling of checked exceptions at its invocation sites because there may be any number of implementations hiding behind this interface and so it is unwise to assume that all of them will be able to execute gracefully without throwing exceptions.
      Parameters:
      viewModel - The thing to create a view for, usually a view model or a simple data model.
      Returns:
      A view for the given view model in the form of a UIForAnySwing, a builder node which wraps the actual main component of the view.
      Throws:
      Exception