Class AbstractEditValuePanel<V>

Type Parameters:
V - The type of value displayed within the component.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.model.MutableValued<V>, com.globalmentor.model.Valued<V>, io.clogr.Clogged, Box, Component, CompositeComponent, Container, EditComponent, LayoutComponent, Panel, ValuedComponent<V>, EditListenable, Displayable, InfoModel, LabelModel, Model, PresentationModel, DepictedObject, Iterable<Component>

public abstract class AbstractEditValuePanel<V> extends AbstractValuedPanel<V> implements EditComponent
An abstract panel that edits a value. Changing the editable status will recursively update the editable status of all top-level EditComponent descendant components. Edit events of all top-level EditComponent descendant components will be repeated to all edit listeners of this component
Author:
Garret Wilson
  • Constructor Details

    • AbstractEditValuePanel

      public AbstractEditValuePanel(Class<V> valueClass, Layout<? extends Constraints> layout)
      Value class and layout constructor.
      Parameters:
      valueClass - The class indicating the type of value displayed within the component.
      layout - The layout definition for the container.
      Throws:
      NullPointerException - if the given value class and/or layout is null.
  • Method Details

    • getRepeatEditListener

      protected EditListener getRepeatEditListener()
      Returns:
      An edit listener to repeat copies of events received, using this component as the source while retaining the original target.
    • isEditable

      public boolean isEditable()
      Specified by:
      isEditable in interface EditComponent
      Returns:
      Whether the value is editable and the component will allow the the user to change the value.
    • setEditable

      public void setEditable(boolean newEditable)
      Description copied from interface: EditComponent
      Sets whether the value is editable and the component will allow the the user to change the value. This is a bound property of type Boolean.
      Specified by:
      setEditable in interface EditComponent
      Parameters:
      newEditable - true if the component should allow the user to change the value.
      See Also:
    • addEditListener

      public void addEditListener(EditListener editListener)
      Description copied from interface: EditListenable
      Adds an edit listener.
      Specified by:
      addEditListener in interface EditListenable
      Parameters:
      editListener - The edit listener to add.
    • removeEditListener

      public void removeEditListener(EditListener editListener)
      Description copied from interface: EditListenable
      Removes an edit listener.
      Specified by:
      removeEditListener in interface EditListenable
      Parameters:
      editListener - The edit listener to remove.
    • fireEdited

      protected void fireEdited()
      Fires an edit event to all registered edit listeners. This method delegates to fireEdited(EditEvent).
      See Also:
    • fireEdited

      protected void fireEdited(EditEvent editEvent)
      Fires a given edit event to all registered edit listeners.
      Parameters:
      editEvent - The edit event to fire.