📄 uiaccess.java
字号:
* Sets the focus to the given index of the specified list.
* When the list is not shown, it will be shown in this call.
* When the J2ME Polish GUI is not used, only the list will be shown.
*
* @param display the display
* @param list the list
* @param index the index
*/
public static void setCurrentListIndex( Display display, javax.microedition.lcdui.List list, int index ) {
//#if !polish.blackberry && polish.usePolishGui
display.setCurrent( list );
//#endif
}
//#if polish.usePolishGui
/**
* Sets the focus to the given index of the specified list.
* When the list is not shown, it will be shown in this call.
* When the J2ME Polish GUI is not used, only the list will be shown.
*
* @param display the display
* @param list the list
* @param index the index
*/
public static void setCurrentListIndex( Display display, List list, int index ) {
Item item = list.getItem( index );
item.show( display );
}
//#endif
/**
* Applies a style to the given item if used in conjunction with the //#style preprocessing directive.
*
* Example:
* <pre>
* //#style myStyle
* UiAccess.setStyle( myItem );
* </pre>
* @param item the item which should get the new style
*/
public static void setStyle( javax.microedition.lcdui.Item item ) {
// ignore
}
/**
* Applies a style to the given screen if used in conjunction with the //#style preprocessing directive.
*
* Example:
* <pre>
* //#style myStyle
* UiAccess.setStyle( myScreen );
* </pre>
* @param screen the screen which should get the new style
*/
public static void setStyle( javax.microedition.lcdui.Screen screen ) {
// ignore
}
//#if polish.usePolishGui
/**
* Applies a style to the given item if used in conjunction with the //#style preprocessing directive.
*
* Example:
* <pre>
* //#style myStyle
* UiAccess.setStyle( myItem );
* </pre>
* @param item the item which should get the new style
*/
public static void setStyle( Item item ) {
// ignore
}
//#endif
//#if polish.usePolishGui
/**
* Applies a style to the given screen if used in conjunction with the //#style preprocessing directive.
*
* Example:
* <pre>
* //#style myStyle
* UiAccess.setStyle( myScreen );
* </pre>
* @param screen the screen which should get the new style
*/
public static void setStyle( Screen screen ) {
// ignore
}
//#endif
//#if polish.usePolishGui
/**
* Applies a style to the given item.
*
* @param item the item which should get the new style
* @param style the style
*/
public static void setStyle( Item item, Style style ) {
item.setStyle( style );
}
//#endif
//#if polish.usePolishGui
/**
* Applies a style to the given screen.
*
* @param screen the screen which should get the new style
* @param style the style
*/
public static void setStyle( Screen screen, Style style ) {
screen.setStyle( style );
}
//#endif
//#if polish.usePolishGui
/**
* Gets the current style of the given item.
*
* Example:
* <pre>
* //#if polish.usePolishGui
* Style style = UiAccess.getStyle( myItem );
* if (style != null) }
* style.background = new SimpleBackground( 0x00FF00 );
* }
* //#endif
* </pre>
* Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.
* @param item the item of which the style should be retrieved
*/
public static Style getStyle( javax.microedition.lcdui.Item item ) {
return null;
}
//#endif
//#if polish.usePolishGui
/**
* Gets the current style of the given screen.
*
* Example:
* <pre>
* //#if polish.usePolishGui
* Style style = UiAccess.getStyle( myScreen );
* if (style != null) }
* style.background = new SimpleBackground( 0x00FF00 );
* }
* //#endif
* </pre>
* Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.
* @param screen the screen of which the style should be retrieved
*/
public static Style getStyle( javax.microedition.lcdui.Screen screen ) {
return null;
}
//#endif
//#if polish.usePolishGui
/**
* Gets the current style of the given item.
*
* Example:
* <pre>
* //#if polish.usePolishGui
* Style style = UiAccess.getStyle( myItem );
* if (style != null) }
* style.background = new SimpleBackground( 0x00FF00 );
* }
* //#endif
* </pre>
* Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.
* @param item the item of which the style should be retrieved
*/
public static Style getStyle( Item item ) {
return item.style;
}
//#endif
//#if polish.usePolishGui
/**
* Gets the current style of the given screen.
*
* Example:
* <pre>
* //#if polish.usePolishGui
* Style style = UiAccess.getStyle( myScreen );
* if (style != null) }
* style.background = new SimpleBackground( 0x00FF00 );
* }
* //#endif
* </pre>
* Note: this method is only available when the J2ME Polish GUI is used, so you better check for the polish.usePolishGui prepocessing symbol.
* @param screen the screen of which the style should be retrieved
*/
public static Style getStyle( Screen screen ) {
return screen.style;
}
//#endif
//#if polish.usePolishGui
public static boolean handleKeyPressed( Item item, int keyCode, int gameAction ) {
return item.handleKeyPressed(keyCode, gameAction);
}
//#endif
//#if polish.usePolishGui
public static boolean handlePointerPressed( Item item, int x, int y ) {
//#if polish.hasPointerEvents
//# return item.handlePointerPressed(x, y);
//#else
return false;
//#endif
}
//#endif
/**
* Sets the caret position in the given text field.
* Please note that this operation requires the direct input mode to work.
*
* @param field the text field
* @param position the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.
*/
public static void setCaretPosition( javax.microedition.lcdui.TextField field, int position ) {
// ignore
}
//#if polish.usePolishGui
/**
* Sets the caret position in the given text field.
* Please note that this operation requires the direct input mode to work.
*
* @param field the text field
* @param position the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.
*/
public static void setCaretPosition( TextField field, int position ) {
field.setCaretPosition( position );
}
//#endif
/**
* Sets the caret position in the given text box.
* Please note that this operation requires the direct input mode to work.
*
* @param box the text box
* @param position the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.
*/
public static void setCaretPosition( javax.microedition.lcdui.TextBox box, int position ) {
// ignore
}
//#if polish.usePolishGui
/**
* Sets the caret position in the given text box.
* Please note that this operation requires the direct input mode to work.
*
* @param box the text box
* @param position the new caret position, 0 puts the caret at the start of the line, getString().length moves the caret to the end of the input.
*/
public static void setCaretPosition( TextBox box, int position ) {
box.textField.setCaretPosition( position );
}
//#endif
/**
* Sets the input mode for the given textfield.
* Warning: you have to ensure that the input mode matches the contraints of
* the given TextField.
*
* @param field the text field
* @param inputMode the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static void setInputMode( javax.microedition.lcdui.TextField field, int inputMode ) {
// ignore
}
//#if polish.usePolishGui
/**
* Sets the input mode for the given textfield.
* Warning: you have to ensure that the input mode matches the contraints of
* the given TextField.
*
* @param field the text field
* @param inputMode the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static void setInputMode( TextField field, int inputMode ) {
field.setInputMode( inputMode );
}
//#endif
/**
* Sets the input mode for the given textbox.
* Warning: you have to ensure that the input mode matches the contraints of
* the given TextBox.
*
* @param box the text box
* @param inputMode the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static void setInputMode( javax.microedition.lcdui.TextBox box, int inputMode ) {
// ignore
}
//#if polish.usePolishGui
/**
* Sets the input mode for the given textbox.
* Warning: you have to ensure that the input mode matches the contraints of
* the given TextBox.
*
* @param box the text box
* @param inputMode the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASEor UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static void setInputMode( TextBox box, int inputMode ) {
box.textField.setInputMode( inputMode );
}
//#endif
/**
* Retrieves the input mode for the given textfield.
*
* @param field the text field
* @return the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASEor UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static int getInputMode( javax.microedition.lcdui.TextField field ) {
return -1;
}
//#if polish.usePolishGui
/**
* Retrieves the input mode for the given textfield.
*
* @param field the text field
* @return the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static int getInputMode( TextField field ) {
return field.inputMode;
}
//#endif
/**
* Retrieves the input mode for the given textbox.
*
* @param box the text box
* @return the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static int getInputMode( javax.microedition.lcdui.TextBox box ) {
return -1;
}
//#if polish.usePolishGui
/**
* Retrieves the input mode for the given textbox.
*
* @param box the text box
* @return the input mode, either UiAccess.MODE_NUMBERS, UiAcccss.MODE_LOWERCASE, UiAccess.MODE_UPPERCASE, UiAccess.MODE_FIRST_UPPERCASE or UiAccess.MODE_NATIVE
* @see #MODE_NUMBERS
* @see #MODE_LOWERCASE
* @see #MODE_UPPERCASE
* @see #MODE_FIRST_UPPERCASE
* @see #MODE_NATIVE
*/
public static int getInputMode( TextBox box ) {
return box.textField.inputMode;
}
//#endif
/**
* Retrieves the decimal value entered with a dot as the decimal mark.
* <ul>
* <li>When the value has no decimal places it will be returned as it is: 12</li>
* <li>When the value is null, null will be returned: null</li>
* <li>When the value has decimal places, a dot will be used: 12.3</li>
* </ul>
* When the J2ME Polish GUI is not used, this method will only detect commas as possible
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -