private void initForm(boolean firstLogin) { // #if !polish.blackberry this.addCommand(cmdSave); if (firstLogin) this.addCommand(cmdCancel); else this.addCommand(cmdExit); // #endif StringItem headLine; // #if polish.blackberry // #if polish.blackberry.isTouchBuild == false // #style .login_headline headLine = new StringItem(null, Locale.get("nowplus.client.java.loginform.headline")); this.append(headLine); // #endif // #else // #style .login_headline headLine = new StringItem(null, Locale.get("nowplus.client.java.loginform.headline")); this.append(headLine); // #endif // #if polish.blackberry && polish.blackberry.isTouchBuild == false headLine.setAppearanceMode(Item.PLAIN); // #endif String usernameString = model.getUserName(); String passwordString = ""; // #if username:defined // #message Username is set // #= usernameString = "${username}"; // #endif // #if password:defined // #message Password is set // #= passwordString = "${password}"; // #endif if (usernameString == null) usernameString = ""; if (passwordString == null) passwordString = ""; // username textfield // #if polish.blackberry userName = UiFactory.createTextField( Locale.get("nowplus.client.java.loginform.username.hint"), usernameString, 255, TextField.NON_PREDICTIVE, this); // fix for PBLA-816 Touch device: predictive text while disabling the surepress userName.setNoComplexInput(true); // #else userName = UiFactory.createTextField(null, usernameString, 255, TextField.NON_PREDICTIVE, this); // #endif UiAccess.setTextfieldHelp(userName, Locale.get("nowplus.client.java.loginform.username.hint")); // #if using.native.textfield:defined userName.setTitle(Locale.get("nowplus.client.java.loginform.username.hint")); // #if (${lowercase(polish.vendor)}==samsung) UiFactory.fixSamsungNativeTextField(userName); // #endif // #endif if (userName.getText().length() > 0) { // Change username textfield into uneditable field once authenticated once to keep users from // switching username userName.setConstraints(TextField.NON_PREDICTIVE | TextField.UNEDITABLE); usernameReadonly = true; // #if not polish.blackberry // #style .login_textfield_readonly // #= userName.setStyle(); // #endif } // password textfield // #if polish.blackberry passWord = UiFactory.createTextField( Locale.get("nowplus.client.java.loginform.password.hint"), passwordString, 255, TextField.NON_PREDICTIVE | TextField.INITIAL_CAPS_NEVER | TextField.PASSWORD, this); // #else passWord = UiFactory.createTextField( null, passwordString, 255, TextField.INITIAL_CAPS_NEVER | TextField.PASSWORD, this); // #endif UiAccess.setTextfieldHelp(passWord, Locale.get("nowplus.client.java.loginform.password.hint")); // #if using.native.textfield:defined passWord.setTitle(Locale.get("nowplus.client.java.loginform.password.hint")); // #if (${lowercase(polish.vendor)}==samsung) UiFactory.fixSamsungNativeTextField(passWord); // #elif polish.device.textField.requires.initialCapsNeverFix:defined UiFactory.fixS40NativeTextField(passWord); // #endif // #endif rememberMeItem = UiFactory.createChoiceCheckBoxItem( Locale.get("nowplus.client.java.loginform.rememberme.label"), Choice.MULTIPLE); rememberMeItem.select(model.stayLoggedIn()); UiFactory.createChoiceGroup( null, ChoiceGroup.MULTIPLE, new ChoiceItem[] {rememberMeItem}, 0, rememberMeItem.isSelected, null, this); // #if !polish.blackberry if (usernameReadonly) { this.focus(passWord); } // #endif // #if polish.blackberry // #style ui_factory_button_item StringItem loginButton = UiFactory.createButtonItem( null, cmdSave.getLabel(), (de.enough.polish.ui.Command) cmdSave, null, null); append(loginButton); if (firstLogin) { cmdQuit = cmdCancel; } else { cmdQuit = cmdExit; } // #endif }