MCPcopy Index your code
hub / github.com/BombusMod/BombusMod / PrivacyForm

Method PrivacyForm

src/main/java/PrivacyLists/PrivacyForm.java:73–108  ·  view source on GitHub ↗

Creates a new instance of PrivacyForm @param item @param plist

(PrivacyItem item, PrivacyList plist)

Source from the content-addressed store, hash-verified

71 * @param plist
72 */
73 public PrivacyForm(PrivacyItem item, PrivacyList plist) {
74 super(SR.MS_PRIVACY_RULE);
75 this.item = item;
76 targetList = plist;
77
78 tValue=(textValue!=null)?textValue.getValue():item.value;
79
80 itemsList.removeAllElements();
81
82 choiceAction=new DropChoiceBox(SR.MS_PRIVACY_ACTION);
83 for(int i=0; i<PrivacyItem.actions.length; i++){
84 choiceAction.add(PrivacyItem.actions[i]);
85 }
86 choiceAction.setSelectedIndex(item.action);
87 itemsList.addElement(choiceAction);
88
89 choiceType=new DropChoiceBox(SR.MS_PRIVACY_TYPE);
90 for(int i=0; i<PrivacyItem.types.length; i++){
91 choiceType.add(PrivacyItem.types[i]);
92 }
93 choiceType.setSelectedIndex(item.type);
94 itemsList.addElement(choiceType);
95
96 textValue=new TextInput(SR.MS_VALUE, tValue, "");
97
98 switchType();
99
100 itemsList.addElement(new SimpleString(SR.MS_STANZAS, true));
101
102 messageStz=new CheckBox(PrivacyItem.stanzas[0], item.messageStz); itemsList.addElement(messageStz);
103 presenceInStz=new CheckBox(PrivacyItem.stanzas[1], item.presenceInStz); itemsList.addElement(presenceInStz);
104 presenceOutStz=new CheckBox(PrivacyItem.stanzas[2], item.presenceOutStz); itemsList.addElement(presenceOutStz);
105 iqStz=new CheckBox(PrivacyItem.stanzas[3], item.iqStz); itemsList.addElement(iqStz);
106
107 moveCursorTo(getNextSelectableRef(-1));
108 }
109
110 protected void beginPaint(){
111 if (typeIndex!=choiceType.getSelectedIndex()) {

Callers

nothing calls this directly

Calls 7

switchTypeMethod · 0.95
setSelectedIndexMethod · 0.80
addElementMethod · 0.80
moveCursorToMethod · 0.80
getNextSelectableRefMethod · 0.80
getValueMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected