/** * Dodaje kontakt do aktualnie wyświetlanych. * * @param contact */ public void addContact(final ViewContact contact) { final ContactPanel contactPanel = new ContactPanel(contact); contactPanels.put(contact, contactPanel); if (mouseListener != null) { contactPanel.addMouseListener(mouseListener); } contactsListPanel.add(contactPanel); }
/** Usuwa aktualnego Listenera. */ public void removeMainWindowListener() { if (listener != null) { listener = null; window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); window.removeWindowListener(windowListener); for (final ContactPanel contactPanel : contactPanels.values()) { contactPanel.removeMouseListener(mouseListener); } } }
/** * Ustawia nowego Listenera. Jeżeli wcześniej był ustawiony Listener to najpierw go usuwa. * * @param mainWindowListener */ public void setMainWindowListener(final MainWindowListener mainWindowListener) { if (listener != null) { removeMainWindowListener(); } listener = mainWindowListener; window.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); window.addWindowListener(windowListener); for (final ContactPanel contactPanel : contactPanels.values()) { contactPanel.addMouseListener(mouseListener); } }
private void fillPanel(UserModel model) { if (model == null) return; resetTitle(model.getLoginname()); // if it's login user, refresh navbar user name if (model.isLogin()) BaseEntryPoint.I.resetLoginUser(model.getFullname()); // set display info on left part fullname.setText(model.getFullname()); contacts.setUser(model); statusText.setText(StringUtil.trimToEmpty(model.getStatus())); this.userUid = model.getUid(); if (model.getPortrait() != null) { // while user update Profile, the portrait won't refresh. See userPortraitUpdated() method portrait.clear(); portrait.setWidget(GwtClientUtils.createUserPortrait(model.getPortrait())); } }
/** * Aktualizuje dane kontaktu. * * @param contact */ public void updateContact(final ViewContact contact) { final ContactPanel contactPanel = contactPanels.get(contact); contactPanel.setTitle(contact.getDisplayName()); contactPanel.repaint(); }