Class ComponentPopupSupport<T extends JComponent>

java.lang.Object
com.inductiveautomation.ignition.designer.gui.util.ComponentPopupSupport<T>

public class ComponentPopupSupport<T extends JComponent> extends Object
Used to attach a light weight popup window containing a JComponent to a JButton. The containing JComponent is passed in the constructor as contentComponent. An OK and Cancel button are supplied by default. The ComponentPopupSupport.Handler interface is used to handle the OK and Cancel button presses as well as any other actions that need to be taken before or after the popup is shown.
  • Constructor Details

    • ComponentPopupSupport

      public ComponentPopupSupport(Supplier<T> contentComponentSupplier, JComponent popupOwner, ComponentPopupSupport.Handler<T> handler)
      Constructor will orient the popup to the right of the owner.
    • ComponentPopupSupport

      public ComponentPopupSupport(Supplier<T> contentComponentSupplier, JComponent popupOwner, ComponentPopupSupport.Handler<T> handler, Dimension preferredPopupSize, ComponentPopupSupport.Orientation orientation)
      Parameters:
      contentComponentSupplier - Supplies the component to be displayed in the popup
      popupOwner - The component that determines the location of the popup
      preferredPopupSize - The preferred size of the popup
      handler - The handler for the popup
      orientation - The orientation of the popup relative to the owner
  • Method Details

    • getContentComponent

      public T getContentComponent()
    • togglePopup

      public void togglePopup()
    • togglePopup

      public void togglePopup(int width)
    • createContentPanel

      public static <T> ComponentPopupSupport.ContentPanel<T> createContentPanel(T content)