Interface WidgetFactory
- All Known Implementing Classes:
EObjectNodeProcessor
public interface WidgetFactory
Creates labels, links for cross-referencing, and other "widgets".
- Author:
- Pavel
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA maker interface indicating thatConnectionWidgetFactoryshall delegate to this selector instead of passing it to the other end's node.static interfaceFunctional interface for selectors to which factories delegate widget creation. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidconfigureLabel(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.LabelcreateHelpDecorator(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.LabelcreateHelpDecorator(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 ObjectcreateLink(org.nasdanika.common.ProgressMonitor progressMonitor) Creates a link if possible or a label.createLinkString(URI base, org.nasdanika.common.ProgressMonitor progressMonitor) Link rendered to Stringdefault StringcreateLinkString(org.nasdanika.common.ProgressMonitor progressMonitor) Link rendered to StringvoidUsed to establish node URI's.default ObjectCreates a widget for an aspect (feature) of the object identified by the selector, which can be aWidgetFactory.Selector.default ObjectCalls createWidget(selector, null, progressMonitor).default <T> Tselect(WidgetFactory.Selector<T> selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor) default <T> Tselect(WidgetFactory.Selector<T> selector, org.nasdanika.common.ProgressMonitor progressMonitor) selectString(Object selector, URI base, org.nasdanika.common.ProgressMonitor progressMonitor) default StringselectString(Object selector, org.nasdanika.common.ProgressMonitor progressMonitor) Calls createWidgetString(selector, null, progressMonitor)
-
Method Details
-
createLabel
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
Creates a string (HTML text) representation of "label".- Returns:
-
createLink
Creates a link if possible or a label. Calls createLink(null, progressMonitor)- Returns:
-
createLink
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, anEObjectNodeProcessorfor an object of type X would call itsEClassConnectionoutgoing connection to create a help decorator. The EClassConnection would in turn call EClassNodeProcessor forEClassX 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
Link rendered to String- Parameters:
progressMonitor-- Returns:
-
createLinkString
Link rendered to String- Parameters:
base-progressMonitor-- Returns:
-
select
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 aWidgetFactory.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
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
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-
-