1. Domino UI
  2. Components
  3. Media objects
Top Basic Alignment Docs

Lists

Represents a media object commonly used for displaying media content with an optional header and descriptions.

It allows configuration for left and right media objects alongside a central media body.

Usage:

 
 MediaObject media = MediaObject.create()
    .setHeader("Sample Header")
    .setLeftMedia(someElement)
    .setRightMedia(someOtherElement);
 

Examples

Basic media The default media displays a media object (images, video, audio) to the left or right of a content block.

Media alignment The images or other media can be aligned top, middle, or bottom. The default is top aligned.

API Docs: MediaObject

Constructors

public void MediaObject()
Creates a new instance of MediaObject .

Static methods

public static MediaObject create()
Creates a new instance of MediaObject .

Returns:

The newly created media object.

Public methods

public HTMLElement getAppendTarget()
Retrieves the target element where new content can be appended.

Returns:

The HTML element of the media body.

public MediaObject setHeader(String header)
Sets the header text for the media object.

header

The header text.



Returns:

The current media object instance.

public MediaObject setLeftMedia(Node content)
Sets the left media content using a node.

content

The node to be set as left media content.



Returns:

The current media object instance.

public MediaObject setLeftMedia(IsElement<?> element)
Sets the left media content using an IsElement .

element

The element to be set as left media content.



Returns:

The current media object instance.

public MediaObject setRightMedia(Node content)
Sets the right media content using a node.

content

The node to be set as right media content.



Returns:

The current media object instance.

public MediaObject setRightMedia(IsElement<?> element)
Sets the right media content using an IsElement .

element

The element to be set as right media content.



Returns:

The current media object instance.

public DivElement getMediaBody()
Retrieves the media body of the media object.

Returns:

The div element of the media body.

public HeadingElement getMediaHeader()
Retrieves the header of the media object.

Returns:

The heading element of the media header.

public DivElement getLeftMedia()
Retrieves the left media content of the media object.

Returns:

The div element of the left media content.

public DivElement getRightMedia()
Retrieves the right media content of the media object.

Returns:

The div element of the right media content.

public MediaObject withHeader(ChildHandler<MediaObject, HeadingElement> handler)
Configures the media header using a handler.

handler

A handler that accepts the current media object instance and its media header.



Returns:

The current media object instance.

public MediaObject withMediaBody(ChildHandler<MediaObject, DivElement> handler)
Configures the media body using a handler.

handler

A handler that accepts the current media object instance and its media body.



Returns:

The current media object instance.

public MediaObject withLeftMedia(ChildHandler<MediaObject, DivElement> handler)
Configures the left media content using a handler.

handler

A handler that accepts the current media object instance and its left media content.



Returns:

The current media object instance.

public MediaObject withRightMedia(ChildHandler<MediaObject, DivElement> handler)
Configures the right media content using a handler.

handler

A handler that accepts the current media object instance and its right media content.



Returns:

The current media object instance.

public HTMLDivElement element()
Retrieves the root element of the media object.

Returns:

The root HTMLDivElement of this media object.

We are a group of passionate people who love what we do

Donate & Support Us