@API(type=INTERNAL,
src=PUBLIC)
public final class InplaceEditorUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
addToParent(java.awt.Component component,
java.awt.Container parent,
java.util.function.Supplier<T> supplier)
Adds the child inside the parent, calls the given supplier and requests the results from the
supplier.
|
static java.awt.Dimension |
getPreferredSize(java.awt.Component component,
java.awt.Container parent)
Get the preferred size for the component.
|
static Dimension |
getPreferredSize(javax.swing.JComboBox comboBox,
AuthorInplaceContext context)
Computes the preferred size for the given combo box.
|
static Dimension |
getPreferredSize(javax.swing.JPanel panel,
AuthorInplaceContext context)
Computes the preferred size for the panel.
|
static Dimension |
getPreferredSize(javax.swing.JTextField textField,
AuthorInplaceContext context)
Computes the preferred size for the given text field.
|
static void |
relayout(javax.swing.JComboBox comboBox,
AuthorInplaceContext context)
Computes the required size for the editor and positions the caret at the
end of the text.
|
static void |
relayout(javax.swing.JTextField textField,
AuthorInplaceContext context)
Computes the required size for the editor and positions the caret at the
end of the text.
|
static void |
setCaretAtEnd(javax.swing.text.JTextComponent textField,
AuthorInplaceContext context)
Sets the caret at the end of the text from the text field.
|
public static Dimension getPreferredSize(javax.swing.JPanel panel, AuthorInplaceContext context)
panel
- A panel used as an editor.context
- In-place editing context.public static Dimension getPreferredSize(javax.swing.JComboBox comboBox, AuthorInplaceContext context)
comboBox
- A combo box used as an editor.context
- In-place editing context.public static Dimension getPreferredSize(javax.swing.JTextField textField, AuthorInplaceContext context)
textField
- A text field used as an editor.context
- In-place editing context.public static void relayout(javax.swing.JComboBox comboBox, AuthorInplaceContext context)
comboBox
- Combo box used for editing.context
- In-place editing context.public static void relayout(javax.swing.JTextField textField, AuthorInplaceContext context)
textField
- Text field used for editing.context
- In-place editing context.public static void setCaretAtEnd(javax.swing.text.JTextComponent textField, AuthorInplaceContext context)
textField
- Text field to be scrolled.context
- In-place editing context.public static java.awt.Dimension getPreferredSize(java.awt.Component component, java.awt.Container parent)
component
- The component.parent
- The parent component, where the component will eventually be added.public static <T> T addToParent(java.awt.Component component, java.awt.Container parent, java.util.function.Supplier<T> supplier)
component
- The component.parent
- The parent component, where the component will eventually be added.supplier
- To be invoked.© Copyright Syncro Soft SRL 2002 - 2021. All rights reserved.