本文整理汇总了Java中javax.microedition.lcdui.TextField.ANY属性的典型用法代码示例。如果您正苦于以下问题:Java TextField.ANY属性的具体用法?Java TextField.ANY怎么用?Java TextField.ANY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.microedition.lcdui.TextField
的用法示例。
在下文中一共展示了TextField.ANY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createView
public void createView() {
//#if javarosa.usepolishlocalisation
//setHint(Locale.get("hint.TypeOrScan"));
//#else
setHint("Type in your answer");
//#endif
//#style textBox
tf = new TextField("", "", 200, TextField.ANY);
if(qDef.instanceNode.required)
tf.setLabel("*"+((QuestionDef)qDef.element).getLongText()); //visual symbol for required
else
tf.setLabel(((QuestionDef)qDef.element).getLongText());
this.append(tf);
this.addNavigationButtons();
if (((QuestionDef)qDef.element).getHelpText()!=null){
setHint(((QuestionDef)qDef.element).getHelpText());
}
}
示例2: SendGui
/**
*
* Constructor
*/
public SendGui(){
super("Write a message");
// Creating the Commands
sendTextPackage = new Command("Send",Command.ITEM,1);
displayLog = new Command("View log",Command.ITEM,4);
exit = new Command("Exit", Command.EXIT,0);
search = new Command("Search", Command.OK, 1);
input = new TextField("Message","",200,TextField.ANY);
// The ChoiceGroup containing the connected Nodes
connectedNodes = new ChoiceGroup("Choose recipients", Choice.MULTIPLE);
// Adding the elements
addCommand(sendTextPackage);
addCommand(displayLog);
addCommand(exit);
addCommand (search) ;
append(connectedNodes);
append(input);
}
示例3: RecordStoreForm
public RecordStoreForm() {
super("RecordStore");
addCommand(loadCommand);
addCommand(storeCommand);
addCommand(deleteCommand);
addCommand(listCommand);
textFiled = new TextField("Enter data", "", 128, TextField.ANY);
append(textFiled);
stringItem = new StringItem("Loaded data", "n/a");
append(stringItem);
messageItem = new StringItem("Info:", "Use menu to load and store data");
append(messageItem);
}
示例4: setInputMethodListener
public void setInputMethodListener(InputMethodListener l)
{
inputMethodListener = l;
switch (l.getConstraints() & TextField.CONSTRAINT_MASK) {
case TextField.ANY :
case TextField.EMAILADDR :
case TextField.URL :
setInputMode(INPUT_ABC_LOWER);
break;
case TextField.NUMERIC :
case TextField.PHONENUMBER :
case TextField.DECIMAL :
setInputMode(INPUT_123);
break;
}
}
示例5: SubmitForm
/**
* Constructor ErrorPrompt.
*
* @param parent ...
*/
public SubmitForm(MIDlet parent, LSClient client, ErrorPrompt errorPrompt) {
this.errorPrompt = errorPrompt;
this.client = client;
messageListener = new SentListener();
close = new Command("Back", Command.STOP, 2);
send = new Command("Send", Command.OK, 1);
sendForm = new Form("RoundTrip Form");
text = new TextField("Write message","",100,TextField.ANY);
sendForm.append(text);
field = new ChoiceGroup("Select Item",Choice.EXCLUSIVE,new String[]{"1","2","3","4","5"},null);
sendForm.append(field);
sendForm.addCommand(close);
sendForm.addCommand(send);
sendForm.setCommandListener(this);
midlet = parent;
reset();
}
示例6: setupFields
private void setupFields() {
titleField = new TextField("Title", "", 32, TextField.ANY);
contentField = new TextField("Content", "", 128, TextField.ANY);
dateField = new DateField("Date", DateField.DATE);
categoryField = new ChoiceGroup("Category", Choice.EXCLUSIVE, Category.elements, null);
priorityField = new Gauge("Priority", true, 10, 5);
this.append(titleField);
this.append(contentField);
this.append(dateField);
this.append(categoryField);
this.append(priorityField);
}
示例7: initTextFied
private TextField initTextFied(String title) {
final String tfTitle = (title == null) ? "Enter text:" : title;
TextField tf = new TextField(tfTitle, "", 8192, TextField.ANY);
tf.addCommand(CMDTEXT_OK);
tf.setDefaultCommand(CMDTEXT_OK);
tf.setItemCommandListener(this);
return tf;
}
示例8: UserForm
public UserForm(String title, IUserDecorator d) {
super(title);
this.usernameField = new TextField(Localization.get("form.user.name"), "", 25,
TextField.ANY);
this.passwordField = new TextField(Localization.get("form.user.password"), "", 10,
TextField.PASSWORD);
this.confirmPasswordField = new TextField(Localization.get("form.user.confirmpassword"), "",
10, TextField.PASSWORD);
//#if javarosa.adduser.extended
this.userIDField = new TextField(Localization.get("form.user.userid"), "", 10,
TextField.NUMERIC);
//#endif
this.choice.append(Localization.get("form.user.giveadmin"), null);
append(this.usernameField);
append(this.passwordField);
append(this.confirmPasswordField);
//#if javarosa.adduser.extended
append(this.userIDField);
//#endif
this.decorator = d;
if (d != null) {
initMeta();
}
append(this.choice);
}
示例9: MainGui
/**
*
* Constructor Extends Form to be able to display different GUI elements
*
*/
public MainGui(){
super(midletName);
ok = new Command("Ok", Command.OK, 0);
displayLog = new Command("View Log", Command.OK, 4);
search = new Command("Search", Command.OK, 1);
exit = new Command("Exit", Command.EXIT,0);
text = new TextField("Name", "Per Tome", 30, TextField.ANY);
append(text);
addCommand(ok);
addCommand(displayLog);
addCommand(exit);
}
示例10: MainGui
/**
*
* Constructor Extends Form to be able to display different GUI elements
*
*/
public MainGui(){
super(midletName);
ok = new Command("Ok", Command.OK, 0);
displayLog = new Command("View Log", Command.OK, 4);
// search = new Command("Search", Command.OK, 1);
exit = new Command("Exit", Command.EXIT,0);
text = new TextField("Name", "Per Tome", 30, TextField.ANY);
append(text);
addCommand(ok);
addCommand(displayLog);
addCommand(exit);
}
示例11: FileEditor
public FileEditor(FileConnection fc, Displayable back) {
super("Edit " + fc.getName(), null, 128, TextField.ANY);
this.back = back;
addCommand(saveCommand);
addCommand(backCommand);
setCommandListener(this);
file = fc;
load();
}
示例12: AddAccountForm
public AddAccountForm() {
super("Add an account");
userName = new TextField("Screenname:", "", 15, TextField.ANY);
password = new TextField("Password:", "", 30, TextField.PASSWORD);
append(userName);
append(password);
addCommand(new Command("Save", "Add account", Command.OK, 2));
addCommand(new Command("Cancel", "Cancel", Command.BACK, 1));
}
示例13: createLogPanel
/**
* Create a simple text area where publications are displayed as they arrive.
*/
public void createLogPanel() {
if ( logPanel == null ) {
TextBox t = new TextBox("Log:", null, 128, TextField.ANY );
t.addCommand( cancel );
t.setCommandListener(this);
logPanel = t;
}
}
示例14: filterConstraints
protected char[] filterConstraints(char[] chars) {
char[] result = new char[chars.length];
int i, j;
for (i = 0, j = 0; i < chars.length; i++) {
switch (inputMethodListener.getConstraints() & TextField.CONSTRAINT_MASK) {
case TextField.ANY :
result[j] = chars[i];
j++;
break;
case TextField.EMAILADDR :
// TODO
break;
case TextField.NUMERIC :
if (Character.isDigit(chars[i]) || chars[i] == '-') {
result[j] = chars[i];
j++;
}
break;
case TextField.PHONENUMBER :
// TODO
break;
case TextField.URL :
if (chars[i] != '\n') {
result[j] = chars[i];
j++;
}
break;
case TextField.DECIMAL :
if (Character.isDigit(chars[i]) || chars[i] == '-' || chars[i] == '.') {
result[j] = chars[i];
j++;
}
break;
}
}
if (i != j) {
char[] newresult = new char[j];
System.arraycopy(result, 0, newresult, 0, j);
result = newresult;
}
return result;
}
示例15: MIDPTextBox
public MIDPTextBox(String mainbar, String text, TextBoxNotify tbn) {
this(mainbar, text, tbn, TextField.ANY);
}