Example usage for com.google.gwt.user.client.ui HorizontalPanel add

List of usage examples for com.google.gwt.user.client.ui HorizontalPanel add

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HorizontalPanel add.

Prototype

@Override
    public void add(Widget w) 

Source Link

Usage

From source file:com.dimdim.conference.ui.user.client.ChangePictureDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel contentPanel = new VerticalPanel();
    contentPanel.setStyleName("change-photo-content-panel");
    String defaultPhotoUrl = UserGlobals.getUserGlobals().getDefaultPhotoUrl();
    String currentPhotoUrl = this.me.getPhotoUrl();

    //Window.alert("inside chage picture");
    this.defaultPhotoButton = new RadioButton("PhotoSelection");
    this.defaultPhotoButton.addClickListener(this);
    this.defaultPhotoButton.setStyleName("change-photo-radio-button");
    this.customPhotoButton = new RadioButton("PhotoSelection");
    this.customPhotoButton.addClickListener(this);
    this.customPhotoButton.setStyleName("change-photo-radio-button");

    //   Custom Photo caption

    Label comment1 = new Label(UserGlobals.getUserGlobals().getChangePictureComment1());
    comment1.setStyleName("change-photo-picture-caption");
    comment1.addStyleName("common-text");
    contentPanel.add(comment1);/*  w  ww  . j  a va2 s .c  om*/

    Label comment2 = new Label(UserGlobals.getUserGlobals().getChangePictureComment2());
    comment2.setStyleName("change-photo-picture-caption");
    comment2.addStyleName("common-text");
    contentPanel.add(comment2);

    HorizontalPanel customPhotoCaption = new HorizontalPanel();
    customPhotoCaption.setStyleName("change-photo-picture-caption");
    customPhotoCaption.add(this.customPhotoButton);
    Label label2 = new Label(UIStrings.getChangePhotoLabel());
    label2.setStyleName("common-text");
    label2.addStyleName("change-photo-label");
    customPhotoCaption.add(label2);

    //      HorizontalPanel uploadCaption = new HorizontalPanel();
    //      uploadCaption.setStyleName("change-photo-picture-caption");
    //      this.uploadLink = new Label("Upload");
    //      this.uploadLink.addClickListener(this);
    //      this.uploadLink.setStyleName("common-text");
    //      this.uploadLink.addStyleName("change-photo-upload-label");
    //      this.uploadLink.addStyleName("common-anchor");
    //      uploadCaption.add(this.uploadLink);

    //   Create a form panel for the photo file upload.

    this.photoUploadForm = new FormPanel();
    this.photoUploadForm.setAction(this.commandURLFactory.getPhotoUploadURL());
    this.photoUploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
    this.photoUploadForm.setMethod(FormPanel.METHOD_POST);

    this.photoUploadField = new FileUpload();
    this.photoUploadField.setName("photo");
    this.photoUploadForm.add(this.photoUploadField);
    this.photoUploadField.setStyleName("photo-file-upload-field");

    contentPanel.add(customPhotoCaption);
    contentPanel.add(this.photoUploadForm);
    //      contentPanel.add(uploadCaption);

    //   Default Photo Caption

    HorizontalPanel defaultPhotoCaption = new HorizontalPanel();
    defaultPhotoCaption.setStyleName("change-photo-picture-caption");
    defaultPhotoCaption.add(this.defaultPhotoButton);
    Label label1 = new Label(UIStrings.getUseDefaultPhotoLabel());
    label1.setStyleName("common-text");
    label1.addStyleName("change-photo-label");
    defaultPhotoCaption.add(label1);
    if (UserGlobals.getUserGlobals().isPhotoUrlDefault(currentPhotoUrl)) {
        this.defaultPhotoButton.setChecked(true);
        this.customPhotoButton.setChecked(false);
    } else {
        this.defaultPhotoButton.setChecked(false);
        this.customPhotoButton.setChecked(true);
    }
    contentPanel.add(defaultPhotoCaption);

    //   Photo Panel

    if (currentPhotoUrl == null || currentPhotoUrl.length() == 0) {
        currentPhotoUrl = defaultPhotoUrl;
    }
    Image photoImage = new Image(currentPhotoUrl);
    photoImage.setStyleName("change-photo-picture");
    contentPanel.add(photoImage);
    contentPanel.setCellVerticalAlignment(photoImage, VerticalPanel.ALIGN_MIDDLE);
    contentPanel.setCellHorizontalAlignment(photoImage, HorizontalPanel.ALIGN_LEFT);

    //      this.photoUploadField.setVisible(false);
    //      this.uploadLink.setVisible(false);

    return contentPanel;
}

From source file:com.dimdim.conference.ui.user.client.email.EmailControlPanel.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    scroller.add(scrolledTable);/*  ww  w .j  av a2  s  .co  m*/

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "lobby-name"));
    header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email"));

    Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header");
    accept.addStyleName("common-anchor");
    header.add(accept);
    Label deny = createLabel("", "user-chat-button-header");
    header.add(deny);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.add(scroller);
    table.setCellWidth(scroller, "100%");

    int size = this.listModel.getListSize();
    int i = 0;
    for (i = 0; i < size; i++) {
        EmailTaskListEntry etle = (EmailTaskListEntry) this.listModel.getListEntryAt(i);
        this.results.addElement(etle);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = etle.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(etle.getName(), "lobby-name");
        nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);
        Label emailLabel = createTextHTML(etle.getEmailResult().getTarget(), "lobby-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        HorizontalPanel hp3 = new HorizontalPanel();
        CheckBox cb2 = new CheckBox();
        hp3.add(cb2);
        hp3.setStyleName("user-chat-button");
        hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
        hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp3);
        row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
        this.checkBoxes.addElement(cb2);

        HorizontalPanel hp4 = new HorizontalPanel();
        Label cb3 = new Label("");
        hp4.add(cb3);
        hp4.setStyleName("user-chat-button");
        hp4.setCellHorizontalAlignment(cb3, HorizontalPanel.ALIGN_LEFT);
        hp4.setCellVerticalAlignment(cb3, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp4);
        row.setCellHorizontalAlignment(hp4, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp4, VerticalPanel.ALIGN_MIDDLE);

        row.addStyleName("common-dialog-row");
        scrolledTable.add(row);
        this.rows.addElement(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.meetinglobby.MeetingLobbyControlPanel.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    scrolledTable = new VerticalPanel();
    scroller.add(scrolledTable);// w  ww . ja  va  2 s  .c o m
    //      table.setStyleName("list-control-table");

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "lobby-name"));
    header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email"));

    Label accept = createLabel(UIStrings.getAcceptLabel(), "user-chat-button-header");
    accept.addStyleName("common-anchor");
    accept.addClickListener(this.acceptList);
    header.add(accept);
    Label deny = createLabel(UIStrings.getDenyLabel(), "user-chat-button-header");
    deny.addStyleName("common-anchor");
    deny.addClickListener(this.denyList);
    header.add(deny);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.add(scroller);
    table.setCellWidth(scroller, "100%");

    int size = this.listModel.getListSize();
    int i = 0;
    for (i = 0; i < size; i++) {
        UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
        UIRosterEntry user = ule.getUser();
        this.users.addElement(user);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = ule.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(user.getDisplayName(), "lobby-name");
        nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);
        Label emailLabel = createTextHTML(user.getUserId(), "lobby-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        HorizontalPanel hp3 = new HorizontalPanel();
        //         CheckBox cb2 = new CheckBox();
        RadioButton cb2 = new RadioButton(user.getUserId());
        hp3.add(cb2);
        hp3.setStyleName("user-chat-button");
        hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
        hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp3);
        row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
        this.acceptBoxes.addElement(cb2);
        this.acceptList.addRadioButton(cb2);

        HorizontalPanel hp4 = new HorizontalPanel();
        //         CheckBox cb3 = new CheckBox();
        RadioButton cb3 = new RadioButton(user.getUserId());
        hp4.add(cb3);
        hp4.setStyleName("user-chat-button");
        hp4.setCellHorizontalAlignment(cb3, HorizontalPanel.ALIGN_LEFT);
        hp4.setCellVerticalAlignment(cb3, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp4);
        row.setCellHorizontalAlignment(hp4, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp4, VerticalPanel.ALIGN_MIDDLE);
        this.denyBoxes.addElement(cb3);
        this.denyList.addRadioButton(cb3);

        row.addStyleName("common-dialog-row");
        scrolledTable.add(row);
        this.rows.addElement(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.MoodControlPopup.java

License:Open Source License

protected HorizontalPanel getMoodPanel(UserMood mood, boolean custom) {
    /*// w w  w. j a  v  a  2  s .c  o m
    FocusPanel   pane = new FocusPanel();
    pane.addMouseListener(new MouseListenerAdapter()
    {
       public void onMouseEnter(Widget sender)
       {
    sender.addStyleName("mood-menu-entry-selected");
       }
       public void onMouseLeave(Widget sender)
       {
    sender.removeStyleName("mood-menu-entry-selected");
       }
    });
    */
    final HorizontalPanel moodPanel = new HorizontalPanel();
    //      pane.add(moodPanel);
    moodPanel.setStyleName("mood-menu-entry");
    if (!custom) {
        moodPanel.addStyleName("mood-menu-entry-border");
    }
    Image moodImage = UIImages.getImageBundle(UIImages.defaultSkin).getNewMoodImageUrl(mood.getMood());
    moodImage.setStyleName(mood.getImageStyleName());
    moodPanel.add(moodImage);
    moodPanel.setCellVerticalAlignment(moodImage, VerticalPanel.ALIGN_MIDDLE);

    Label moodLabel = getMoodLabel(mood, custom);
    moodLabel.addStyleName("mood-label");
    moodPanel.add(moodLabel);
    moodPanel.setCellVerticalAlignment(moodLabel, VerticalPanel.ALIGN_MIDDLE);
    moodLabel.addMouseListener(new MouseListenerAdapter() {
        public void onMouseEnter(Widget sender) {
            moodPanel.addStyleName("mood-menu-entry-selected");
        }

        public void onMouseLeave(Widget sender) {
            moodPanel.removeStyleName("mood-menu-entry-selected");
        }
    });
    moodPanel.setTitle(mood.getDisplayLabel());
    return moodPanel;
}

From source file:com.dimdim.conference.ui.user.client.questiontask.QuestionsControlPanel.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    scroller.add(scrolledTable);/*  www  .j  a v  a2s . com*/

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "lobby-name"));
    header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email"));

    Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header");
    accept.addStyleName("common-anchor");
    header.add(accept);
    Label deny = createLabel("", "user-chat-button-header");
    header.add(deny);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.add(scroller);
    table.setCellWidth(scroller, "100%");

    int size = this.listModel.getListSize();
    int i = 0;
    for (i = 0; i < size; i++) {
        UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
        UIRosterEntry user = ule.getUser();
        this.users.addElement(user);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = ule.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(user.getDisplayName(), "lobby-name");
        nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);
        Label emailLabel = createTextHTML(user.getUserId(), "lobby-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        HorizontalPanel hp3 = new HorizontalPanel();
        CheckBox cb2 = new CheckBox();
        hp3.add(cb2);
        hp3.setStyleName("user-chat-button");
        hp3.setCellHorizontalAlignment(cb2, HorizontalPanel.ALIGN_LEFT);
        hp3.setCellVerticalAlignment(cb2, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp3);
        row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
        this.checkBoxes.addElement(cb2);

        HorizontalPanel hp4 = new HorizontalPanel();
        Label cb3 = new Label("");
        hp4.add(cb3);
        hp4.setStyleName("user-chat-button");
        hp4.setCellHorizontalAlignment(cb3, HorizontalPanel.ALIGN_LEFT);
        hp4.setCellVerticalAlignment(cb3, VerticalPanel.ALIGN_MIDDLE);
        row.add(hp4);
        row.setCellHorizontalAlignment(hp4, HorizontalPanel.ALIGN_LEFT);
        row.setCellVerticalAlignment(hp4, VerticalPanel.ALIGN_MIDDLE);

        row.addStyleName("common-dialog-row");
        scrolledTable.add(row);
        this.rows.addElement(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.SetDisplayNamePopup.java

License:Open Source License

protected Widget getContent() {
    //basePanel.add(this.settingsMainComment);
    //basePanel.setCellWidth(this.settingsMainComment,"100%");
    //this.settingsMainComment.setStyleName("invitations-preview-comment");

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.addStyleName("chat-text-area");

    Label label = new Label("New Name:");
    label.setStyleName("common-text");
    label.addStyleName("meeting-info-label");
    hPanel.add(label);

    displayName = new TextBox();
    displayName.setText(currentUser.getDisplayName());
    displayName.setStyleName("common-text");
    displayName.addStyleName("chat-text-area");
    displayName.setMaxLength(12);// www . j  a  v  a 2 s.  c  om
    hPanel.add(displayName);

    basePanel.add(hPanel);
    basePanel.setCellVerticalAlignment(hPanel, VerticalPanel.ALIGN_MIDDLE);

    basePanel.add(new Label(" "));

    displayName.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {
            errorLabel.setText(" ");
        }

    });
    errorLabel.setStyleName("common-text");
    errorLabel.addStyleName("common-error-message");
    basePanel.add(errorLabel);

    return basePanel;
}

From source file:com.dimdim.conference.ui.user.client.SingleAttendeePermissionsControlDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel table = new VerticalPanel();

    UIResources uiResources = UIResources.getUIResources();
    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "user-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "user-name-header"));
    header.add(createLabel(UIStrings.getEmailLabel(), "user-email-header"));

    if (ConferenceGlobals.privateChatEnabled) {
        Label chat = createLabel(UIStrings.getChatLabel(), "user-chat-button-header");
        //         chat.addStyleName("common-anchor");
        header.add(chat);/*from  ww  w  .ja  v a  2  s .  c o  m*/
    }
    if (!ConferenceGlobals.isPresenterAVAudioDisabled()) {
        String label = UIStrings.getAudioLabel();
        if (ConferenceGlobals.isPresenterAVVideoOnly()) {
            label = UIStrings.getVideoLabel();
        }
        Label audio = createLabel(label, "user-chat-button-header");
        header.add(audio);
    }
    //         Label video = createLabel("Video","user-chat-button-header");
    //         header.add(video);

    header.addStyleName("common-dialog-row");
    table.add(header);
    table.setCellWidth(header, "100%");
    {
        UserListEntry ule = (UserListEntry) listEntry;
        UIRosterEntry user = ule.getUser();

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = ule.getImage1Url();
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.setStyleName("user-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        Label nameLabel = createTextHTML(user.getDisplayName(), "user-name");
        //            nameLabel.addStyleName("common-anchor");
        row.add(nameLabel);

        String subject = uiResources.getConferenceInfoAndDecode64("subject");
        String mailToTag = "<a href=\"mailto:" + user.getUserId() + "?subject=" + subject + "\">"
                + user.getUserId() + "</a>";

        HTML emailLabel = new HTML("<span>" + mailToTag + "</span>");
        emailLabel.setStyleName("common-table-text");
        emailLabel.addStyleName("user-email");
        emailLabel.addStyleName("common-anchor");
        row.add(emailLabel);

        if (ConferenceGlobals.privateChatEnabled) {
            HorizontalPanel hp2 = new HorizontalPanel();
            this.chatControl = new CheckBox();
            hp2.add(chatControl);
            hp2.setStyleName("user-chat-button");
            hp2.setCellHorizontalAlignment(chatControl, HorizontalPanel.ALIGN_LEFT);
            hp2.setCellVerticalAlignment(chatControl, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp2);
            row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);
            chatControl.setChecked(user.isChatOn());
        }

        if (!ConferenceGlobals.isPresenterAVAudioDisabled()) {
            HorizontalPanel hp3 = new HorizontalPanel();
            this.audioControl = new CheckBox();
            hp3.add(audioControl);
            hp3.setStyleName("user-chat-button");
            hp3.setCellHorizontalAlignment(audioControl, HorizontalPanel.ALIGN_LEFT);
            hp3.setCellVerticalAlignment(audioControl, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp3);
            row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE);
            audioControl.setChecked(user.isAudioOn());
            if (!user.isAudioOn()) {
                audioControl.setEnabled(userManager.canEnableAudioFor(user.getUserId()));
            }
        }
        row.addStyleName("common-dialog-row");
        table.add(row);
    }

    return table;
}

From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java

License:Open Source License

protected Widget getLinks() {
    HorizontalPanel panel = new HorizontalPanel();
    final UIRosterEntry otherUser = ((UserListEntry) userEntry).getUser();
    if (UIGlobals.isActivePresenter(me) && !me.getUserId().equals(otherUser.getUserId())) {
        Label removeLink = new Label(UIStrings.getRemoveLabel());
        removeLink.setStyleName("common-text");
        removeLink.addStyleName("common-anchor");
        removeLink.addStyleName("dm-hover-popup-link");
        removeLink.addStyleName("user-remove-control-link");
        removeLink.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                String userName = otherUser.getDisplayName();
                ConfirmationDialog cd = new ConfirmationDialog(
                        ConferenceGlobals.getDisplayString("remove.header", "Remove") + " " + userName,
                        ConferenceGlobals.getDisplayString("remove.desc", "Are you sure you want to remove ")
                                + userName,
                        "default-message", new ConfirmationListener() {
                            public void onOK() {
                                userManager.removeUser(otherUser);
                            }/*from  w  w  w . ja  va  2 s .  c  o m*/

                            public void onCancel() {

                            }
                        });
                cd.drawDialog();
                hide();
            }
        });
        panel.add(removeLink);
        panel.setCellHorizontalAlignment(removeLink, HorizontalPanel.ALIGN_LEFT);
    }
    if (me.getUserId().equals(otherUser.getUserId())) {
        Label changePictureLink = new Label(UIStrings.getChangePictureLabel());
        changePictureLink.setStyleName("common-text");
        changePictureLink.addStyleName("common-anchor");
        changePictureLink.addStyleName("dm-hover-popup-link");
        changePictureLink.addStyleName("user-change-picture-control-link");
        changePictureLink.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                ChangePictureDialog dlg = new ChangePictureDialog(userManager, me);
                dlg.drawDialog();
                hide();
            }
        });
        panel.add(changePictureLink);
        panel.setCellWidth(changePictureLink, "100%");
        panel.setCellHorizontalAlignment(changePictureLink, HorizontalPanel.ALIGN_RIGHT);
    }
    return panel;
}

From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java

License:Open Source License

protected void writeHeader3() {
    HorizontalPanel header = new HorizontalPanel();
    /*/*from  www . j  ava  2 s. c  o  m*/
    if(ConferenceGlobals.privateChatEnabled)
    {
       addControl(header,userEntry.getImage1Url(),controlsProvider.getImage1ClickListener());
       addControl(header,userEntry.getImage2Url(),controlsProvider.getImage2ClickListener());
    }
    addControl(header,userEntry.getImage3Url(),controlsProvider.getImage3ClickListener());
    addControl(header,userEntry.getImage4Url(),controlsProvider.getImage4ClickListener());*/
    Label userID = new Label(((UserListEntry) userEntry).getUser().getDisplayName());
    userID.setStyleName("user-menu-item");
    header.add(userID);

    /*Label email = new Label(me.getEmail());
    email.setStyleName("user-menu-item");
    email.addStyleName("common-anchor");
    header.add(email);*/

    header.setCellHorizontalAlignment(userID, HorizontalPanel.ALIGN_LEFT);
    //header.setCellHorizontalAlignment(email, HorizontalPanel.ALIGN_RIGHT);
    //header.setBorderWidth(1);
    headerPanel.add(header);

    header.setSize("100%", "100%");
    headerPanel.setCellWidth(header, "100%");
}

From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java

License:Open Source License

/**
 * This will create a menu item with one label
 * @param panel/*www  . j av  a 2  s .com*/
 * @param labelText
 * @param clickListener
 * @param hideOnClick
 */
private void addMoodControl(VerticalPanel panel, String labelText, ClickListener clickListener,
        boolean hideOnClick) {
    HorizontalPanel imageNText = new HorizontalPanel();
    //      FocusPanel   focusPanel = new FocusPanel();
    Label lbl = new Label(labelText);
    lbl.setStyleName("user-menu-entry");
    imageNText.add(lbl);
    imageNText.setCellHorizontalAlignment(lbl, HorizontalPanel.ALIGN_LEFT);

    HTML lbl2 = new HTML("&raquo;");
    //lbl2.setStyleName("user-menu-item");
    imageNText.add(lbl2);
    imageNText.setCellHorizontalAlignment(lbl2, HorizontalPanel.ALIGN_RIGHT);
    imageNText.setCellWidth(lbl, "100%");
    imageNText.setCellHeight(lbl2, "100%");
    imageNText.setWidth("100%");
    //imageNText.setBorderWidth(1);
    //      focusPanel.add(imageNText);

    if (null != clickListener) {
        HoverStyler hs = new HoverStyler(moodListener, imageNText, null);
        lbl.addMouseListener(hs);
        lbl.addStyleName("user-menu-entry-enabled");
        lbl.addClickListener(clickListener);
        lbl2.addMouseListener(hs);
        lbl2.addClickListener(clickListener);
    } else {
        lbl.addStyleName("user-menu-entry-disabled");
    }
    if (hideOnClick) {
        ClickListener clickListener2 = new ClickListener() {
            public void onClick(Widget w) {
                //Window.alert(" clicked on an item now hiding menu");
                hide();
            }
        };
        lbl.addClickListener(clickListener2);
    }

    panel.add(imageNText);
    panel.setCellWidth(imageNText, "100%");
}