Class ComponentPopupSupport<T extends JComponent>
java.lang.Object
com.inductiveautomation.ignition.designer.gui.util.ComponentPopupSupport<T>
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
If the content component needs to sit within a panel for layout reasons, this class can provide a panel that can be used to contain the content component, while providing easy access to the component.
To create an instance of this class usecreateContentPanel()
static interface
ComponentPopupSupport.Handler<T extends JComponent>
The handler for the popup.static enum
Specifies how the popup should be oriented relative to the popup owner. -
Constructor Summary
ConstructorsConstructorDescriptionComponentPopupSupport
(Supplier<T> contentComponentSupplier, JComponent popupOwner, ComponentPopupSupport.Handler<T> handler) Constructor will orient the popup to the right of the owner.ComponentPopupSupport
(Supplier<T> contentComponentSupplier, JComponent popupOwner, ComponentPopupSupport.Handler<T> handler, Dimension preferredPopupSize, ComponentPopupSupport.Orientation orientation) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ComponentPopupSupport.ContentPanel<T>
createContentPanel
(T content) void
void
togglePopup
(int width)
-
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 popuppopupOwner
- The component that determines the location of the popuppreferredPopupSize
- The preferred size of the popuphandler
- The handler for the popuporientation
- The orientation of the popup relative to the owner
-
-
Method Details
-
getContentComponent
-
togglePopup
public void togglePopup() -
togglePopup
public void togglePopup(int width) -
createContentPanel
-