Class AbstractSingleCompositeComponent

All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, io.clogr.Clogged, Component, CompositeComponent, Displayable, InfoModel, LabelModel, Model, PresentationModel, DepictedObject

public abstract class AbstractSingleCompositeComponent extends AbstractCompositeComponent
An abstract implementation of a composite component that can contain a single component.
Author:
Garret Wilson
  • Constructor Details

    • AbstractSingleCompositeComponent

      public AbstractSingleCompositeComponent(InfoModel infoModel)
      Info model constructor.
      Parameters:
      infoModel - The component info model.
      Throws:
      NullPointerException - if the given info model is null.
  • Method Details

    • getComponent

      protected Component getComponent()
      Returns:
      The child component, or null if this component does not contain a child component.
    • setComponent

      public void setComponent(Component newComponent)
      Sets the child component. This is a bound property.
      Parameters:
      newComponent - The child component, or null if this component does not contain a child component. //TODO fix if needed @see #CHECK_TYPE_PROPERTY
      Throws:
      IllegalArgumentException - if the component already has a parent.
    • hasChildComponents

      public boolean hasChildComponents()
      Returns:
      Whether this component has childh components.
    • getChldren

      public Iterable<Component> getChldren()
      Returns:
      An iterable to child components.