@author EvgS
| 47 | * @author EvgS |
| 48 | */ |
| 49 | public class Bookmarks extends DefForm { |
| 50 | |
| 51 | private BookmarkItem toAdd; |
| 52 | private MenuCommand cmdJoin = new MenuCommand(SR.MS_SELECT, MenuCommand.OK, 1, RosterIcons.ICON_APPEARING_INDEX); |
| 53 | private MenuCommand cmdAdvJoin = new MenuCommand(SR.MS_EDIT_JOIN, MenuCommand.SCREEN, 2, RosterIcons.ICON_RENAME); |
| 54 | private MenuCommand cmdNew = new MenuCommand(SR.MS_NEW_BOOKMARK, MenuCommand.SCREEN, 3, RosterIcons.ICON_NEW); |
| 55 | private MenuCommand cmdDoAutoJoin = new MenuCommand(SR.MS_DO_AUTOJOIN, MenuCommand.SCREEN, 4, RosterIcons.ICON_PRESENCE_CHAT); |
| 56 | private MenuCommand cmdConfigure = new MenuCommand(SR.MS_CONFIG_ROOM, MenuCommand.SCREEN, 5, RosterIcons.ICON_CONFIGURE); |
| 57 | //#ifdef SERVICE_DISCOVERY |
| 58 | private MenuCommand cmdDisco = new MenuCommand(SR.MS_DISCO_ROOM, MenuCommand.SCREEN, 6, RosterIcons.ICON_DISCO); |
| 59 | //#endif |
| 60 | private MenuCommand cmdUp = new MenuCommand(SR.MS_MOVE_UP, MenuCommand.SCREEN, 7, RosterIcons.ICON_SCROLLABLE_UP); |
| 61 | private MenuCommand cmdDwn = new MenuCommand(SR.MS_MOVE_DOWN, MenuCommand.SCREEN, 8, RosterIcons.ICON_SCROLLABLE_DOWN); |
| 62 | private MenuCommand cmdSort = new MenuCommand(SR.MS_SORT, MenuCommand.SCREEN, 9, RosterIcons.ICON_IE); |
| 63 | private MenuCommand cmdSave = new MenuCommand(SR.MS_SAVE_LIST, MenuCommand.SCREEN, 10, RosterIcons.ICON_ARCHIVE); |
| 64 | private MenuCommand cmdRoomOwners = new MenuCommand(SR.MS_OWNERS, MenuCommand.SCREEN, 11, RosterIcons.ICON_OWNERS); |
| 65 | private MenuCommand cmdRoomAdmins = new MenuCommand(SR.MS_ADMINS, MenuCommand.SCREEN, 12, RosterIcons.ICON_ADMINS); |
| 66 | private MenuCommand cmdRoomMembers = new MenuCommand(SR.MS_MEMBERS, MenuCommand.SCREEN, 13, RosterIcons.ICON_MEMBERS); |
| 67 | private MenuCommand cmdRoomBanned = new MenuCommand(SR.MS_BANNED, MenuCommand.SCREEN, 14, RosterIcons.ICON_OUTCASTS); |
| 68 | private MenuCommand cmdDel = new MenuCommand(SR.MS_DELETE, MenuCommand.SCREEN, 15, RosterIcons.ICON_DELETE); |
| 69 | JabberStream stream = sd.getTheStream(); |
| 70 | |
| 71 | /** Creates a new instance of Bookmarks |
| 72 | * @param toAdd |
| 73 | */ |
| 74 | public Bookmarks(BookmarkItem toAdd) { |
| 75 | super(null, false); |
| 76 | loadBookmarks(); |
| 77 | |
| 78 | if (getItemCount() == 0 && toAdd == null) { |
| 79 | new ConferenceForm(); |
| 80 | return; |
| 81 | } |
| 82 | |
| 83 | this.toAdd = toAdd; |
| 84 | |
| 85 | if (toAdd != null) { |
| 86 | addBookmark(); |
| 87 | } |
| 88 | |
| 89 | mainbar = new MainBar(2, null, SR.MS_BOOKMARKS + " (" + getItemCount() + ") ", false);//for title updating after "add bookmark" |
| 90 | |
| 91 | enableListWrapping(true); |
| 92 | show(); |
| 93 | } |
| 94 | |
| 95 | public void commandState() { |
| 96 | menuCommands.removeAllElements(); |
| 97 | addMenuCommand(cmdJoin); |
| 98 | addMenuCommand(cmdAdvJoin); |
| 99 | addMenuCommand(cmdNew); |
| 100 | addMenuCommand(cmdDoAutoJoin); |
| 101 | addMenuCommand(cmdUp); |
| 102 | addMenuCommand(cmdDwn); |
| 103 | addMenuCommand(cmdSave); |
| 104 | addMenuCommand(cmdSort); |
| 105 | //#ifdef SERVICE_DISCOVERY |
| 106 | addMenuCommand(cmdDisco); |
nothing calls this directly
no test coverage detected