Class HolderPanel<T extends JComponent>

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.client.util.gui.HolderPanel<T>
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
FilterablePalette

public class HolderPanel<T extends JComponent> extends JPanel
A panel that simply holds some other panel, using a filling layout. Used for when panels get swapped out. Sort of like what CardLayout tries to do, but less annoying to use.

Don't call add() on this. Call setComponent(JComponent) instead.

See Also:
  • Constructor Details

    • HolderPanel

      public HolderPanel()
    • HolderPanel

      public HolderPanel(JComponent emptyPlaceholder)
      Parameters:
      emptyPlaceholder - Panel to use when the component is null. May be null.
    • HolderPanel

      public HolderPanel(JComponent emptyPlaceholder, T initialComponent)
  • Method Details

    • getComponent

      public T getComponent()
      Returns:
      The current component in the holder, or null if the placeholder is being shown.
    • setComponentLater

      public void setComponentLater(T component)
    • setComponent

      public void setComponent(T component)
    • wrap

      protected JComponent wrap(T component)
      Provides a hook to wrap the component in something else. Useful for scroll panes.
    • onComponentRemoved

      protected void onComponentRemoved(T oldComponent)
    • onComponentAdded

      protected void onComponentAdded(T newComponent)