Package net.java.sip.communicator.service.protocol.ServerStoredDetails

Examples of net.java.sip.communicator.service.protocol.ServerStoredDetails.GenericDetail


        Iterator<GenericDetail> iter =
                infoRetreiver.getDetails(uin, currentDetailValue.getClass());

        while (iter.hasNext())
        {
            GenericDetail item = iter.next();
            if (item.equals(currentDetailValue))
            {
                isFound = true;
                break;
            }
        }
View Full Code Here


                {
                    details = infoOpSet.getAllDetailsForContact(contact);

                    while(details.hasNext())
                    {
                        GenericDetail d = details.next();
                        if(d instanceof PhoneNumberDetail &&
                            !(d instanceof PagerDetail) &&
                            !(d instanceof FaxDetail))
                        {
                            PhoneNumberDetail pnd = (PhoneNumberDetail)d;
View Full Code Here

    private void fillTooltipLines(ExtendedTooltip tip,
                                  Iterator<GenericDetail> details)
    {
        while(details.hasNext())
        {
            GenericDetail d = details.next();
            if(d instanceof PhoneNumberDetail &&
                !(d instanceof FaxDetail) &&
                !(d instanceof PagerDetail))
            {
                PhoneNumberDetail pnd = (PhoneNumberDetail)d;
View Full Code Here

                    if(details != null)
                    {
                        while(details.hasNext())
                        {
                            GenericDetail d = details.next();
                            if(d instanceof PhoneNumberDetail &&
                                !(d instanceof PagerDetail) &&
                                !(d instanceof FaxDetail))
                            {
                                PhoneNumberDetail pnd = (PhoneNumberDetail)d;
View Full Code Here

            if(!source.equals(treeNode))
                return;

            while(details.hasNext())
            {
                GenericDetail d = details.next();

                if(d instanceof PhoneNumberDetail &&
                    !(d instanceof PagerDetail) &&
                    !(d instanceof FaxDetail))
                {
View Full Code Here

                    }

                    if (itr != null)
                        while(itr.hasNext())
                        {
                            GenericDetail detail = itr.next();

                            if(detail instanceof BinaryDetail)
                            {
                                BinaryDetail bin = (BinaryDetail)detail;
                                byte[] binBytes = bin.getBytes();
View Full Code Here

        JPanel valuesPanel = new TransparentPanel(new GridLayout(0, 1, 5, 5));

        detailsPanel.add(valuesPanel, BorderLayout.CENTER);

        Iterator<GenericDetail> contactDetails;
        GenericDetail genericDetail;

        // First name details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, FirstNameDetail.class);

        String firstNameDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();

            firstNameDetail =
                firstNameDetail + " " + genericDetail.getDetailValue();
        }

        if (firstNameDetail.equals(""))
            firstNameDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(firstNameDetail));

        // Middle name details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, MiddleNameDetail.class);

        String middleNameDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();
            middleNameDetail =
                middleNameDetail + " " + genericDetail.getDetailValue();
        }

        if (middleNameDetail.trim().equals(""))
            middleNameDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(middleNameDetail));

        // Last name details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, LastNameDetail.class);

        String lastNameDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();

            lastNameDetail =
                lastNameDetail + " " + genericDetail.getDetailValue();
        }

        if (lastNameDetail.trim().equals(""))
            lastNameDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(lastNameDetail));

        // Gender details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, GenderDetail.class);

        String genderDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();
            genderDetail = genderDetail + " " + genericDetail.getDetailValue();
        }

        if (genderDetail.trim().equals(""))
            genderDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(genderDetail));

        // Birthday details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, BirthDateDetail.class);

        String birthDateDetail = "";
        String ageDetail = "";
        if (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();

            Calendar calendarDetail =
                (Calendar) genericDetail.getDetailValue();

            Date birthDate = calendarDetail.getTime();
            DateFormat dateFormat = DateFormat.getDateInstance();

            birthDateDetail = dateFormat.format(birthDate).trim();

            Calendar c = Calendar.getInstance();
            int age = c.get(Calendar.YEAR) - calendarDetail.get(Calendar.YEAR);

            if (c.get(Calendar.MONTH) < calendarDetail.get(Calendar.MONTH))
                age--;

            ageDetail = Integer.toString(age).trim();
        }

        if (birthDateDetail.equals(""))
            birthDateDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        if (ageDetail.equals(""))
            ageDetail = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(birthDateDetail));
        valuesPanel.add(new JLabel(ageDetail));

        // Email details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, EmailAddressDetail.class);

        String emailDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();
            emailDetail = emailDetail + " " + genericDetail.getDetailValue();
        }

        if (emailDetail.trim().equals(""))
            emailDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");

        valuesPanel.add(new JLabel(emailDetail));

        // Phone number details.
        contactDetails =
            contactInfoOpSet.getDetails(contact, PhoneNumberDetail.class);

        String phoneNumberDetail = "";
        while (contactDetails.hasNext())
        {
            genericDetail = contactDetails.next();
            phoneNumberDetail =
                phoneNumberDetail + " " + genericDetail.getDetailValue();
        }

        if (phoneNumberDetail.trim().equals(""))
            phoneNumberDetail
                = Resources.getString("plugin.contactinfo.NOT_SPECIFIED");
View Full Code Here

        // Obtain all the details for a contact.
        Iterator<GenericDetail> iter
            = contactInfoOpSet.getAllDetailsForContact(contact);

        GenericDetail detail;
        JLabel detailLabel;
        JTextArea detailValueArea;
        JPanel detailPanel;

        while (iter.hasNext())
        {
            detail = iter.next();

            if (detail.getDetailValue().toString().equals(""))
                continue;

            detailLabel = new JLabel();
            detailValueArea = new JTextArea();
            detailPanel = new TransparentPanel(new BorderLayout(10, 10));

            detailValueArea.setAlignmentX(JTextArea.CENTER_ALIGNMENT);
            detailValueArea.setEditable(false);
            detailValueArea.setLineWrap(true);

            detailPanel.add(detailLabel, BorderLayout.WEST);
            detailPanel.add(detailValueArea, BorderLayout.CENTER);
            detailPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

            extendedPanel.add(detailPanel);

            if (detail instanceof BinaryDetail)
            {
                JLabel imageLabel =
                    new JLabel(new ImageIcon((byte[]) detail
                        .getDetailValue()));

                imagePanel.add(imageLabel);
            }
            else if (detail instanceof CalendarDetail)
            {
                detailLabel.setText(detail.getDetailDisplayName() + ": ");

                Date detailDate =
                    ((Calendar) detail.getDetailValue()).getTime();
                DateFormat df = DateFormat.getDateInstance();

                detailValueArea.setText(df.format(detailDate).trim());
            }
            else if (detail instanceof LocaleDetail)
            {
                detailLabel.setText(detail.getDetailDisplayName() + ": ");

                detailValueArea.setText(((Locale) detail.getDetailValue())
                        .getDisplayName().trim());
            }
            else if (detail instanceof TimeZoneDetail)
            {
                detailLabel.setText(detail.getDetailDisplayName() + ": ");

                detailValueArea.setText(((TimeZone) detail.getDetailValue())
                        .getDisplayName().trim());
            }
            else
            {
                detailLabel.setText(detail.getDetailDisplayName() + ": ");

                detailValueArea.setText(
                    detail.getDetailValue().toString().trim());
            }
        }

        // Add users status message to extended details if it exists
        String statusMessage = contact.getStatusMessage();
View Full Code Here

        List<T> result = new LinkedList<T>();

        Iterator<GenericDetail> iter = details.iterator();
        while (iter.hasNext())
        {
            GenericDetail item = iter.next();
            if (detailClass.isInstance(item))
            {
                @SuppressWarnings("unchecked")
                T t = (T) item;
View Full Code Here

                = new LinkedList<Class<? extends GenericDetail>>();

        Iterator<GenericDetail> iter = details.iterator();
        while (iter.hasNext())
        {
            GenericDetail obj = iter.next();
            result.add(obj.getClass());
        }

        return result.iterator();
    }
View Full Code Here

TOP

Related Classes of net.java.sip.communicator.service.protocol.ServerStoredDetails.GenericDetail

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.