public EditWebAccountForm( Model model, Controller controller, ExternalNetwork nw, Identity iden, Style style) { super(model, controller, null, style); this.network = nw; this.iden = iden; // #style webaccount_edit_headline Container info = new Container(false); info.setAppearanceMode(Item.PLAIN); // constructs network icon and sets default style to focused/'white' IconItem networkIcon = UiFactory.createNetworkIcon( (null != this.network ? this.network.getNetworkId() : ""), false); networkIcon.setStyle(networkIcon.getFocusedStyle()); networkIcon.setAppearanceMode(Item.PLAIN); info.add(networkIcon); info.add( // #style webaccount_edit_headline_text new StringItem( null, (null != this.network ? this.network.getName() : "") + " " + Locale.get("nowplus.client.java.webaccounts.edit.info.suffix"))); this.append(info); String credentialsLabel = null; if (nw.getCredentialsType() == ExternalNetwork.CREDENTIALS_USERNAME) { credentialsLabel = Locale.get("nowplus.client.java.webaccounts.edit.username"); } else if (nw.getCredentialsType() == ExternalNetwork.CREDENTIALS_USERNAME_OR_EMAIL) { credentialsLabel = Locale.get("nowplus.client.java.webaccounts.edit.username_email"); } // add username textfield this.usernameTextField = UiFactory.createTextField( null, null, 128, TextField.ANY | TextField.INITIAL_CAPS_NEVER, this); // fix for PBLA-816 Touch device: predictive text while disabling the surepress // #if polish.blackberry this.usernameTextField.setNoComplexInput(true); // #endif // #if using.native.textfield:defined this.usernameTextField.setTitle(credentialsLabel); // #if (${lowercase(polish.vendor)}==samsung) UiFactory.fixSamsungNativeTextField(this.usernameTextField); // #endif // #endif // check for existing username if (null == this.iden) { this.usernameTextField.setHelpText(credentialsLabel); // #if polish.blackberry // #style ui_factory_textfield_helpfont usernameTextField.setHelpStyle(); // #endif } else { this.usernameTextField.setString(this.iden.getName()); // username uneditable in 'edit mode' // this.usernameTextField.setAppearanceMode(Item.PLAIN); } // add password textfield this.passwordTextField = UiFactory.createTextField( null, null, 128, TextField.NON_PREDICTIVE | TextField.INITIAL_CAPS_NEVER | TextField.PASSWORD, this); // #if using.native.textfield:defined this.passwordTextField.setTitle(Locale.get("nowplus.client.java.webaccounts.edit.password")); // #if (${lowercase(polish.vendor)}==samsung) UiFactory.fixSamsungNativeTextField(this.passwordTextField); // #elif polish.device.textField.requires.initialCapsNeverFix UiFactory.fixS40NativeTextField(this.passwordTextField); // #endif // #endif // check for existing password this.passwordTextField.setHelpText(Locale.get("nowplus.client.java.webaccounts.edit.password")); // #if polish.blackberry // #style ui_factory_textfield_helpfont this.passwordTextField.setHelpStyle(); // #endif // #if polish.blackberry removeCommand(cmdBack); // #style ui_factory_button_item StringItem loginButton = UiFactory.createButtonItem( null, cmdLogin.getLabel(), (de.enough.polish.ui.Command) cmdLogin, null, null); append(loginButton); // #endif // adding disclaimer for given network if (null != this.network) { String[] disclaimer = this.network.getDisclaimer(); if (disclaimer[0] != null) { // #style .webaccount_edit_disclaimer_header this.append(disclaimer[0]); } for (int i = 1; i < disclaimer.length; i++) { // #style .webaccount_edit_disclaimer_text this.append(disclaimer[i]); } } // #if !polish.blackberry this.addCommand(cmdLogin); this.addCommand(cmdBack); // #endif }