public abstract class AbstractWidget<T extends WidgetModel,U extends WidgetController> extends Div implements Widget<T,U>
| Modifier and Type | Field and Description |
|---|---|
protected static String |
LAZY_LOAD_EVT_KEY |
| Constructor and Description |
|---|
AbstractWidget()
Creates a new widget instance.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cleanup()
Called whenever this widget is invalidated or when a cleanup is needed.
|
HtmlBasedComponent |
getCaption()
Returns this widget's caption component.
|
HtmlBasedComponent |
getContent()
Returns this widget's content component
|
String |
getControllerCtx()
Returns this widget's controller context.
|
String |
getWidgetCode()
Returns the widget's code.
|
WidgetContainer |
getWidgetContainer()
Returns the widget container to which this widget belongs.
|
U |
getWidgetController()
Returns the widget's controller.
|
T |
getWidgetModel()
Returns the widget's (view) model.
|
WidgetRenderer |
getWidgetRenderer()
Returns the widget renderer.
|
String |
getWidgetTitle()
Returns the widget's title.
|
void |
handleFocus(boolean focused)
Called whenever the focus view state of this component should be changed.
|
void |
initialize(Map<String,Object> params)
Initializes this widget.
|
boolean |
isFocusable()
Returns whether this widget can be focused or not.
|
boolean |
isInitialized()
Returns whether this widget has been initialized or not.
|
boolean |
isLazyLoadingEnabled()
Returns whether content lazy loading is enabled or not.
|
protected void |
setCaption(HtmlBasedComponent caption)
Sets this widget's caption component to
caption. |
protected void |
setContent(HtmlBasedComponent content)
Sets this widget's content component to
content. |
void |
setControllerCtx(String controllerCtx)
Sets this widget's controller context i.e.
|
void |
setFocusable(boolean focusable)
Sets whether this widget can be focused or not.
|
void |
setLazyLoadingEnabled(boolean lazyLoading)
Enables or disables content lazy loading.
|
void |
setWidgetCode(String widgetCode)
Sets the widget's code.
|
void |
setWidgetContainer(WidgetContainer container)
Sets the widget container to which this widget belongs.
|
void |
setWidgetController(U widgetController)
Sets the widget's controller to
controller. |
void |
setWidgetModel(T model)
Sets the widget's (view) model.
|
void |
setWidgetRenderer(WidgetRenderer widgetRenderer)
Sets the widget renderer.
|
void |
setWidgetTitle(String title)
Sets the widget's title to
title. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonModelEventprotected static final String LAZY_LOAD_EVT_KEY
public void initialize(Map<String,Object> params)
Widgetinitialize in interface Widget<T extends WidgetModel,U extends WidgetController>params - initialization parameterspublic boolean isInitialized()
WidgetisInitialized in interface Widget<T extends WidgetModel,U extends WidgetController>true if widget has been initialized, false otherwisepublic void handleFocus(boolean focused)
FocusableComponenthandleFocus in interface FocusableComponentfocused - true if the component should be rendered as focused, false otherwisepublic abstract void cleanup()
Widgetcleanup in interface Widget<T extends WidgetModel,U extends WidgetController>public HtmlBasedComponent getContent()
WidgetgetContent in interface Widget<T extends WidgetModel,U extends WidgetController>WidgetRenderer.createContent(Widget)protected void setContent(HtmlBasedComponent content)
content.
Note: If a content component has already been set the old one will be removed.content - content componentpublic HtmlBasedComponent getCaption()
WidgetgetCaption in interface Widget<T extends WidgetModel,U extends WidgetController>WidgetRenderer.createCaption(Widget)protected void setCaption(HtmlBasedComponent caption)
caption.
Note: If a caption component has already been set the old one will be removed.caption - caption componentpublic void setWidgetContainer(WidgetContainer container)
WidgetsetWidgetContainer in interface Widget<T extends WidgetModel,U extends WidgetController>container - widget containerpublic WidgetContainer getWidgetContainer()
WidgetgetWidgetContainer in interface Widget<T extends WidgetModel,U extends WidgetController>public void setWidgetModel(T model)
WidgetsetWidgetModel in interface Widget<T extends WidgetModel,U extends WidgetController>model - the modelpublic T getWidgetModel()
WidgetgetWidgetModel in interface Widget<T extends WidgetModel,U extends WidgetController>null if no model is availablepublic void setWidgetCode(String widgetCode)
WidgetWidgetContainer.setWidgetCode in interface Widget<T extends WidgetModel,U extends WidgetController>widgetCode - widget codepublic String getWidgetCode()
WidgetgetWidgetCode in interface Widget<T extends WidgetModel,U extends WidgetController>Widget.setWidgetCode(String)public void setWidgetRenderer(WidgetRenderer widgetRenderer)
WidgetsetWidgetRenderer in interface Widget<T extends WidgetModel,U extends WidgetController>widgetRenderer - widget rendererpublic WidgetRenderer getWidgetRenderer()
WidgetgetWidgetRenderer in interface Widget<T extends WidgetModel,U extends WidgetController>public void setFocusable(boolean focusable)
WidgetsetFocusable in interface Widget<T extends WidgetModel,U extends WidgetController>focusable - true means focusing is enabled, false means disabledpublic boolean isFocusable()
WidgetisFocusable in interface Widget<T extends WidgetModel,U extends WidgetController>true if focusing is enabled, false otherwisepublic void setWidgetController(U widgetController)
Widgetcontroller.setWidgetController in interface Widget<T extends WidgetModel,U extends WidgetController>widgetController - widget controllerpublic U getWidgetController()
WidgetgetWidgetController in interface Widget<T extends WidgetModel,U extends WidgetController>public void setControllerCtx(String controllerCtx)
WidgetsetControllerCtx in interface Widget<T extends WidgetModel,U extends WidgetController>controllerCtx - controller context codepublic String getControllerCtx()
WidgetgetControllerCtx in interface Widget<T extends WidgetModel,U extends WidgetController>public boolean isLazyLoadingEnabled()
WidgetisLazyLoadingEnabled in interface Widget<T extends WidgetModel,U extends WidgetController>true if lazy loading is enabled, false otherwisepublic void setLazyLoadingEnabled(boolean lazyLoading)
WidgetsetLazyLoadingEnabled in interface Widget<T extends WidgetModel,U extends WidgetController>lazyLoading - lazy loadingpublic void setWidgetTitle(String title)
Widgettitle.setWidgetTitle in interface Widget<T extends WidgetModel,U extends WidgetController>title - widget title as either i3-label key or direct valuepublic String getWidgetTitle()
WidgetWidget.setWidgetTitle(String) i.e.
in the case of an i3-label key, no evaluation is done.getWidgetTitle in interface Widget<T extends WidgetModel,U extends WidgetController>Copyright © 2017 SAP SE. All Rights Reserved.