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

Method menuAction

src/main/java/PrivacyLists/PrivacySelect.java:96–122  ·  view source on GitHub ↗
(MenuCommand c, VirtualList d)

Source from the content-addressed store, hash-verified

94 }
95
96 public void menuAction(MenuCommand c, VirtualList d) {
97 if (c==cmdCancel) {
98 destroyView();
99 stream.cancelBlockListener(this);
100 return;
101 }
102 if (c==cmdActivate || c==cmdDefault) {
103 PrivacyListItem active=((PrivacyListItem)getFocusedObject());
104 for (Enumeration e = itemsList.elements(); e.hasMoreElements(); ) {
105 PrivacyListItem pl=(PrivacyListItem)e.nextElement();
106 boolean state=(pl==active);
107 if (c==cmdActivate)
108 pl.list.isActive=state;
109 else
110 pl.list.isDefault=state;
111 }
112 ((PrivacyListItem)getFocusedObject()).list.activate( (c==cmdActivate)? "active":"default" );
113 getLists();
114 }
115
116 if (c==cmdDelete) {
117 keyClear();
118 }
119 if (c==cmdNewList)
120 addNewElement();
121 super.menuAction(c, d);
122 }
123
124 // MIDPTextBox interface
125 public void OkNotify(String listName) {

Callers

nothing calls this directly

Calls 9

getListsMethod · 0.95
keyClearMethod · 0.95
addNewElementMethod · 0.95
cancelBlockListenerMethod · 0.80
getFocusedObjectMethod · 0.80
elementsMethod · 0.80
activateMethod · 0.80
menuActionMethod · 0.65
destroyViewMethod · 0.45

Tested by

no test coverage detected