MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / AccountForm

Method AccountForm

src/main/java/Account/AccountForm.java:98–157  ·  view source on GitHub ↗

Creates a new instance of AccountForm @param accountSelect @param item

(final AccountSelect accountSelect, AccountItem item)

Source from the content-addressed store, hash-verified

96 * @param item
97 */
98 public AccountForm(final AccountSelect accountSelect, AccountItem item) {
99 super(null);
100 this.accountSelect = accountSelect;
101 this.item = item;
102 newaccount = (this.item == null);
103 if (newaccount) {
104 this.item = new AccountItem(new Account());
105 }
106
107 mainbar.setElementAt((newaccount) ? SR.MS_NEW_ACCOUNT : (this.item.toString()), 0);
108
109 userbox = new TextInput(SR.MS_JID, newaccount ?
110 ""
111 : this.item.account.JID.getBare(), null);
112 itemsList.addElement(userbox);
113
114 passbox = new PasswordInput(SR.MS_PASSWORD, newaccount? "" : this.item.account.password);
115 itemsList.addElement(passbox);
116
117 nickbox = new TextInput(SR.MS_NICKNAME, this.item.account.nick, null);
118 itemsList.addElement(nickbox);
119
120 linkRegister = new LinkString(SR.MS_REGISTER_ACCOUNT) {
121
122 public void doAction() {
123 new AccountRegister(accountSelect);
124 }
125 };
126
127 if (newaccount) {
128 itemsList.addElement(linkRegister);
129 }
130
131//#ifdef IMPORT_EXPORT
132 final BrowserListener listener = this;
133 linkImport = new LinkString(SR.MS_LOAD_FROM_FILE) {
134
135 public void doAction() {
136 new Browser(null, listener, false);
137 }
138 };
139 itemsList.addElement(linkImport);
140//#endif
141
142 linkShowExtended = new LinkString(SR.MS_EXTENDED_SETTINGS) {
143
144 public void doAction() {
145 showExtended();
146 }
147 };
148 itemsList.addElement(linkShowExtended);
149
150 linkSave = new LinkString(SR.MS_SAVE) {
151
152 public void doAction() {
153 cmdOk();
154 }
155 };

Callers

nothing calls this directly

Calls 4

setElementAtMethod · 0.80
getBareMethod · 0.80
addElementMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected