Example usage for com.google.gwt.user.client.ui Label addClickListener

List of usage examples for com.google.gwt.user.client.ui Label addClickListener

Introduction

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

Prototype

@Deprecated
public void addClickListener(ClickListener listener) 

Source Link

Usage

From source file:com.apress.progwt.client.widget.datepicker.TodayPanel.java

License:Apache License

public void init() {
    Label todayLink = new Label("Today");
    todayLink.addClickListener(this);
    this.add(todayLink);
    this.setWidth(100 + "%");
    this.setHeight(16 + "px");
    this.setStyleName("todayPanel");
}

From source file:com.dimdim.conference.ui.common.client.util.DmGlassPanel.java

License:Open Source License

public DmGlassPanel(ModalDialog modalDialog) {
    this.modalDialog = modalDialog;

    Label l = new Label(" ");
    add(basePanel);//from   ww  w . j a  v  a 2s.  c  o m
    l.addClickListener(this);
    basePanel.add(scrollPanel);
    scrollPanel.add(l);

    basePanel.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    scrollPanel.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    basePanel.setStyleName("common-glass-panel");
    basePanel.setCellHorizontalAlignment(l, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(l, VerticalPanel.ALIGN_MIDDLE);
    this.setPopupPosition(0, 0);
}

From source file:com.dimdim.conference.ui.common.client.util.DmGlassPanel2.java

License:Open Source License

public DmGlassPanel2(NonModalPopupPanel popup) {
    this.popup = popup;

    Label l = new Label(" ");
    add(basePanel);//from w  ww  .  j av a2s  . c  o m
    l.addClickListener(this);
    basePanel.add(scrollPanel);
    scrollPanel.add(l);

    basePanel.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    l.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    scrollPanel.setSize(Window.getClientWidth() + "px", Window.getClientHeight() + "px");
    basePanel.setStyleName("common-glass-panel-2");
    basePanel.setCellHorizontalAlignment(l, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(l, VerticalPanel.ALIGN_MIDDLE);
    this.setPopupPosition(0, 0);
}

From source file:com.dimdim.conference.ui.dialogues.client.common.PermissionsControlDialog.java

License:Open Source License

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

    /*
    HorizontalPanel header1 = new HorizontalPanel();
    header1.add(createLabel("Conference Permissions","conference-permissions-header"));
            
    Label chat1 = createLabel("Chat","conference-chat-button-header");
    header1.add(chat1);
    Label audio1 = createLabel("Audio","conference-chat-button-header");
    header1.add(audio1);
    Label video1 = createLabel("Video","conference-chat-button-header");
    header1.add(video1);
            
    header1.addStyleName("common-dialog-row");
    table.add(header1);
            
    HorizontalPanel defaultsRow = new HorizontalPanel();
    defaultsRow.addStyleName("common-dialog-row");
    Label text1 = createTextHTML("Let all attendees to:",
       "conference-permissions-comment-1");
    defaultsRow.add(text1);
            
    HorizontalPanel hp21 = new HorizontalPanel();
    CheckBox cb11 = new CheckBox();
    hp21.add(cb11);
    hp21.setStyleName("user-chat-button");
    hp21.setCellHorizontalAlignment(cb11,HorizontalPanel.ALIGN_LEFT);
    hp21.setCellVerticalAlignment(cb11,VerticalPanel.ALIGN_MIDDLE);
    defaultsRow.add(hp21);
    defaultsRow.setCellHorizontalAlignment(hp21,HorizontalPanel.ALIGN_LEFT);
    defaultsRow.setCellVerticalAlignment(hp21,VerticalPanel.ALIGN_MIDDLE);
            
    HorizontalPanel hp31 = new HorizontalPanel();
    CheckBox cb21 = new CheckBox();
    hp31.add(cb21);
    hp31.setStyleName("user-chat-button");
    hp31.setCellHorizontalAlignment(cb21,HorizontalPanel.ALIGN_LEFT);
    hp31.setCellVerticalAlignment(cb21,VerticalPanel.ALIGN_MIDDLE);
    defaultsRow.add(hp31);
    defaultsRow.setCellHorizontalAlignment(hp31,HorizontalPanel.ALIGN_LEFT);
    defaultsRow.setCellVerticalAlignment(hp31,VerticalPanel.ALIGN_MIDDLE);
            
    HorizontalPanel hp41 = new HorizontalPanel();
    CheckBox cb31 = new CheckBox();
    hp41.add(cb31);
    hp41.setStyleName("user-chat-button");
    hp41.setCellHorizontalAlignment(cb31,HorizontalPanel.ALIGN_LEFT);
    hp41.setCellVerticalAlignment(cb31,VerticalPanel.ALIGN_MIDDLE);
    defaultsRow.add(hp41);
    defaultsRow.setCellHorizontalAlignment(hp41,HorizontalPanel.ALIGN_LEFT);
    defaultsRow.setCellVerticalAlignment(hp41,VerticalPanel.ALIGN_MIDDLE);
            
    table.add(defaultsRow);
            
    HTML line1 = new HTML(" ");
    line1.setStyleName("section-break");
    table.add(line1);
            
    HorizontalPanel header2 = new HorizontalPanel();
    header2.add(createLabel("Enable Meeting Lobby","conference-permissions-header"));
            
    HorizontalPanel hp22 = new HorizontalPanel();
    CheckBox cb12 = new CheckBox();
    hp22.add(cb12);
    hp22.setStyleName("user-chat-button");
    hp22.setCellHorizontalAlignment(cb12,HorizontalPanel.ALIGN_LEFT);
    hp22.setCellVerticalAlignment(cb12,VerticalPanel.ALIGN_MIDDLE);
    header2.add(hp22);
    header2.setCellHorizontalAlignment(hp22,HorizontalPanel.ALIGN_LEFT);
    header2.setCellVerticalAlignment(hp22,VerticalPanel.ALIGN_MIDDLE);
            
    HTML filler1 = new HTML(".");
    filler1.setStyleName("conference-button-filler");
    header2.setCellHorizontalAlignment(filler1,HorizontalPanel.ALIGN_LEFT);
    header2.setCellVerticalAlignment(filler1,VerticalPanel.ALIGN_MIDDLE);
    header2.add(filler1);
            
    HTML filler2 = new HTML(".");
    filler2.setStyleName("conference-button-filler");
    header2.setCellHorizontalAlignment(filler2,HorizontalPanel.ALIGN_LEFT);
    header2.setCellVerticalAlignment(filler2,VerticalPanel.ALIGN_MIDDLE);
    header2.add(filler2);
            
    header2.addStyleName("common-dialog-row");
    table.add(header2);
            
    HTML line2 = new HTML(" ");
    line2.setStyleName("section-break");
    table.add(line2);
            
    */

    int size = this.listModel.getListSize();
    //   Now all the users if any are available.
    if (size > 0) {
        UIResources uiResources = UIResources.getUIResources();
        HorizontalPanel header = new HorizontalPanel();
        header.add(createLabel(ConferenceGlobals.getDisplayString("console.moodlabel", "Mood"),
                "user-image-header"));
        header.add(createLabel(UIStrings.getNameLabel(), "user-name-header"));
        //header.add(createLabel(UIStrings.getEmailLabel(),"user-email-header"));

        //if private chat is disbaled as feature 
        if (ConferenceGlobals.privateChatEnabled) {
            chatHeaderLabel = createLabel(UIStrings.getChatLabel(), "user-chat-button-header");
            chatHeaderLabel.addStyleName("common-anchor-default-color");
            header.add(chatHeaderLabel);
            chatHeaderLabel.addClickListener(this);
        }
        if (!ConferenceGlobals.isPresenterAVAudioDisabled() && ConferenceGlobals.partListEnabled) {
            String label = UIStrings.getAudioLabel();
            if (ConferenceGlobals.isPresenterAVVideoOnly()) {
                label = UIStrings.getVideoLabel();
                audioCheckBoxSet.setMaxChecked(userManager.getMaximumAttendeeVideos());
            }
            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.add(scroller);
        table.setCellWidth(scroller, "100%");
        int i = 0;
        for (i = 0; i < size; i++) {
            UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
            final UIRosterEntry user = ule.getUser();
            if (user.isHost()) {
                continue;
            }
            HorizontalPanel row = new HorizontalPanel();

            HorizontalPanel hp1 = new HorizontalPanel();
            Image image = UserGlobals.getUserGlobals().getMoodImageUrl(user.getMood());
            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");
            if (ConferenceGlobals.privateChatEnabled) {
                nameLabel.addClickListener(new ClickListener() {
                    public void onClick(Widget sender) {
                        NewChatController.getController().showChatPopupIfPossible(user);
                        hide();
                    }
                });
                nameLabel.addStyleName("common-anchor-default-color");
            }
            row.add(nameLabel);

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

            if (!ConferenceGlobals.isPresenterAVAudioDisabled() && ConferenceGlobals.partListEnabled) {
                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);
                if (user.isVideoOn() && !ConferenceGlobals.isPresenterAVVideoOnly()) {
                    cb2.setChecked(user.isVideoOn());
                    cb2.setEnabled(false);
                } else {
                    cb2.setChecked(user.isAudioOn());
                    if (ConferenceGlobals.isPresenterAVVideoOnly()) {
                        cb2.setChecked(user.isVideoOn());
                    }
                    this.audioCheckBoxes.put(user.getUserId(), cb2);
                    this.audioCheckBoxSet.addCheckBox(cb2);
                }
            }
            /*
            HorizontalPanel hp4 = new HorizontalPanel();
            CheckBox cb3 = new CheckBox();
            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);
            cb3.setChecked(user.isVideoOn());
            this.videoCheckBoxes.put(user.getUserId(),cb3);
            */

            row.addStyleName("common-dialog-row");
            scrolledTable.add(row);
        }
    } else {
        HorizontalPanel header2 = new HorizontalPanel();
        header2.add(createLabel(UIStrings.getNoParticipantsMessage(), "conference-permissions-header"));

        table.add(header2);
    }
    return table;
}

From source file:com.dimdim.conference.ui.dialogues.client.common.UserControlDialog.java

License:Open Source License

protected Widget getContent() {
    ScrollPanel scroller = new ScrollPanel();
    scroller.setStyleName("list-popup-scroll-panel");
    VerticalPanel table = new VerticalPanel();
    VerticalPanel scrolledTable = new VerticalPanel();
    scroller.add(scrolledTable);/*www .  j  a v  a 2 s  .  c o  m*/
    //      table.setStyleName("list-control-table");

    //UIResources  uiResources = UIResources.getUIResources();
    //String   subject = uiResources.getConferenceInfo("subject");
    int size = this.listModel.getListSize();
    int i = 0;
    if (size > 0) {
        HorizontalPanel header = new HorizontalPanel();
        header.add(createLabel(ConferenceGlobals.getDisplayString("console.moodlabel", "Mood"),
                "user-image-header"));
        header.add(createLabel(UIStrings.getNameLabel(), "user-name-header"));
        //header.add(createLabel(UIStrings.getEmailLabel(),"user-email-header"));

        if (this.allowUserControl) {
            Label chat = createLabel(UIStrings.getChatLabel(), "user-chat-button-header");
            chat.addStyleName("common-anchor-default-color");
            header.add(chat);
            String label = UIStrings.getAudioLabel();
            if (ConferenceGlobals.isPresenterAVVideoOnly()) {
                label = UIStrings.getVideoLabel();
            }
            Label audio = createLabel(label, "user-chat-button-header");
            audio.addStyleName("common-anchor-default-color");
            header.add(audio);

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

        for (i = 0; i < size; i++) {
            UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i);
            final UIRosterEntry user = ule.getUser();
            //            UIListEntryPanelMouseAndClickListener mcl = new UIListEntryPanelMouseAndClickListener(
            //                  ule,this.userListAndEntryProperties,this.userListEntryManager);
            //            mcl.setSecondLevelPopup(true);

            HorizontalPanel row = new HorizontalPanel();

            HorizontalPanel hp1 = new HorizontalPanel();
            Image image = UserGlobals.getUserGlobals().getMoodImageUrl(user.getMood());
            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 = createTextLabel(user.getDisplayName(), "user-name");
            if (!me.getUserId().equals(user.getUserId())) {
                if (ConferenceGlobals.privateChatEnabled) {
                    nameLabel.addStyleName("common-anchor-default-color");
                    nameLabel.addClickListener(new ClickListener() {
                        public void onClick(Widget sender) {
                            NewChatController.getController().showChatPopupIfPossible(user);
                            hide();
                        }
                    });
                }
            }
            //            nameLabel.addClickListener(mcl);
            //            nameLabel.addMouseListener(mcl);
            row.add(nameLabel);

            if (this.allowUserControl) {
                HorizontalPanel hp2 = new HorizontalPanel();
                CheckBox cb1 = new CheckBox();
                hp2.add(cb1);
                hp2.setStyleName("user-chat-button");
                hp2.setCellHorizontalAlignment(cb1, HorizontalPanel.ALIGN_LEFT);
                hp2.setCellVerticalAlignment(cb1, VerticalPanel.ALIGN_MIDDLE);
                row.add(hp2);
                row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
                row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);

                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);

                //               HorizontalPanel hp4 = new HorizontalPanel();
                //               CheckBox cb3 = new CheckBox();
                //               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);
        }
    } else {
        HorizontalPanel header2 = new HorizontalPanel();
        header2.add(createLabel(UIStrings.getNoParticipantsMessage(), "conference-permissions-header"));

        table.add(header2);
    }

    return table;
}

From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPopupPanel.java

License:Open Source License

public void paintPanel(String typeName) {
    this.typeName = typeName;
    ClickListener headerClickListener = rtpcp.getTypePopupHeaderClickListener(typeName);
    ClickListener footerClickListener = rtpcp.getTypePopupFooterClickListener(this.typeName);

    /*if(UIResourceObject.RESOURCE_TYPE_COBROWSE.equalsIgnoreCase(typeName))
    {/*from   w  ww . j  a  v a  2  s . com*/
       headerClickListener = rtpcp.getShareCobClickListener();
    }*/
    pane.addMouseListener(this);
    pane.addFocusListener(this);

    DockPanel outer = new DockPanel();
    outer.setStyleName("dm-hover-popup-body");
    pane.add(outer);

    if (headerClickListener != null) {
        //         headerPanel.setStyleName("dm-hover-popup-header");
        outer.add(headerPanel, DockPanel.NORTH);
        outer.setCellWidth(headerPanel, "100%");

        String selectLabel = ConferenceGlobals.getDisplayString(typeName + ".select.label", "Upload Document");
        Label headerLink = new Label(selectLabel);
        //         headerLink.setStyleName("tool-entry");
        headerLink.setStyleName("resource-popup-header-entry");
        headerLink.addStyleName("anchor-cursor");
        headerPanel.add(headerLink);
        headerPanel.setCellWidth(headerLink, "100%");
        headerPanel.setStyleName("resource-popup-header-panel");
        headerPanel.setCellHorizontalAlignment(headerLink, HorizontalPanel.ALIGN_LEFT);
        headerPanel.setCellVerticalAlignment(headerLink, VerticalPanel.ALIGN_MIDDLE);
        headerLink.addClickListener(headerClickListener);
        headerLink.addClickListener(this);
    } else {
        //         Window.alert("No header listener");
    }

    this.writeListPanel(outer);
    //      this.contentPanel.setStyleName("dm-hover-popup-content");
    //      outer.add(contentPanel,DockPanel.NORTH);
    //      outer.setCellHeight(contentPanel,"100%");
    //      outer.setCellWidth(contentPanel,"100%");

    if (footerClickListener != null) {
        //         this.linksPanel.setStyleName("dm-hover-popup-header");
        outer.add(linksPanel, DockPanel.SOUTH);
        outer.setCellHeight(linksPanel, "100%");

        String manageLabel = ConferenceGlobals.getDisplayString(typeName + ".manage.label", "Manage Document");
        Label footerLink = new Label(manageLabel);
        //         footerLink.setStyleName("tool-entry");
        footerLink.setStyleName("resource-popup-footer-entry");
        footerLink.addStyleName("anchor-cursor");
        linksPanel.add(footerLink);
        linksPanel.setCellHorizontalAlignment(footerLink, HorizontalPanel.ALIGN_LEFT);
        linksPanel.setCellVerticalAlignment(footerLink, VerticalPanel.ALIGN_MIDDLE);
        footerLink.addClickListener(footerClickListener);
        footerLink.addClickListener(this);
    } else {
        //         Window.alert("No footer listener");
    }

    //      if (panel != null)
    //      {
    //         this.contentPanel.add(panel);
    //         this.contentPanel.setCellWidth(panel, "100%");
    //         this.contentPanel.setCellHeight(panel, "100%");
    //      }

    this.add(pane);
    this.addPopupListener(this);
}

From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPopupPanel.java

License:Open Source License

private void writeListPanel(DockPanel outer) {
    Vector vec = new Vector();
    UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource();
    numberOfItems = 0;//from  w  w w. j  a v a 2  s.c  o m

    int size = this.resourceList.getListSize();
    for (int i = 0; i < size; i++) {
        UIResourceObject res = ((ResourceListEntry) this.resourceList.getListEntryAt(i)).getResource();
        if (res.getResourceType().equals(this.typeName)) {
            Label resLabel = new FixedLengthLabel(res.getResourceName(), 26);
            //            resLabel.setStyleName("tool-entry");
            resLabel.setStyleName("resource-entry");
            resLabel.addStyleName("anchor-cursor");
            resLabel.addClickListener(this);
            resLabel.addClickListener(this.rtpcp.getNameLabelClickListener(res));

            HorizontalPanel h1 = new HorizontalPanel();
            Widget img = new HorizontalPanel();

            if (currentActiveResource != null
                    && currentActiveResource.getResourceId().equals(res.getResourceId())) {
                img = this.getSharingInProgressImageUrl();
                //               h2.add(img);
                //               h2.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE);
                //               h2.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_CENTER);
            } else {
                img = new Label(" ");
                img.setWidth("18px");
                //               h2.add(filler);
            }
            //            h2.setWidth("18px");
            h1.add(img);
            //            h1.setCellWidth(img, "100%");
            h1.setCellHeight(img, "100%");
            h1.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_LEFT);
            h1.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE);
            h1.add(resLabel);
            h1.setCellWidth(resLabel, "100%");
            h1.setCellHeight(resLabel, "100%");
            h1.setCellVerticalAlignment(resLabel, VerticalPanel.ALIGN_MIDDLE);
            h1.setStyleName("resource-entry-panel");
            if (numberOfItems == 0) {
                h1.addStyleName("first-resource-entry-panel");
            }
            resLabel.addMouseListener(new ResourceHoverStyler(h1));
            vec.add(h1);
            //            panel.add(h1);
            //            panel.setCellWidth(h1, "100%");
            //            panel.setCellHorizontalAlignment(h1, HorizontalPanel.ALIGN_LEFT);
            //            panel.setCellVerticalAlignment(h1, VerticalPanel.ALIGN_MIDDLE);
            numberOfItems++;
        }
    }

    if (numberOfItems != 0) {
        int scrollLimit = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_limit", 5);
        if (numberOfItems > scrollLimit) {
            ScrollPanel sp = new ScrollPanel();
            int width = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_width", 250);
            int barWidth = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_bar_width",
                    250);
            int height = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_height", 150);
            sp.setSize(width + "px", height + "px");
            VerticalPanel panel = new VerticalPanel();
            panel.setSize((width - barWidth) + "px", height + "px");
            sp.add(panel);
            outer.add(sp, DockPanel.NORTH);
            outer.setCellHorizontalAlignment(sp, HorizontalPanel.ALIGN_LEFT);
            outer.setCellVerticalAlignment(sp, VerticalPanel.ALIGN_MIDDLE);
            int size2 = vec.size();
            for (int i = 0; i < size2; i++) {
                HorizontalPanel h = (HorizontalPanel) vec.elementAt(i);
                panel.add(h);
                panel.setCellWidth(h, "100%");
                panel.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT);
                panel.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE);
            }
        } else {
            int size2 = vec.size();
            for (int i = 0; i < size2; i++) {
                HorizontalPanel h = (HorizontalPanel) vec.elementAt(i);
                outer.add(h, DockPanel.NORTH);
                outer.setCellWidth(h, "100%");
                outer.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT);
                outer.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE);
            }
        }
    } else {
    }
}

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. jav  a  2 s  .  co 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 Label getMoodLabel(final UserMood mood, final boolean custom) {
    Label moodMenu = new Label(mood.getDisplayLabel());
    moodMenu.setStyleName("common-text");
    moodMenu.addStyleName("common-anchor");
    moodMenu.addClickListener(new ClickListener() {
        public void onClick(Widget w) {
            sendMoodChange(mood.getMood(), custom);
            //            //hide();
        }/*  w ww  .j a v a2s  .c  o m*/
    });
    /*
    Command cmd = new Command()
    {
       public void execute()
       {
    sendMoodChange(mood.getMood(),custom);
    hide();
       }
    };
            
    MenuItem moodMenuItem = new MenuItem(, cmd);
    moodMenuItem.setStyleName("mood-menu-item");
    moodMenu.addItem(moodMenuItem);
    */

    return moodMenu;
}

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 ww w  . j  av  a2  s  .  co 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;
}