Methods Summary |
---|
void | createNativeResource(int ownerId)Create native resource for current TextField .
Override function in ItemLFImpl .
nativeId = createNativeResource0(ownerId,
tf.label,
(tf.owner instanceof TextBox ?
-1 : tf.layout),
tf.buffer,
tf.constraints,
tf.initialInputMode);
|
private native int | createNativeResource0(int ownerId, java.lang.String label, int layout, com.sun.midp.lcdui.DynamicCharacterArray buffer, int constraints, java.lang.String initialInputMode)KNI function that create native resource for current
TextField .
|
boolean | equateNLA()Determine if this Item should have a newline after it.
if (super.equateNLA()) {
return true;
}
return ((tf.layout & Item.LAYOUT_2) != Item.LAYOUT_2);
|
boolean | equateNLB()Determine if this Item should have a newline before it.
if (super.equateNLB()) {
return true;
}
return ((tf.layout & Item.LAYOUT_2) != Item.LAYOUT_2);
|
private native int | getCaretPosition0(int nativeId)Gets the current input position from native widget.
|
private native boolean | getString0(int nativeId, com.sun.midp.lcdui.DynamicCharacterArray buffer)Get current contents from native resource.
|
public void | itemDeleted()Notifies item that it has been recently deleted
Traverse out the textFieldLF.
uCallTraverseOut();
|
public void | lDelete(int offset, int length)Notifies L&F of character deletion in the corresponding
TextField .
// Simplify porting layer by treating delete as setChars
lSetChars();
|
public int | lGetCaretPosition()Gets the current input position.
return (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID)
? getCaretPosition0(nativeId)
: tf.buffer.length();
|
public int | lGetPreferredHeight(int w)Override the preferred height of this Item .
// note: w is not used
int h = super.lGetPreferredHeight(w);
// For TextBox return all height available for the item
if (tf.owner instanceof TextBox) {
if (((DisplayableLFImpl)tf.owner.getLF()).height > h) {
h = ((DisplayableLFImpl)tf.owner.getLF()).height;
}
}
return h;
|
public int | lGetPreferredWidth(int h)Override the preferred width of this Item .
// note: h is not used
// For TextBox return all width available for the item
if (tf.owner instanceof TextBox) {
return ((DisplayableLFImpl)tf.owner.getLF()).width;
}
return super.lGetPreferredWidth(h);
|
void | lHideNativeResource()Override ItemLFImpl method to sync with native resource
before hiding the native resource.
lUpdateContents();
super.lHideNativeResource();
|
public void | lInsert(char[] data, int offset, int length, int position)Notifies L&F of a character insertion in the corresponding
TextField .
// Simplify porting layer by treating insert as setChars
lSetChars();
|
public void | lSetChars()Notifies L&F of a content change in the corresponding
TextField .
The parameters are not used. Instead, this function directly
uses data from TextField.java.
// Only update native resource if it exists.
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
setString0(nativeId, tf.buffer);
}
lRequestInvalidate(true, true);
|
public void | lSetConstraints()Notifies L&F that constraints have to be changed.
// Only update native resource if it exists.
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
setConstraints0(nativeId, tf.constraints);
}
// note: int some implementation this method call may affect
// the layout, and int this case such a call will be needed:
// lRequestInvalidate(true, true);
|
public void | lSetInitialInputMode(java.lang.String characterSubset)Notifies L&F that preferred initial input mode was changed.
// No visual impact
|
public void | lSetMaxSize(int maxSize)Notifies L&F of a maximum size change in the corresponding
TextField .
// Only update native resource if it exists.
if (nativeId != DisplayableLFImpl.INVALID_NATIVE_ID) {
setMaxSize0(nativeId, maxSize);
}
lRequestInvalidate(true, true);
|
public boolean | lUpdateContents()Update the character buffer in TextField with latest
user input.
// No pending user input when there is no native resource or not shown
if (nativeId == DisplayableLFImpl.INVALID_NATIVE_ID) {
return false;
}
// Query native resource for pending user input
return getString0(nativeId, tf.buffer);
|
public boolean | lValidate(com.sun.midp.lcdui.DynamicCharacterArray buffer, int constraints)Validate a given character array against a constraints.
return TextPolicy.isValidString(buffer, constraints);
|
private native void | setConstraints0(int nativeId, int constraints)Set input constraints of the native widget.
|
private native void | setMaxSize0(int nativeId, int maxSize)Set new maximum size of the native widget.
|
private native void | setString0(int nativeId, com.sun.midp.lcdui.DynamicCharacterArray buffer)Update content and caret position of the TextField's native widget.
|
boolean | uCallPeerStateChanged(int hint)Called by event delivery to notify an ItemLF in current
FormLF of a change in its peer state.
return true;
|