All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.webforj.component.table.renderer.ElementRenderer Maven / Gradle / Ivy

package com.webforj.component.table.renderer;

import com.webforj.component.table.event.renderer.RendererClickEvent;
import com.webforj.dispatcher.EventListener;

/**
 * The base class for all renderers which render a tag with content.
 *
 * @param  the type of the row data
 *
 * @see AbstractVoidElementRenderer
 *
 * @author Hyyan Abo Fakher
 * @since 24.00
 */
public class ElementRenderer extends AbstractElementRenderer {
  private final String nodeName;

  /**
   * Creates a new element renderer.
   *
   * @param nodeName the node name
   * @param content the content of the node
   * @param listener A click listener
   */
  public ElementRenderer(String nodeName, String content,
      EventListener> listener) {
    super(content, listener);
    this.nodeName = nodeName;
  }

  /**
   * Creates a new element renderer.
   *
   * @param nodeName the node name
   * @param content the content of the node
   */
  public ElementRenderer(String nodeName, String content) {
    super(content, null);
    this.nodeName = nodeName;
  }

  /**
   * Creates a new element renderer.
   *
   * @param nodeName the node name
   */
  public ElementRenderer(String nodeName) {
    super(null, null);
    this.nodeName = nodeName;
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String getNodeName() {
    return nodeName;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy