public final class ImString
extends java.lang.Object
implements java.lang.Cloneable
String
to use inside of th Dear ImGui input widgets.Modifier and Type | Class and Description |
---|---|
static class |
ImString.InputData
Use this class to customize your ImGui input.
|
Modifier and Type | Field and Description |
---|---|
static short |
CARET_LEN
Size of ImGui caret which is shown during the input text focus.
|
static short |
DEFAULT_LENGTH
Default size of the inner buffer, if
ImString created with a constructor without args. |
ImString.InputData |
inputData
Configuration class to setup some specific behaviour for current string.
|
Constructor and Description |
---|
ImString()
Creates an
ImString instance with DEFAULT_LENGTH size for the inner buffer. |
ImString(ImString imString) |
ImString(int length)
Creates an
ImString instance with provided size for the inner buffer. |
ImString(java.lang.String text)
Creates an
ImString instance from provided string. |
ImString(java.lang.String text,
int length)
Create an
ImString instance from provided string with custom size for the inner buffer. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears underlying string by setting empty value.
|
ImString |
clone() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
get() |
int |
getBufferSize()
Get the size of the data buffer.
|
byte[] |
getData() |
int |
getLength()
Get the length of the text inside of the data buffer.
|
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isNotEmpty() |
void |
resize(int newSize) |
void |
set(ImString value) |
void |
set(ImString value,
boolean resize) |
void |
set(java.lang.Object object) |
void |
set(java.lang.String value) |
void |
set(java.lang.String value,
boolean resize) |
void |
set(java.lang.String value,
boolean resize,
int resizeValue) |
java.lang.String |
toString() |
public static final short DEFAULT_LENGTH
ImString
created with a constructor without args.public static final short CARET_LEN
public final ImString.InputData inputData
public ImString()
ImString
instance with DEFAULT_LENGTH
size for the inner buffer.public ImString(ImString imString)
public ImString(int length)
ImString
instance with provided size for the inner buffer.length
- size of the inner buffer to usepublic ImString(java.lang.String text)
ImString
instance from provided string.
Inner buffer size will be equal to the length of the string + CARET_LEN
.text
- string to create a new ImString
public java.lang.String get()
public byte[] getData()
public void set(java.lang.Object object)
public void set(ImString value)
public void set(ImString value, boolean resize)
public void set(java.lang.String value)
public void set(java.lang.String value, boolean resize)
public void set(java.lang.String value, boolean resize, int resizeValue)
public void resize(int newSize)
public int getLength()
public int getBufferSize()
public boolean isEmpty()
public boolean isNotEmpty()
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ImString clone()
clone
in class java.lang.Object