private AvatarWidget findWidget(VuzeBuddy buddy) { if (null != buddy) { for (Iterator iterator = avatarWidgets.iterator(); iterator.hasNext(); ) { AvatarWidget widget = (AvatarWidget) iterator.next(); if (null != widget.getVuzeBuddy()) { if (true == buddy.getLoginID().equals(widget.getVuzeBuddy().getLoginID())) { return widget; } } } } return null; }
public void removeFromShare(VuzeBuddy buddy) { if (null != buddy) { for (Iterator iterator = avatarWidgets.iterator(); iterator.hasNext(); ) { AvatarWidget widget = (AvatarWidget) iterator.next(); if (null != widget.getVuzeBuddy()) { if (true == buddy.getLoginID().equals(widget.getVuzeBuddy().getLoginID())) { if (sharePage != null) { sharePage.removeBuddy(widget.getVuzeBuddy()); } widget.setSharedAlready(false); break; } } } } }
/** * Return a list of <code>VuzeBuddySWT</code> that are currently selected * * @return */ public List getSelection() { List selected = new ArrayList(); for (Iterator iterator = avatarWidgets.iterator(); iterator.hasNext(); ) { AvatarWidget widget = (AvatarWidget) iterator.next(); if (true == widget.isSelected()) { selected.add(widget.getVuzeBuddy()); } } return selected; }
public void addToShare(AvatarWidget widget) { /*if (null == sharePage) { SkinView detailPanelView = SkinViewManager.getByClass(DetailPanel.class); if (detailPanelView instanceof DetailPanel) { DetailPanel detailPanel = ((DetailPanel) detailPanelView); sharePage = (SharePage) detailPanel.getPage(SharePage.PAGE_ID); } else { throw new IllegalArgumentException( "Oops.. looks like the DetailPanel skin is not properly initialized"); } }*/ if (sharePage != null) { sharePage.addBuddy(widget.getVuzeBuddy()); } widget.setSharedAlready(true); }
public void select(VuzeBuddySWT buddy, boolean value, boolean appendSelection) { if (null != buddy) { for (Iterator iterator = avatarWidgets.iterator(); iterator.hasNext(); ) { AvatarWidget widget = (AvatarWidget) iterator.next(); if (true == buddy.equals(widget.getVuzeBuddy())) { widget.setSelected(value); if (true == appendSelection) { break; } } else if (false == appendSelection) { if (true == value) { if (widget.isSelected() != false) { widget.setSelected(false); widget.refreshVisual(); } } else { widget.setSelected(false); widget.refreshVisual(); } } } } /* * De-select all buddies if the given 'buddy' is null */ else { for (Iterator iterator = avatarWidgets.iterator(); iterator.hasNext(); ) { AvatarWidget widget = (AvatarWidget) iterator.next(); if (true == widget.isSelected()) { widget.setSelected(false); widget.refreshVisual(); } } } }
public void removeFromShare(AvatarWidget widget) { if (sharePage != null) { sharePage.removeBuddy(widget.getVuzeBuddy()); } widget.setSharedAlready(false); }