All Known Implementing Classes:
EObjectNodeProcessor

public interface WidgetFactory
Creates labels, links for cross-referencing, and other "widgets".
Author:
Pavel
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A maker interface indicating that Connection WidgetFactory shall delegate to this selector instead of passing it to the other end's node.
    static interface 
    Functional interface for selectors to which factories delegate widget creation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    configureLabel(Object source, org.nasdanika.html.model.app.Label label, org.nasdanika.common.ProgressMonitor progressMonitor)
    Configures a label for a given source object.
    org.nasdanika.html.model.app.Label
    createHelpDecorator(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a help decorator with URL's deresolved (relativized) against the provided base URI.
    default org.nasdanika.html.model.app.Label
    createHelpDecorator(org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a help decorator.
    createLabel(org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a "label" which is an HTML/text representation of something which does not navigate to that something.
    org.nasdanika.common.Supplier<Collection<org.nasdanika.html.model.app.Label>>
     
    createLabelString(org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a string (HTML text) representation of "label".
    createLink(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a link with URL's deresolved (relativized) against the provided base URI.
    default Object
    createLink(org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a link if possible or a label.
    createLinkString(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    Link rendered to String
    default String
    createLinkString(org.nasdanika.common.ProgressMonitor progressMonitor)
    Link rendered to String
    void
    resolve(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    Used to establish node URI's.
    default Object
    select(Object selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    Creates a widget for an aspect (feature) of the object identified by the selector, which can be a WidgetFactory.Selector.
    default Object
    select(Object selector, org.nasdanika.common.ProgressMonitor progressMonitor)
    Calls createWidget(selector, null, progressMonitor).
    default <T> T
    select(WidgetFactory.Selector<T> selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
     
    default <T> T
    select(WidgetFactory.Selector<T> selector, org.nasdanika.common.ProgressMonitor progressMonitor)
     
    selectString(Object selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
     
    default String
    selectString(Object selector, org.nasdanika.common.ProgressMonitor progressMonitor)
    Calls createWidgetString(selector, null, progressMonitor)
  • Method Details

    • createLabel

      Object createLabel(org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a "label" which is an HTML/text representation of something which does not navigate to that something. E.g. Label. Can be composite.
      Returns:
    • createLabelString

      String createLabelString(org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a string (HTML text) representation of "label".
      Returns:
    • createLink

      default Object createLink(org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a link if possible or a label. Calls createLink(null, progressMonitor)
      Returns:
    • createLink

      Object createLink(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a link with URL's deresolved (relativized) against the provided base URI.
      Parameters:
      base - For connections, if not null, is resolved against the calling end URI - source or target, if it is not null. If null, the respective end URI is used as the base.
      progressMonitor -
      Returns:
    • createHelpDecorator

      default org.nasdanika.html.model.app.Label createHelpDecorator(org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a help decorator. Calls createHelpDecorator(null, progressMonitor)
      Returns:
    • createHelpDecorator

      org.nasdanika.html.model.app.Label createHelpDecorator(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a help decorator with URL's deresolved (relativized) against the provided base URI. For example, an EObjectNodeProcessor for an object of type X would call its EClassConnection outgoing connection to create a help decorator. The EClassConnection would in turn call EClassNodeProcessor for EClass X to generate context help decorator.
      Parameters:
      base - For connections, if not null, is resolved against the calling end URI - source or target, if it is not null. If null, the respective end URI is used as the base.
      progressMonitor -
      Returns:
    • createLinkString

      default String createLinkString(org.nasdanika.common.ProgressMonitor progressMonitor)
      Link rendered to String
      Parameters:
      progressMonitor -
      Returns:
    • createLinkString

      String createLinkString(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Link rendered to String
      Parameters:
      base -
      progressMonitor -
      Returns:
    • select

      default Object select(Object selector, org.nasdanika.common.ProgressMonitor progressMonitor)
      Calls createWidget(selector, null, progressMonitor). For connections URL's in the link are deresolved (relativized) against the calling end URI - source or target, if it is not null.
      Parameters:
      selector -
      progressMonitor -
      Returns:
    • select

      default Object select(Object selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Creates a widget for an aspect (feature) of the object identified by the selector, which can be a WidgetFactory.Selector.
      Parameters:
      selector - Aspect/feature key. If an instasnce of Selector, then the factory delegates widget creation to the selector passing itself as an argument.
      base - For connections, if not null, is resolved against the calling end URI - source or target, if it is not null. If null, the respective end URI is used as the base.
      progressMonitor -
      Returns:
      A widget or null
    • select

      default <T> T select(WidgetFactory.Selector<T> selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
    • select

      default <T> T select(WidgetFactory.Selector<T> selector, org.nasdanika.common.ProgressMonitor progressMonitor)
    • selectString

      default String selectString(Object selector, org.nasdanika.common.ProgressMonitor progressMonitor)
      Calls createWidgetString(selector, null, progressMonitor)
      Parameters:
      selector -
      progressMonitor -
      Returns:
    • selectString

      String selectString(Object selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Parameters:
      selector -
      base -
      progressMonitor -
      Returns:
      widget rendered to (HTML) string
    • resolve

      void resolve(URI base, org.nasdanika.common.ProgressMonitor progressMonitor)
      Used to establish node URI's. Propagates caller URI.
      Parameters:
      base -
    • createLabelsSupplier

      org.nasdanika.common.Supplier<Collection<org.nasdanika.html.model.app.Label>> createLabelsSupplier()
    • configureLabel

      default void configureLabel(Object source, org.nasdanika.html.model.app.Label label, org.nasdanika.common.ProgressMonitor progressMonitor)
      Configures a label for a given source object. This method allows multiple widget factories collaborate on label/action configuration. E.g. the primary WidgetFactory may delegate to "facet" factories.
      Parameters:
      source -
      label -
      progressMonitor -