Class Listen
java.lang.Object
com.inductiveautomation.ignition.client.util.gui.Listen
Utility class to adapt classic swing listener patterns to a more Java-8 style of code.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
toAction
(AbstractButton button, Runnable r) static void
toAction
(JTextField field, Runnable r) static <T> void
toCombobox
(JComboBox<T> combobox, Consumer<T> listener) static Listen.PopupMenuAdapter
toComboboxPopup
(JComboBox<?> menu) static void
toDisplayable
(JComponent component, Consumer<Boolean> onChange) Listens to when a component is added into or removed from the component hierarchy, changing it's displayable flag.static void
toDocumentChange
(Document document, Consumer<String> onChange) Will be called any time a document changes, and will deliver the new text of the document to the provided listenerstatic void
toDocumentChange
(JTextComponent component, Consumer<String> onChange) Will be called any time a document changes, and will deliver the new text of the document to the provided listenerstatic void
toDoubleClick
(JComponent component, Runnable r) static void
toDoubleClick
(JComponent component, Consumer<MouseEvent> r) static void
toFocusGained
(Component component, Runnable r) static void
toFocusLost
(Component component, Runnable r) static void
toKeyEvents
(JTextField textField, KeyAdapter keyAdapter) static Listen.PopupMenuAdapter
toPopupMenu
(com.jidesoft.popup.JidePopup menu) static Listen.PopupMenuAdapter
toPopupMenu
(JPopupMenu menu) static void
toPopupTrigger
(JComponent component, Runnable r) static void
toPopupTrigger
(JComponent component, Consumer<MouseEvent> r) static void
toPress
(JComponent component, Runnable r) static Runnable
toProperty
(Component component, String propertyName, Consumer<Object> consumer) static void
toStateChange
(ItemSelectable checkBox, Consumer<Boolean> listener)
-
Constructor Details
-
Listen
public Listen()
-
-
Method Details
-
toProperty
-
toAction
-
toAction
-
toPress
-
toDoubleClick
-
toDoubleClick
-
toPopupTrigger
-
toPopupTrigger
-
toStateChange
-
toCombobox
-
toFocusGained
-
toFocusLost
-
toDocumentChange
Will be called any time a document changes, and will deliver the new text of the document to the provided listener -
toDocumentChange
Will be called any time a document changes, and will deliver the new text of the document to the provided listener -
toDisplayable
Listens to when a component is added into or removed from the component hierarchy, changing it's displayable flag. -
toKeyEvents
-
toPopupMenu
-
toPopupMenu
-
toComboboxPopup
-