public class Textbox extends HScrollContainer
Control.Constants, Control.ImageMode, Control.Predicate, Control.Predicate1<T>, Control.Predicate2<T,U>, Control.RenderingMethod, Control.Setter<T>| Modifier and Type | Field and Description |
|---|---|
boolean |
submitOnEnter |
FONT_SIZE, LINE_HEIGHT, TEXT_ALIGN, TEXT_ALIGN_Y, TEXT_COLORALL, ANCHOR_INACTIVE, AUTOSIZE_BOTH, AUTOSIZE_HEIGHT, AUTOSIZE_NONE, AUTOSIZE_WIDTH, BACKGROUND_COLOR, BACKGROUND_COLORS, BORDER, BORDER_COLOR, BORDER_RADIUS, BORDER_WIDTH, BUFFERED_RENDERING, COLORS, defaultRenderingMethod, FILL, FIT, FIT_INSIDE, FOREGROUND_COLOR, HOVER_COLOR, MARGIN, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, name, OPACITY, PADDING, PADDING_BOTTOM, PADDING_LEFT, PADDING_RIGHT, PADDING_TOP, PERCENTAGE_MODE, PIXEL_MODE, PRESSED_COLOR, SPACING, TEXT_PROPERTIES, UNBUFFERED_RENDERING| Constructor and Description |
|---|
Textbox() |
Textbox(int width) |
Textbox(int width,
int fontSize) |
Textbox(java.lang.String hint) |
Textbox(java.lang.String hint,
int width) |
Textbox(java.lang.String hint,
int width,
int fontSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy()
Copy selection to clipboard
|
void |
cut()
Cut selection and copy to clipboard
|
void |
disableInput()
Prevent user from typing or pasting text while maintaining the ability of selecting and copying.
|
void |
enableInput()
Undo
disableInput() |
int |
getCursorColor() |
int |
getCursorPosition() |
static int |
getGlobalCursorCycleTime() |
java.lang.String |
getHint() |
java.lang.String |
getSelectedText() |
int |
getSelectionColor() |
int |
getSelectionEnd() |
int |
getSelectionStart() |
void |
paste()
Paste from clipboard (and delete selection)
|
void |
removeKeyPressListener() |
void |
removeSubmitListener() |
void |
removeTextChangeListener() |
void |
setCursorColor(int cursorColor)
Set the color of the cursor.
|
void |
setCursorPosition(int cursorPosition)
Set the cursor to a specific index position in the text.
|
static void |
setGlobalCursorCycleTime(int milliseconds)
Set the time the cursor needs to blink on and off in milliseconds, default is 1000 (1 second).
|
void |
setHint(java.lang.String hint)
Set a hint for the textbox that is displayed when the textbox is empty.
|
void |
setKeyPressListener(Control.Predicate lambda)
Set a lambda key listener to the textbox.
|
void |
setKeyPressListener(Control.Predicate1<KeyEvent> lambda)
Set a lambda key listener to the textbox.
|
void |
setKeyPressListener(java.lang.String methodName) |
void |
setKeyPressListener(java.lang.String methodName,
java.lang.Object target)
Set a key listener to the textbox.
|
void |
setSelection(int start,
int end)
Set selection.
|
void |
setSelectionColor(int selectionColor)
Set highlight color of selection.
|
void |
setSelectionEnd(int selectionEnd)
Set the end for the text selection.
|
void |
setSelectionStart(int selectionStart)
Set the start for the text selection.
|
void |
setSubmitListener(Control.Predicate lambda)
So long as the property
submitOnEnter is set to true, pressing enter or return will
remove the focus of the textbox and call this event. |
void |
setSubmitListener(java.lang.String methodName) |
void |
setSubmitListener(java.lang.String methodName,
java.lang.Object target)
So long as the property
submitOnEnter is set to true, pressing enter or return will
remove the focus of the textbox and call this event. |
void |
setText(java.lang.String text)
Set the text content.
|
void |
setTextChangeListener(Control.Predicate lambda)
Set a lambda listener that fires when the text has actually changed (not just the cursor or
selection).
|
void |
setTextChangeListener(java.lang.String methodName) |
void |
setTextChangeListener(java.lang.String methodName,
java.lang.Object target)
Set a listener that fires when the text has actually changed (not just the cursor or selection).
|
getAvailableHeight, getFullScrollWidth, getScrollPosition, getScrollSpeed, isSlimScrollHandle, scrollToItem, scrollToItem, setScrollPosition, setScrollSpeed, setSlimScrollHandleadd, clear, fitContent, getItem, getItems, getNumItems, indexOf, insert, remove, remove, sortItems, traceAbsoluteCoordinates, traceRelativeCoordinatescopyStyle, getFont, getFontSize, getLineHeight, getText, getTextAlign, getTextAlignY, getTextColor, isBold, isItalic, isStrikethrough, isUnderlined, setBold, setFont, setFontSize, setForegroundColor, setItalic, setLineHeight, setLineHeightPercent, setStrikethrough, setText, setTextAlign, setTextAlignY, setTextColor, setUnderlinedaddAutoAnchors, animate, blur, copyStyle, doForAll, fillParent, fillParent, fillParent, fillParentHeight, fillParentHeight, fillParentWidth, fillParentWidth, focus, forceRepaint, getAnchorMode, getAnchorValue, getAvailableWidth, getBackgroundColor, getBorderColor, getBorderRadius, getBorderWidth, getCursor, getForegroundColor, getHeight, getHoverColor, getImage, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOffsetXToParent, getOffsetXToWindow, getOffsetYToParent, getOffsetYToWindow, getOpacity, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getPressedColor, getVersionString, getWidth, getX, getY, getZ, isEnabled, isFocusable, isFocused, isPropagationStopped, isVisible, noAutosize, relativeCoordsAreWithin, removeAnchor, removeBoxShadow, removeFocusListener, removeMouseListener, removeResizeListener, setAnchor, setAnchors, setAutosizing, setBackgroundColor, setBorder, setBorder, setBorderColor, setBorderRadius, setBorderWidth, setBoxShadow, setCursor, setEnabled, setFixedSize, setFocusListener, setFocusListener, setFocusListener, setFocusListener, setGradient, setHeight, setHeight, setHoverColor, setImage, setImageMode, setMargin, setMargin, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setMouseListener, setMouseListener, setMouseListener, setMouseListener, setOpacity, setOpacity, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPercentageAnchor, setPercentageAnchors, setPixelAnchor, setPixelAnchors, setPosition, setPressedColor, setResizeListener, setResizeListener, setResizeListener, setResizeListener, setSize, setVisibility, setVisible, setWidth, setWidth, setX, setY, setZ, stopPropagation, unfocuspublic Textbox()
public Textbox(java.lang.String hint)
public Textbox(java.lang.String hint,
int width)
public Textbox(java.lang.String hint,
int width,
int fontSize)
public Textbox(int width)
public Textbox(int width,
int fontSize)
public void setCursorColor(int cursorColor)
cursorColor - rgb integer colorpublic void setCursorPosition(int cursorPosition)
cursorPosition - cusor positionpublic void setSelectionStart(int selectionStart)
selectionStart - selection start positionpublic void setSelectionEnd(int selectionEnd)
selectionEnd - selection end positionpublic void setSelection(int start,
int end)
start - selection start positionend - selection end positionpublic void setSelectionColor(int selectionColor)
selectionColor - rgb integer colorpublic void setHint(java.lang.String hint)
hint - hintpublic void setText(java.lang.String text)
TextBasedpublic void disableInput()
public void enableInput()
disableInput()public static void setGlobalCursorCycleTime(int milliseconds)
milliseconds - time in millisecondspublic int getCursorColor()
public int getCursorPosition()
public int getSelectionColor()
public int getSelectionStart()
public int getSelectionEnd()
public java.lang.String getSelectedText()
public java.lang.String getHint()
public static int getGlobalCursorCycleTime()
public void setKeyPressListener(java.lang.String methodName,
java.lang.Object target)
KeyEventmethodName - name of callback methodtarget - object that declares callback method.public void setKeyPressListener(java.lang.String methodName)
public void setKeyPressListener(Control.Predicate lambda)
lambda - lambda expressionpublic void setKeyPressListener(Control.Predicate1<KeyEvent> lambda)
KeyEventlambda - lambda expression with KeyEvent as parameterpublic void removeKeyPressListener()
public void setTextChangeListener(java.lang.String methodName,
java.lang.Object target)
methodName - name of callback methodtarget - object that declares callback method.public void setTextChangeListener(java.lang.String methodName)
public void setTextChangeListener(Control.Predicate lambda)
lambda - lambda expressionpublic void removeTextChangeListener()
public void setSubmitListener(java.lang.String methodName,
java.lang.Object target)
submitOnEnter is set to true, pressing enter or return will
remove the focus of the textbox and call this event.methodName - name of callback methodtarget - object that declares callback method.public void setSubmitListener(java.lang.String methodName)
public void setSubmitListener(Control.Predicate lambda)
submitOnEnter is set to true, pressing enter or return will
remove the focus of the textbox and call this event.
Event arguments: nonelambda - lambda expressionpublic void removeSubmitListener()
public void copy()
public void paste()
public void cut()
Processing Library guiSET by Mc Zen. (c) 2021