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

Method menuAction

src/main/java/Account/AccountSelect.java:106–145  ·  view source on GitHub ↗
(MenuCommand c, VirtualList d)

Source from the content-addressed store, hash-verified

104 }
105
106 public void menuAction(MenuCommand c, VirtualList d) {
107 if (c == cmdQuit) {
108 destroyView();
109 BombusMod.getInstance().notifyDestroyed();
110 return;
111 }
112 if (c == cmdConfig) {
113 new ConfigForm();
114 }
115 if (c == cmdLogin) {
116 switchAccount(true);
117 }
118 if (c == cmdSelect) {
119 canBack = true;
120 switchAccount(false);
121 }
122 if (c == cmdEdit) {
123 new AccountForm(this, ((AccountItem) getFocusedObject()));
124 }
125 if (c == cmdAdd) {
126 new AccountForm(this, null);
127 }
128 if (c == cmdDel) {
129 if (cursor == cf.accountIndex && StaticData.getInstance().roster.isLoggedIn()) {
130 return;
131 }
132 //if (((Account)getFocusedObject()).equals(StaticData.getInstance().account)) return;
133
134 new AlertBox(SR.MS_DELETE, getFocusedObject().toString()) {
135
136 public void yes() {
137 delAccount();
138 }
139
140 public void no() {
141 }
142 };
143 }
144 super.menuAction(c, d);
145 }
146
147 public void destroyView() {
148 if (itemsList.size() > 0) {

Callers

nothing calls this directly

Calls 9

destroyViewMethod · 0.95
getInstanceMethod · 0.95
switchAccountMethod · 0.95
getInstanceMethod · 0.95
getFocusedObjectMethod · 0.80
isLoggedInMethod · 0.80
menuActionMethod · 0.65
notifyDestroyedMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected