Package de.fu_berlin.inf.dpp.ui.model.roster

Examples of de.fu_berlin.inf.dpp.ui.model.roster.RosterEntryElement


        final RosterEntry rosterEntry, final List<IResource> resources) {

        /*
         * The model knows how to display roster entries best.
         */
        RosterEntryElement rosterEntryElement = new RosterEntryElement(saros
            .getSarosNet().getRoster(), new JID(rosterEntry.getUser()));

        MenuItem menuItem = new MenuItem(parentMenu, SWT.NONE, index);
        menuItem.setText(rosterEntryElement.getStyledText().toString());
        menuItem.setImage(rosterEntryElement.getImage());

        menuItem.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                List<JID> buddies = new ArrayList<JID>();
View Full Code Here


                        if (user != null) {
                            editorManager.jumpToUser(user);
                            return;
                        }

                        RosterEntryElement rosterEntryElement = (RosterEntryElement) Platform
                            .getAdapterManager().getAdapter(treeItem.getData(),
                                RosterEntryElement.class);

                        ChatControl chatControl = chatRooms
                            .getActiveChatControl();

                        /*
                         * TODO create links like those of the World of Warcraft
                         * chat which then can be clicked to execute some action
                         * e.g inviting user to a session are add them to the
                         * roster (but should not be done here at all)
                         */

                        if (rosterEntryElement != null && chatControl != null) {
                            String currentText = chatControl.getInputText();
                            chatControl.setInputText(currentText + "["
                                + rosterEntryElement.getJID().getBase() + "]");
                        }

                    }
                } else {
                    log.warn("Control is not instance of Tree.");
View Full Code Here

        List<RosterEntryElement> checkedElements = ArrayUtils
            .getAdaptableObjects(treeViewer.getCheckedElements(),
                RosterEntryElement.class);
        List<RosterEntryElement> elementsToCheck = new ArrayList<RosterEntryElement>();
        for (JID buddy : buddies) {
            elementsToCheck.add(new RosterEntryElement(saros.getSarosNet()
                .getRoster(), buddy));
        }

        Map<RosterEntryElement, Boolean> checkStatesChanges = calculateCheckStateDiff(
            allElements, checkedElements, elementsToCheck);

        /*
         * Update the check state in the RosterCheckStateProvider
         */
        for (Entry<RosterEntryElement, Boolean> entryElement : checkStatesChanges
            .entrySet()) {
            RosterEntryElement rosterEntryElement = entryElement.getKey();
            boolean checked = checkStatesChanges.get(rosterEntryElement);
            this.checkStateProvider.setChecked(rosterEntryElement, checked);
        }

        /*
         * Refresh the viewer in order to reflect the new check states.
         */
        treeViewer.refresh();

        /*
         * Fire events
         */
        for (Entry<RosterEntryElement, Boolean> entryElement : checkStatesChanges
            .entrySet()) {
            RosterEntryElement rosterEntryElement = entryElement.getKey();
            boolean checked = checkStatesChanges.get(rosterEntryElement);
            this.notifyBuddySelectionChanged(
                (JID) rosterEntryElement.getAdapter(JID.class), checked);
        }
    }
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.ui.model.roster.RosterEntryElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.