|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.view.win.swing.text.LyJFormat
public class LyJFormat
This class implements a mask format.
The format is : '[' number '-' number ']' ( sep '[' number '-' number ']' )* where variable
number is a positive number and sep is String that can be "".
LyFormattedField
Nested Class Summary | |
---|---|
class |
LyJFormat.Interval
This class implements a representation of an interval with min and max values. |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
char |
EMPTY_CHAR
Define the empty character. |
Constructor Summary | |
---|---|
LyJFormat()
Constructor. |
|
LyJFormat(java.lang.String format)
Constructor. |
Method Summary | |
---|---|
void |
clear()
Clears the content. |
java.lang.String |
getDisplayableString(boolean hasFocus)
Gets the String to display in the text field. |
int |
getIndexIntervalFromOffset(int offset)
Gets the index of the last interval that contains the position of the given offset in the textField. |
int |
getIndexSeparatorFromOffset(int offset)
Gets the index of the last separator that contains the position of the given offset in the textFieldt. |
LyJFormat.Interval |
getInterval(int i)
Gets the interval at the given index. |
int |
getIntervalsCount()
Gets the number of intervals. |
int |
getIntValue(int offset)
Gets the value at the given position offset as an int. |
int |
getMaxIntValue(int offset)
Gets the maximum value at the given position offset. |
int |
getMinIntValue(int offset)
Gets the minimum value at the given position offset. |
java.lang.String |
getSeparator(int i)
Gets the separator at the given index. |
boolean |
isAllEmpty()
Indicates that all intervals are empty or not. |
boolean |
isCharDeletionValid(int offset)
Indicates that the char at the given position offset can be removed. |
boolean |
isCharInsertionValid(char c,
int offset)
Indicates that the given character can be inserted at the given position. offset. |
void |
parseString(java.lang.String format)
Parses the String that defines the format and build the compiled version of the format. |
int |
replaceChar(int offset,
char c)
Finds the Interval that contains the given position offset and replace the character at that position by the given one. |
void |
setFormatString(java.lang.String format)
Sets the given format. |
void |
setIntValue(int offset,
int value)
Sets the value at the given position offset of the textComponent. |
void |
setValue(java.lang.String value)
Sets the value of this format. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public char EMPTY_CHAR
Constructor Detail |
---|
public LyJFormat()
public LyJFormat(java.lang.String format) throws LyJBadFormatException
LyJFormat()
and parses the
given format (parseString(String)
).
format
- the String that defines the format
LyJBadFormatException
Method Detail |
---|
public void setFormatString(java.lang.String format) throws LyJBadFormatException
parseString(String)
.
format
- the String that defines the format
LyJBadFormatException
parseString(String)
public void parseString(java.lang.String format) throws LyJBadFormatException
format
- the String to parse
LyJBadFormatException
public LyJFormat.Interval getInterval(int i)
i
- the index of the wanted interval
public java.lang.String getSeparator(int i)
i
- the index of the wanted separator
public int getIntervalsCount()
public int getIndexIntervalFromOffset(int offset)
offset
- the offset
public int getIndexSeparatorFromOffset(int offset)
offset
- the offset
public boolean isCharDeletionValid(int offset)
offset
- the offset
public boolean isCharInsertionValid(char c, int offset)
c
- the character to insertoffset
- the offset
public int replaceChar(int offset, char c)
offset
- the offsetc
- the character
public java.lang.String getDisplayableString(boolean hasFocus)
hasFocus
- is true if the textField has the focus
public boolean isAllEmpty()
public int getIntValue(int offset)
offset
- the pos of the caret used to determine which interval is the current interval
setIntValue(int, int)
public void setIntValue(int offset, int value)
offset
- the pos of the caret used to determine which interval is the current intervalvalue
- the value to setgetIntValue(int)
public int getMinIntValue(int offset)
offset
- the pos of the caret used to determine which interval is the current interval
public int getMaxIntValue(int offset)
offset
- the pos of the caret used to determine which interval is the current interval
public void setValue(java.lang.String value)
value
- the new value of the formatpublic void clear()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |