@author EvgS
| 45 | * @author EvgS |
| 46 | */ |
| 47 | public class PrivacyModifyList extends DefForm |
| 48 | implements JabberBlockListener |
| 49 | { |
| 50 | |
| 51 | private PrivacyList plist; |
| 52 | private PrivacySelect pselector; |
| 53 | |
| 54 | private MenuCommand cmdAdd=new MenuCommand (SR.MS_ADD_RULE, MenuCommand.SCREEN, 10, RosterIcons.ICON_PRIVACY_ACTIVE); |
| 55 | private MenuCommand cmdDel=new MenuCommand (SR.MS_DELETE_RULE, MenuCommand.SCREEN, 11, RosterIcons.ICON_DELETE); |
| 56 | private MenuCommand cmdEdit=new MenuCommand (SR.MS_EDIT_RULE, MenuCommand.SCREEN, 12, RosterIcons.ICON_RENAME); |
| 57 | private MenuCommand cmdUp=new MenuCommand (SR.MS_MOVE_UP, MenuCommand.SCREEN, 13, RosterIcons.ICON_SCROLLABLE_UP); |
| 58 | private MenuCommand cmdDwn=new MenuCommand (SR.MS_MOVE_DOWN, MenuCommand.SCREEN, 14, RosterIcons.ICON_SCROLLABLE_DOWN); |
| 59 | private MenuCommand cmdSave=new MenuCommand (SR.MS_SAVE_LIST, MenuCommand.SCREEN, 16, RosterIcons.ICON_ARCHIVE); |
| 60 | |
| 61 | JabberStream stream=StaticData.getInstance().getTheStream(); |
| 62 | |
| 63 | /** Creates a new instance of PrivacySelect */ |
| 64 | public PrivacyModifyList(PrivacyList privacyList, boolean newList, PrivacySelect privacySelect) { |
| 65 | super(null); |
| 66 | mainbar= new MainBar(2, null, privacyList.name, false); |
| 67 | |
| 68 | //commandState(); |
| 69 | plist = privacyList; |
| 70 | pselector = privacySelect; |
| 71 | |
| 72 | if (!newList) { |
| 73 | processIcon(true); |
| 74 | stream.addBlockListener(this); |
| 75 | JabberDataBlock list=new JabberDataBlock("list"); |
| 76 | list.setAttribute("name", plist.name); |
| 77 | PrivacyList.privacyListRq(false, list, "getlistitems"); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | public void commandState() { |
| 82 | menuCommands.removeAllElements(); |
| 83 | addMenuCommand(cmdEdit); |
| 84 | addMenuCommand(cmdAdd); |
| 85 | addMenuCommand(cmdDel); |
| 86 | addMenuCommand(cmdUp); |
| 87 | addMenuCommand(cmdDwn); |
| 88 | addMenuCommand(cmdSave); |
| 89 | } |
| 90 | |
| 91 | private void processIcon(boolean processing){ |
| 92 | mainbar.setElementAt((processing)?(Object)new Integer(RosterIcons.ICON_PROGRESS_INDEX):(Object)null, 0); |
| 93 | redraw(); |
| 94 | } |
| 95 | |
| 96 | /*private void getList(){ |
| 97 | processIcon(true); |
| 98 | stream.addBlockListener(this); |
| 99 | JabberDataBlock list=new JabberDataBlock("list", null, null); |
| 100 | list.setAttribute("name", plist.name); |
| 101 | PrivacyList.privacyListRq(false, list, "getlistitems"); |
| 102 | }*/ |
| 103 | |
| 104 | protected int getItemCount() { return plist.rules.size(); } |
nothing calls this directly
no test coverage detected