/** * @deprecated This method is used only for development testing Do NOT use in production * @param listName * @return */ public UserListPanel addUserList(String listName) { // {{{ UserListPanel panel = new UserListPanel(); panel.setSessionName(sessionName); panel.setTitle(listName); // Lets make sure that the TwitzMainView is a TwitzEventListener for this and all panels panel.addTwitzListener(view); panel.addPropertyChangeListener("collapsed", this); addPanel(panel); panels.put(listName, panel); // panel.setCollapsed(true); return panel; } // }}}
public void collapsePanels(UserListPanel ulp, boolean collapsed) { if (!collapsed) { String listname = ulp.getUserList() .getName(); // TODO Null check (should nevel be null as a userlistpanel should not // exist with a userlist) java.util.Set<String> set = panels.keySet(); java.util.Iterator<String> iter = set.iterator(); while (iter.hasNext()) { String key = iter.next(); UserListPanel p = panels.get(key); if (key.equals(listname)) { // p.setCollapsed(false); continue; } p.setCollapsed(true); } } }
public UserListPanel addUserList(UserList list) // {{{ { UserListPanel panel = null; try { panel = new UserListPanel(); panel.setSessionName(sessionName); panel.setTitle(list.getName()); // Lets make sure that the TwitzMainView is a TwitzEventListener for this and all panels // We add it first here because setUserList causes a TwitzEvent to be fired to get the list // users panel.addTwitzListener(view); panel.addPropertyChangeListener("collapsed", this); panel.setUserList(list); addPanel(panel); userlists.put(list.getName(), list); panels.put(list.getName(), panel); } catch (Exception e) { logger.error("Error while adding UserListPanel", e); } // panel.setCollapsed(true); return panel; } // }}}