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.common.client.user.NewChatPanel.java

License:Open Source License

private void addText(Widget lbl, boolean host) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.add(lbl);
    if (chatMessages.getWidgetCount() > maxMessages) {
        for (int i = trimMessages; i >= 0; i--) {
            chatMessages.remove(i);/*from w  w w.ja  v  a2 s .c o  m*/
        }
    }
    this.chatMessages.add(hp);
    this.chatMessages.setCellWidth(hp, "100%");
    if (host) {
        hp.addStyleName("host-chat-message");
    } else {
        hp.addStyleName("remote-chat-message");
    }

    if (!this.textBoxHasFocus) {
        if (this.unreadMessaeListener != null) {
            this.unreadMessaeListener.hasNewUnreadMessage();
        }
    } else {
        if (this.unreadMessaeListener != null) {
            this.unreadMessaeListener.seenUnreadMessage();
        }
    }

    int scrollPosition = scrollPanel.getScrollPosition();
    DebugPanel.getDebugPanel().addDebugMessage("Chat Panel scroll position:" + scrollPosition);
    if (scrollPosition < 0) {
        scrollPosition = 0;
    }
    /*if(scrollPosition < scrollMax)
    {
       scrollMax += scrollPosition;
    }*/
    //      Window.alert("Scroll position " + scrollPosition );
    //      Window.alert("Scroll Max " + scrollMax);
    scrollMax += scrollPosition;
    scrollPanel.setScrollPosition(scrollMax);
}

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

License:Open Source License

public CommonModalDialog(String title) {
    this.title = title;

    HorizontalPanel caption = new HorizontalPanel();
    caption.setWidth("100%");
    captionText = new Label(title);
    //      captionText.setStyleName("common-table-header");
    caption.add(captionText);
    caption.setCellWidth(captionText, "100%");

    close = UIImages.getImageBundle(UIImages.defaultSkin).getCloseDialog();
    close.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            hide();/*from www.  j  a v  a 2  s  .c o m*/
        }
    });
    caption.add(close);

    scrollPanel_H.add(caption);
    //      scrollPanel_H.setCellWidth(caption, "100%");
    //      scrollPanel_H.add(close);

    setCaption(scrollPanel_H);
    caption.addStyleName("draggable-panel-header");
    close.addStyleName("anchor-cursor");
}

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

License:Open Source License

public void drawDialog() {
    this.defaultCloseListener = new ClickListener() {
        public void onClick(Widget sender) {
            hide();//from w ww  . ja  va 2  s . c  o m
        }
    };
    closeButton = new Button(closeButtonText, this.defaultCloseListener);

    //      DomUtil.setId(this, "dialog-styled");
    vp = new VerticalPanel();
    //      setWidget(rp);

    vp.setStyleName("common-dialog-outer-panel");

    //       Window.alert("1");

    if (this.closeListener != null) {
        this.closeButton.addClickListener(this.closeListener);
    }
    closeButton.setStyleName("dm-popup-close-button");
    buttonPanel.add(closeButton, DockPanel.EAST);
    buttonPanel.setSpacing(0);
    HTML filler1 = new HTML("&nbsp;");
    buttonPanel.add(filler1, DockPanel.EAST);

    //       Window.alert("2");

    footerButtons = this.getFooterButtons();
    if (footerButtons != null) {
        int size = footerButtons.size();
        for (int i = 0; i < size; i++) {
            Button button = (Button) footerButtons.elementAt(i);
            buttonPanel.add(button, DockPanel.EAST);
            HTML filler2 = new HTML("&nbsp;");
            buttonPanel.add(filler2, DockPanel.EAST);
        }
    }

    //       Window.alert("3");

    this.messageLabel.setStyleName("common-text");
    this.messageLabel.addStyleName("dialog-message-label");
    buttonPanel.add(this.messageLabel, DockPanel.WEST);
    buttonPanel.setCellVerticalAlignment(this.messageLabel, VerticalPanel.ALIGN_MIDDLE);
    buttonPanel.setCellWidth(this.messageLabel, "100%");

    Widget c = getContent();

    if (this.dialogName != null) {
        //          Window.alert("4");

        //   Create a width adjustment panel.
        String widthStyle = this.dialogName + "-dialog-width";
        String heightStyle1 = this.dialogName + "-dialog-height-one";
        String heightStyle2 = this.dialogName + "-dialog-height-two";
        String contentWidthStyle = this.dialogName + "-dialog-content";

        c.addStyleName(contentWidthStyle);
        upperPanel = new HorizontalPanel();

        HTML upperLeftBar = new HTML("&nbsp;");
        upperLeftBar.setStyleName(heightStyle1);
        upperPanel.add(upperLeftBar);
        upperPanel.add(c);
        upperPanel.setCellWidth(c, "100%");
        upperPanel.setCellVerticalAlignment(c, VerticalPanel.ALIGN_MIDDLE);

        HorizontalPanel lowerPanel = new HorizontalPanel();
        lowerPanel.setStyleName(widthStyle);

        HTML lowerLeftBar = new HTML("&nbsp;");
        lowerLeftBar.setStyleName(heightStyle2);
        lowerPanel.add(lowerLeftBar);
        lowerPanel.add(buttonPanel);
        lowerPanel.setCellWidth(buttonPanel, "100%");
        lowerPanel.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT);
        lowerPanel.setCellVerticalAlignment(buttonPanel, VerticalPanel.ALIGN_MIDDLE);

        //          Window.alert("5");
        vp.add(upperPanel);
        vp.add(lowerPanel);
    } else {
        //          Window.alert("6");

        vp.add(c);
        vp.setCellWidth(c, "100%");

        vp.add(buttonPanel);
        vp.setCellWidth(buttonPanel, "100%");
        vp.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT);
        //          Window.alert("7");

    }
    //      RoundedPanel rp = new RoundedPanel(vp);
    //      rp.setStyleName("common-dialog-rounded-corner-panel");

    //      Window.alert("8");

    scrollPanel.add(vp);

    add(scrollPanel);

    /*
    FocusWidget fw = getFocusWidget();
    if (fw != null)
    {
       this.getFocusModel().add(fw);
    }
    else
    {
       Window.alert("No focus widget provided");
    }
    */
    this.setFocusModel(new FocusModel() {
        public HasFocus getFocusWidget() {
            return getDmFocusModel();
        }
    });

    DmGlassPanel dgp = new DmGlassPanel(this);
    dgp.show();
    //      show();
}

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);//from   w  w  w.j  av a 2 s  .co  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("&nbsp;");
    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("&nbsp;");
    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.PermissionsControlDialog.java

License:Open Source License

protected Widget createHeaderWidget(String text, String style) {
    HorizontalPanel hp = new HorizontalPanel();
    CheckBox cb = new CheckBox();
    cb.setStyleName("control-table-header-checkbox");
    hp.setCellVerticalAlignment(cb, VerticalPanel.ALIGN_MIDDLE);

    hp.add(createLabel(text, style));
    hp.add(cb);/*w  w w. ja v a2 s  .com*/
    hp.setStyleName("control-table-header-checkbox-combo");

    return hp;
}

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);/*from  w w  w . ja  va2 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.dialogues.client.FeedbackDialog.java

License:Open Source License

protected Widget getContent() {
    basePanel = new VerticalPanel();
    message = new TextArea();

    basePanel.add(this.rateExperienceComment);
    basePanel.setCellWidth(this.rateExperienceComment, "100%");
    basePanel.setCellVerticalAlignment(this.rateExperienceComment, VerticalPanel.ALIGN_MIDDLE);
    this.rateExperienceComment.setStyleName("invitations-preview-comment");

    HTML line1 = new HTML("&nbsp;");
    line1.setStyleName("line-break");
    basePanel.add(line1);/*  www.j a va  2 s .  co  m*/

    HorizontalPanel excellentPanel = new HorizontalPanel();
    excellentPanel.add(this.excellent);
    this.excellent.addStyleName("feedback-button");
    excellentPanel.setCellVerticalAlignment(this.excellent, VerticalPanel.ALIGN_MIDDLE);
    excellentPanel.add(this.excellentButtonTag);
    excellentPanel.setCellVerticalAlignment(this.excellentButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.excellentButtonTag.setWordWrap(false);
    this.excellentButtonTag.setStyleName("invitations-preview-comment");
    this.excellentButtonTag.addStyleName("feedback-button-tag-text");
    basePanel.add(excellentPanel);

    HorizontalPanel goodPanel = new HorizontalPanel();
    goodPanel.add(this.good);
    this.good.addStyleName("feedback-button");
    goodPanel.setCellVerticalAlignment(this.good, VerticalPanel.ALIGN_MIDDLE);
    goodPanel.add(this.goodButtonTag);
    goodPanel.setCellVerticalAlignment(this.goodButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.goodButtonTag.setWordWrap(false);
    this.goodButtonTag.setStyleName("invitations-preview-comment");
    this.goodButtonTag.addStyleName("feedback-button-tag-text");
    basePanel.add(goodPanel);

    HorizontalPanel neutralPanel = new HorizontalPanel();
    neutralPanel.add(this.neutral);
    this.neutral.addStyleName("feedback-button");
    neutralPanel.setCellVerticalAlignment(this.neutral, VerticalPanel.ALIGN_MIDDLE);
    neutralPanel.add(this.neutralButtonTag);
    neutralPanel.setCellVerticalAlignment(this.neutralButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.neutralButtonTag.setWordWrap(false);
    this.neutralButtonTag.setStyleName("invitations-preview-comment");
    this.neutralButtonTag.addStyleName("feedback-button-tag-text");
    basePanel.add(neutralPanel);

    HorizontalPanel fairPanel = new HorizontalPanel();
    fairPanel.add(this.fair);
    this.fair.addStyleName("feedback-button");
    fairPanel.setCellVerticalAlignment(this.fair, VerticalPanel.ALIGN_MIDDLE);
    fairPanel.add(this.fairButtonTag);
    fairPanel.setCellVerticalAlignment(this.fairButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.fairButtonTag.setWordWrap(false);
    this.fairButtonTag.setStyleName("invitations-preview-comment");
    this.fairButtonTag.addStyleName("feedback-button-tag-text");
    basePanel.add(fairPanel);

    HorizontalPanel poorPanel = new HorizontalPanel();
    poorPanel.add(this.poor);
    this.poor.addStyleName("feedback-button");
    poorPanel.setCellVerticalAlignment(this.poor, VerticalPanel.ALIGN_MIDDLE);
    poorPanel.add(this.poorButtonTag);
    poorPanel.setCellVerticalAlignment(this.poorButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.poorButtonTag.setWordWrap(false);
    this.poorButtonTag.setStyleName("invitations-preview-comment");
    this.poorButtonTag.addStyleName("feedback-button-tag-text");
    basePanel.add(poorPanel);

    HTML line2 = new HTML("&nbsp;");
    line2.setStyleName("line-break");
    basePanel.add(line2);

    //      Window.alert("5");
    HTML messageComment = new HTML(UIGlobals.getFeedbackMessageComment());
    basePanel.add(messageComment);
    basePanel.setCellWidth(messageComment, "100%");
    messageComment.setStyleName("invitations-preview-comment");
    basePanel.add(message);
    message.setVisibleLines(4);
    basePanel.setCellWidth(message, "100%");
    message.setStyleName("invitations-preview-textarea");

    HTML line3 = new HTML("&nbsp;");
    line3.setStyleName("line-break");
    basePanel.add(line3);

    return basePanel;
}

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

License:Open Source License

protected Widget getContent() {
    SettingsModel currentSettings = ClientModel.getClientModel().getSettingsModel();
    RosterModel rosterModel = ClientModel.getClientModel().getRosterModel();
    String currentNetworkProfile = rosterModel.getCurrentUser().getNetProfile();
    String currentImageQuality = rosterModel.getCurrentUser().getImgQuality();
    int currentMaxAudios = rosterModel.getMaximumAttendeeAudios();
    UIParams uiParams = UIParams.getUIParams();
    basePanel = new VerticalPanel();

    //      basePanel.setStyleName("send-invitation-preview-box");
    basePanel.add(this.settingsMainComment);
    basePanel.setCellWidth(this.settingsMainComment, "100%");
    this.settingsMainComment.setStyleName("invitations-preview-comment");

    HTML line0 = new HTML("&nbsp;");
    line0.setStyleName("line-break");
    basePanel.add(line0);/*from ww  w .  ja  v  a  2  s  . c om*/

    //   Meeting Lobby

    HorizontalPanel lobbyControlButtons = new HorizontalPanel();
    lobbyControlButtons.add(this.meetingLobbyComment);
    lobbyControlButtons.setCellVerticalAlignment(this.meetingLobbyComment, VerticalPanel.ALIGN_MIDDLE);
    this.meetingLobbyComment.setStyleName("invitations-preview-comment");
    this.meetingLobbyComment.addStyleName("settings-item-heading");

    this.enableLobby.setChecked(currentSettings.isLobbyEnabled());
    lobbyControlButtons.add(this.enableLobby);
    lobbyControlButtons.setCellVerticalAlignment(this.enableLobby, VerticalPanel.ALIGN_MIDDLE);
    lobbyControlButtons.add(this.enableLobbyButtonTag);
    lobbyControlButtons.setCellVerticalAlignment(this.enableLobbyButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.enableLobbyButtonTag.setWordWrap(false);
    this.enableLobbyButtonTag.setStyleName("invitations-preview-comment");
    this.enableLobbyButtonTag.addStyleName("settings-button-tag-text");

    this.disableLobby.setChecked(!currentSettings.isLobbyEnabled());
    lobbyControlButtons.add(this.disableLobby);
    lobbyControlButtons.setCellVerticalAlignment(this.disableLobby, VerticalPanel.ALIGN_MIDDLE);
    lobbyControlButtons.add(this.disableLobbyButtonTag);
    lobbyControlButtons.setCellVerticalAlignment(this.disableLobbyButtonTag, VerticalPanel.ALIGN_MIDDLE);
    this.disableLobbyButtonTag.setWordWrap(false);
    this.disableLobbyButtonTag.setStyleName("invitations-preview-comment");
    this.disableLobbyButtonTag.addStyleName("settings-button-tag-text");

    basePanel.add(lobbyControlButtons);

    //   Network Profile

    if (ConferenceGlobals.publisherEnabled) {
        HTML line1 = new HTML("&nbsp;");
        line1.setStyleName("line-break");
        basePanel.add(line1);

        HorizontalPanel networkProfileButtons = new HorizontalPanel();
        networkProfileButtons.add(this.networkProfileComment);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfileComment, VerticalPanel.ALIGN_MIDDLE);
        this.networkProfileComment.setStyleName("invitations-preview-comment");
        this.networkProfileComment.addStyleName("settings-item-heading");

        this.networkProfile1.setChecked(currentNetworkProfile.equals("1"));
        networkProfileButtons.add(this.networkProfile1);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile1, VerticalPanel.ALIGN_MIDDLE);
        networkProfileButtons.add(this.networkProfile1ButtonTag);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile1ButtonTag,
                VerticalPanel.ALIGN_MIDDLE);
        this.networkProfile1ButtonTag.setWordWrap(false);
        this.networkProfile1ButtonTag.setStyleName("invitations-preview-comment");
        this.networkProfile1ButtonTag.addStyleName("settings-button-tag-text");

        this.networkProfile2.setChecked(currentNetworkProfile.equals("2"));
        networkProfileButtons.add(this.networkProfile2);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile2, VerticalPanel.ALIGN_MIDDLE);
        networkProfileButtons.add(this.networkProfile2ButtonTag);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile2ButtonTag,
                VerticalPanel.ALIGN_MIDDLE);
        this.networkProfile2ButtonTag.setWordWrap(false);
        this.networkProfile2ButtonTag.setStyleName("invitations-preview-comment");
        this.networkProfile2ButtonTag.addStyleName("settings-button-tag-text");

        this.networkProfile3.setChecked(currentNetworkProfile.equals("3"));
        networkProfileButtons.add(this.networkProfile3);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile3, VerticalPanel.ALIGN_MIDDLE);
        networkProfileButtons.add(this.networkProfile3ButtonTag);
        networkProfileButtons.setCellVerticalAlignment(this.networkProfile3ButtonTag,
                VerticalPanel.ALIGN_MIDDLE);
        this.networkProfile3ButtonTag.setWordWrap(false);
        this.networkProfile3ButtonTag.setStyleName("invitations-preview-comment");
        this.networkProfile3ButtonTag.addStyleName("settings-button-tag-text");

        basePanel.add(networkProfileButtons);

        //         HTML line2 = new HTML("&nbsp;");
        //         line2.setStyleName("line-break");
        //         basePanel.add(line2);

        //   Image Quality

        //         HorizontalPanel imageQualityButtons = new HorizontalPanel();
        //         imageQualityButtons.add(this.imageQualityComment);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityComment, VerticalPanel.ALIGN_MIDDLE);
        //         this.imageQualityComment.setStyleName("invitations-preview-comment");
        //         this.imageQualityComment.addStyleName("settings-item-heading");
        //         
        //         this.imageQualityLow.setChecked(currentImageQuality.equalsIgnoreCase("low"));
        //         imageQualityButtons.add(this.imageQualityLow);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityLow, VerticalPanel.ALIGN_MIDDLE);
        //         imageQualityButtons.add(this.imageQualityLowButtonTag);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityLowButtonTag, VerticalPanel.ALIGN_MIDDLE);
        //         this.imageQualityLowButtonTag.setWordWrap(false);
        //         this.imageQualityLowButtonTag.setStyleName("invitations-preview-comment");
        //         this.imageQualityLowButtonTag.addStyleName("settings-button-tag-text");
        //         
        //         this.imageQualityMedium.setChecked(currentImageQuality.equalsIgnoreCase("medium"));
        //         imageQualityButtons.add(this.imageQualityMedium);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityMedium, VerticalPanel.ALIGN_MIDDLE);
        //         imageQualityButtons.add(this.imageQualityMediumButtonTag);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityMediumButtonTag, VerticalPanel.ALIGN_MIDDLE);
        //         this.imageQualityMediumButtonTag.setWordWrap(false);
        //         this.imageQualityMediumButtonTag.setStyleName("invitations-preview-comment");
        //         this.imageQualityMediumButtonTag.addStyleName("settings-button-tag-text");
        //         
        //         this.imageQualityHigh.setChecked(currentImageQuality.equalsIgnoreCase("high"));
        //         imageQualityButtons.add(this.imageQualityHigh);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityHigh, VerticalPanel.ALIGN_MIDDLE);
        //         imageQualityButtons.add(this.imageQualityHighButtonTag);
        //         imageQualityButtons.setCellVerticalAlignment(this.imageQualityHighButtonTag, VerticalPanel.ALIGN_MIDDLE);
        //         this.imageQualityHighButtonTag.setWordWrap(false);
        //         this.imageQualityHighButtonTag.setStyleName("invitations-preview-comment");
        //         this.imageQualityHighButtonTag.addStyleName("settings-button-tag-text");
        //         
        //         basePanel.add(imageQualityButtons);
        //         
        //         HTML line3 = new HTML("&nbsp;");
        //         line3.setStyleName("line-break");
        //         basePanel.add(line3);

        // Mouse Track

        //         HorizontalPanel mouseControlButtons = new HorizontalPanel();
        //         mouseControlButtons.add(this.mouseTrackComment);
        //         mouseControlButtons.setCellVerticalAlignment(this.mouseTrackComment, VerticalPanel.ALIGN_MIDDLE);
        //         this.mouseTrackComment.setStyleName("invitations-preview-comment");
        //         this.mouseTrackComment.addStyleName("settings-item-heading");
        //         
        //         this.enableMouseTrack.setChecked(currentSettings.isMouseTrackEnabled());
        //         mouseControlButtons.add(this.enableMouseTrack);
        //         mouseControlButtons.setCellVerticalAlignment(this.enableMouseTrack, VerticalPanel.ALIGN_MIDDLE);
        //         mouseControlButtons.add(this.enableMouseTrackButtonTag);
        //         mouseControlButtons.setCellVerticalAlignment(this.enableMouseTrackButtonTag, VerticalPanel.ALIGN_MIDDLE);
        //         this.enableMouseTrackButtonTag.setWordWrap(false);
        //         this.enableMouseTrackButtonTag.setStyleName("invitations-preview-comment");
        //         this.enableMouseTrackButtonTag.addStyleName("settings-button-tag-text");
        //         
        //         this.disableMouseTrack.setChecked(!currentSettings.isMouseTrackEnabled());
        //         mouseControlButtons.add(this.disableMouseTrack);
        //         mouseControlButtons.setCellVerticalAlignment(this.disableMouseTrack, VerticalPanel.ALIGN_MIDDLE);
        //         mouseControlButtons.add(this.disableMouseTrackButtonTag);
        //         mouseControlButtons.setCellVerticalAlignment(this.disableMouseTrackButtonTag, VerticalPanel.ALIGN_MIDDLE);
        //         this.disableMouseTrackButtonTag.setWordWrap(false);
        //         this.disableMouseTrackButtonTag.setStyleName("invitations-preview-comment");
        //         this.disableMouseTrackButtonTag.addStyleName("settings-button-tag-text");
        //         
        //         basePanel.add(mouseControlButtons);
    } //these settings make sense only whe publisher is enabled

    HTML line5 = new HTML("&nbsp;");
    line5.setStyleName("line-break");
    basePanel.add(line5);

    //   Maximum participants
    HorizontalPanel maxParticipantsPanel = new HorizontalPanel();
    maxParticipantsPanel.add(this.maxParticipantsComment);
    maxParticipantsPanel.setCellVerticalAlignment(this.maxParticipantsComment, VerticalPanel.ALIGN_MIDDLE);
    maxParticipantsComment.setStyleName("invitations-preview-comment");
    maxParticipantsComment.addStyleName("settings-item-heading");

    maxParticipantsOptions = prepareListBox(ConferenceGlobals.currentMaxParticipants,
            uiParams.getMaxParticipantsForAnyMeeting(), 5);
    maxParticipantsPanel.add(maxParticipantsOptions);
    maxParticipantsPanel.setCellVerticalAlignment(maxParticipantsOptions, VerticalPanel.ALIGN_MIDDLE);

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

    HTML line4 = new HTML("&nbsp;");
    line4.setStyleName("line-break");
    basePanel.add(line4);

    String s = ConferenceGlobals.getOverrideMaxParticipants();
    if (s != null && s.equalsIgnoreCase("false")) {
        maxParticipantsOptions.setEnabled(false);
    }

    //   Maximum meeting time

    int hours = ConferenceGlobals.currentMaxMeetingTime / 60;
    int minutes = ConferenceGlobals.currentMaxMeetingTime % 60;

    HorizontalPanel currentMeetingLengthPanel = new HorizontalPanel();
    currentMeetingLengthComment.setStyleName("invitations-preview-comment");
    currentMeetingLengthComment.addStyleName("settings-item-heading");
    currentMeetingLengthPanel.add(currentMeetingLengthComment);
    currentMeetingLengthPanel.setCellVerticalAlignment(currentMeetingLengthComment, VerticalPanel.ALIGN_MIDDLE);

    currentMeetingLengthHoursSuffix.setStyleName("common-text");
    currentMeetingLengthHoursSuffix.addStyleName("common-label");
    currentMeetingLengthMinutesSuffix.setStyleName("common-text");
    currentMeetingLengthMinutesSuffix.addStyleName("common-label");

    Label h = new Label("" + hours);
    h.setStyleName("common-text");
    h.addStyleName("common-label");
    currentMeetingLengthPanel.add(h);
    currentMeetingLengthPanel.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE);
    currentMeetingLengthPanel.add(currentMeetingLengthHoursSuffix);
    currentMeetingLengthPanel.setCellVerticalAlignment(currentMeetingLengthHoursSuffix,
            VerticalPanel.ALIGN_MIDDLE);

    Label m = new Label("" + minutes);
    m.setStyleName("common-text");
    m.addStyleName("common-label");
    currentMeetingLengthPanel.add(m);
    currentMeetingLengthPanel.setCellVerticalAlignment(m, VerticalPanel.ALIGN_MIDDLE);
    currentMeetingLengthPanel.add(currentMeetingLengthMinutesSuffix);
    currentMeetingLengthPanel.setCellVerticalAlignment(currentMeetingLengthMinutesSuffix,
            VerticalPanel.ALIGN_MIDDLE);

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

    HorizontalPanel maxMeetingTimePanel = new HorizontalPanel();
    maxMeetingTimePanel.add(this.maxMeetingTimeComment);
    maxMeetingTimePanel.setCellVerticalAlignment(this.maxMeetingTimeComment, VerticalPanel.ALIGN_MIDDLE);
    maxMeetingTimeComment.setStyleName("invitations-preview-comment");
    maxMeetingTimeComment.addStyleName("settings-item-heading");

    maxMeetingHoursSuffix.setStyleName("invitations-preview-comment");
    maxMeetingMinutesSuffix.setStyleName("invitations-preview-comment");

    prepateMeetingTimeListBoxes(ConferenceGlobals.currentMaxMeetingTime,
            uiParams.getMaxMeetingTimeForAnyMeeting());

    //      maxMeetingTimeOptions = prepareListBox(ConferenceGlobals.currentMaxMeetingTime,
    //            uiParams.getMaxMeetingTimeForAnyMeeting(), 20);

    maxMeetingTimePanel.add(this.maxMeetingHoursOptions);
    maxMeetingTimePanel.setCellVerticalAlignment(maxMeetingHoursOptions, VerticalPanel.ALIGN_MIDDLE);
    maxMeetingTimePanel.add(this.maxMeetingHoursSuffix);
    maxMeetingTimePanel.setCellVerticalAlignment(maxMeetingHoursSuffix, VerticalPanel.ALIGN_MIDDLE);

    maxMeetingTimePanel.add(this.maxMeetingMinutesOptions);
    maxMeetingTimePanel.setCellVerticalAlignment(maxMeetingMinutesOptions, VerticalPanel.ALIGN_MIDDLE);
    maxMeetingTimePanel.add(this.maxMeetingMinutesSuffix);
    maxMeetingTimePanel.setCellVerticalAlignment(maxMeetingMinutesSuffix, VerticalPanel.ALIGN_MIDDLE);

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

    HTML line6 = new HTML("&nbsp;");
    line6.setStyleName("line-break");
    basePanel.add(line6);

    //   Maximum attendee mikes
    if (!ConferenceGlobals.isPresenterAVAudioDisabled() && !ConferenceGlobals.isMeetingVideoChat()) {
        HorizontalPanel maxAttendeeMikesPanel = new HorizontalPanel();
        maxAttendeeMikesPanel.add(this.maxAttendeeMikesComment);
        maxAttendeeMikesPanel.setCellVerticalAlignment(this.maxAttendeeMikesComment,
                VerticalPanel.ALIGN_MIDDLE);
        maxAttendeeMikesComment.setStyleName("invitations-preview-comment");
        maxAttendeeMikesComment.addStyleName("settings-item-heading");

        maxAttendeeMikes = new ListBox();
        String sm = getServerMaxAttendeeAudios();
        int smi = (new Integer(sm)).intValue();
        for (int i = currentMaxAudios; i <= smi; i++) {
            maxAttendeeMikes.addItem("" + i);
        }
        maxAttendeeMikesPanel.add(maxAttendeeMikes);
        maxAttendeeMikesPanel.setCellVerticalAlignment(maxAttendeeMikes, VerticalPanel.ALIGN_MIDDLE);
        maxAttendeeMikesPanel.setVisible(false);

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

        HTML line7 = new HTML("&nbsp;");
        line7.setStyleName("line-break");
        line7.setVisible(false);
        basePanel.add(line7);
    }
    //   Track back url

    HorizontalPanel returnURLPanel = new HorizontalPanel();
    returnURLPanel.add(this.returnURLComment);
    returnURLPanel.setCellVerticalAlignment(this.returnURLComment, VerticalPanel.ALIGN_MIDDLE);
    returnURLComment.setStyleName("invitations-preview-comment");
    returnURLComment.addStyleName("settings-item-heading");

    returnURL = new TextBox();
    returnURL.setText(this.getReturnUrlForSettings());
    returnURL.setStyleName("common-text");
    returnURLPanel.add(returnURL);
    returnURLPanel.setCellVerticalAlignment(returnURL, VerticalPanel.ALIGN_MIDDLE);

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

    HTML line8 = new HTML("&nbsp;");
    line8.setStyleName("line-break");
    basePanel.add(line8);

    //      Window.alert("7");
    return basePanel;
}

From source file:com.dimdim.conference.ui.envcheck.client.layout.CommonMessagePopup.java

License:Open Source License

protected void drawDialog() {
    vp = new VerticalPanel();
    RoundedPanel rp = new RoundedPanel(vp);

    vp.setStyleName("common-dialog-outer-panel");
    rp.setStyleName("common-dialog-rounded-corner-panel");

    DockPanel buttonPanel = new DockPanel();
    if (this.showCloseButton) {
        closeButton = new Button(closeButtonText, new ClickListener() {
            public void onClick(Widget sender) {
                hide();/*w  w  w. j  av a2 s  . c  o  m*/
                History.back(); //   TODO move out into a listener.
            }
        });
        closeButton.setStyleName("dm-popup-close-button");
        buttonPanel.add(closeButton, DockPanel.EAST);
        buttonPanel.setSpacing(0);
        HTML filler1 = new HTML("&nbsp;");
        buttonPanel.add(filler1, DockPanel.EAST);
    }
    if (this.dialogName != null) {
        //   Create a width adjustment panel.
        String widthStyle = this.dialogName + "-dialog-width";
        String heightStyle1 = this.dialogName + "-dialog-height-one";
        String heightStyle2 = this.dialogName + "-dialog-height-two";
        String contentWidthStyle = this.dialogName + "-dialog-content";

        content.addStyleName(contentWidthStyle);
        HorizontalPanel upperPanel = new HorizontalPanel();

        HTML upperLeftBar = new HTML("&nbsp;");
        upperLeftBar.setStyleName(heightStyle1);
        upperPanel.add(upperLeftBar);
        upperPanel.add(content);
        upperPanel.setCellWidth(content, "100%");
        upperPanel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_MIDDLE);

        HorizontalPanel lowerPanel = new HorizontalPanel();
        lowerPanel.setStyleName(widthStyle);

        HTML lowerLeftBar = new HTML("&nbsp;");
        lowerLeftBar.setStyleName(heightStyle2);
        lowerPanel.add(lowerLeftBar);
        lowerPanel.add(buttonPanel);
        lowerPanel.setCellWidth(buttonPanel, "100%");
        lowerPanel.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT);
        lowerPanel.setCellVerticalAlignment(buttonPanel, VerticalPanel.ALIGN_MIDDLE);

        vp.add(upperPanel);
        vp.add(lowerPanel);
        this.addStyleName(this.dialogName + "-dialog-size");
    } else {
        vp.add(content);
        vp.setCellWidth(content, "100%");

        vp.add(buttonPanel);
        vp.setCellWidth(buttonPanel, "100%");
        vp.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT);
    }
    this.addPopupListener(this);

    this.add(vp);
}

From source file:com.dimdim.conference.ui.envcheck.client.layout.SignInControls.java

License:Open Source License

public SignInControls() {
    initWidget(basePanel);//from   w ww.  j a  v a 2s  .co m

    /**
     * Assemble the form body top bar
     */
    topBar = new HorizontalPanel();

    PNGImage topLeftCorner = new PNGImage("images/form-area-leftcorner.png", 47, 47);
    topBar.add(topLeftCorner);
    topBar.setCellHorizontalAlignment(topLeftCorner, HorizontalPanel.ALIGN_LEFT);
    topBar.setCellVerticalAlignment(topLeftCorner, VerticalPanel.ALIGN_TOP);

    PNGImage topCenter = new PNGImage("images/formarea-top-back.png", 305, 47);
    topBar.add(topCenter);
    topBar.setCellHorizontalAlignment(topCenter, HorizontalPanel.ALIGN_LEFT);
    topBar.setCellVerticalAlignment(topCenter, VerticalPanel.ALIGN_TOP);

    PNGImage topRightCorner = new PNGImage("images/formarea-right-corner.png", 47, 47);
    topBar.add(topRightCorner);
    topBar.setCellHorizontalAlignment(topRightCorner, HorizontalPanel.ALIGN_LEFT);
    topBar.setCellVerticalAlignment(topRightCorner, VerticalPanel.ALIGN_TOP);

    basePanel.add(topBar);
    basePanel.setCellHorizontalAlignment(topBar, HorizontalPanel.ALIGN_LEFT);
    basePanel.setCellVerticalAlignment(topBar, VerticalPanel.ALIGN_TOP);

    /**
     * Assemble the form body
     */
    formBody = new HorizontalPanel();

    PNGImage bodyLeft = new PNGImage("images/formarea-left-tile.png", 47, 431);
    formBody.add(bodyLeft);
    formBody.setCellHorizontalAlignment(bodyLeft, HorizontalPanel.ALIGN_LEFT);
    formBody.setCellVerticalAlignment(bodyLeft, VerticalPanel.ALIGN_TOP);

    formContainer = new VerticalPanel();
    formContainer.setWidth("305px");
    formContainer.setHeight("431px");

    buttonsContainer = new VerticalPanel();
    buttonsContainer.setWidth("305px");
    buttonsContainer.setHeight("431px");

    buttonsPanel = new VerticalPanel();
    buttonsPanel.setWidth("305px");
    buttonsPanel.setHeight("431px");

    formContainer.add(buttonsContainer);
    formContainer.setCellHorizontalAlignment(buttonsContainer, HorizontalPanel.ALIGN_CENTER);
    formContainer.setCellVerticalAlignment(buttonsContainer, VerticalPanel.ALIGN_TOP);
    formContainer.setStyleName("signin-form-body-center");

    buttonsContainer.add(buttonsPanel);
    buttonsContainer.setCellHorizontalAlignment(buttonsPanel, HorizontalPanel.ALIGN_CENTER);
    buttonsContainer.setCellVerticalAlignment(buttonsPanel, VerticalPanel.ALIGN_MIDDLE);

    formBody.add(formContainer);
    formBody.setCellHorizontalAlignment(formContainer, HorizontalPanel.ALIGN_CENTER);
    formBody.setCellVerticalAlignment(formContainer, VerticalPanel.ALIGN_MIDDLE);

    PNGImage bodyRight = new PNGImage("images/formarea-right-tile.png", 47, 431);
    formBody.add(bodyRight);
    formBody.setCellHorizontalAlignment(bodyRight, HorizontalPanel.ALIGN_LEFT);
    formBody.setCellVerticalAlignment(bodyRight, VerticalPanel.ALIGN_TOP);

    basePanel.add(formBody);
    basePanel.setCellHorizontalAlignment(formBody, HorizontalPanel.ALIGN_LEFT);
    basePanel.setCellVerticalAlignment(formBody, VerticalPanel.ALIGN_TOP);

    /**
     * Assemble the form bottom bar
     */
    bottomBar = new HorizontalPanel();

    PNGImage bottomLeftCorner = new PNGImage("images/formarea-bot-left-corner.png", 47, 46);
    bottomBar.add(bottomLeftCorner);
    bottomBar.setCellHorizontalAlignment(bottomLeftCorner, HorizontalPanel.ALIGN_LEFT);
    bottomBar.setCellVerticalAlignment(bottomLeftCorner, VerticalPanel.ALIGN_TOP);

    PNGImage bottomCenter = new PNGImage("images/formarea-bottom-tile.png", 305, 46);
    bottomBar.add(bottomCenter);
    bottomBar.setCellHorizontalAlignment(bottomCenter, HorizontalPanel.ALIGN_LEFT);
    bottomBar.setCellVerticalAlignment(bottomCenter, VerticalPanel.ALIGN_TOP);

    PNGImage bottomRightCorner = new PNGImage("images/formarea-bot-right-corner.png", 47, 46);
    bottomBar.add(bottomRightCorner);
    bottomBar.setCellHorizontalAlignment(bottomRightCorner, HorizontalPanel.ALIGN_LEFT);
    bottomBar.setCellVerticalAlignment(bottomRightCorner, VerticalPanel.ALIGN_TOP);

    basePanel.add(bottomBar);
    basePanel.setCellHorizontalAlignment(bottomBar, HorizontalPanel.ALIGN_LEFT);
    basePanel.setCellVerticalAlignment(bottomBar, VerticalPanel.ALIGN_TOP);

    /**
     * Privacy and copyright policy links
     */
    HorizontalPanel linksPanel = new HorizontalPanel();
    linksPanel.setStyleName("bottom-panel-links");

    privacyPolicyLink = new Label(
            EnvGlobals.getDisplayString("dimdim_privacy_policy_link", "dimdim privacy policy"));
    privacyPolicyLink.setStyleName("common-text");
    privacyPolicyLink.addStyleName("common-anchor");
    privacyPolicyLink.addStyleName("bottom-panel-link");
    privacyPolicyLink.addClickListener(this);

    copyrightPolicyLink = new Label(EnvGlobals.getDisplayString("dimdim_copyright_policy_link",
            "dimdim trademark and copyright policy"));
    copyrightPolicyLink.setStyleName("common-text");
    copyrightPolicyLink.addStyleName("common-anchor");
    copyrightPolicyLink.addStyleName("bottom-panel-link");
    copyrightPolicyLink.addClickListener(this);

    linksPanel.add(privacyPolicyLink);
    linksPanel.setCellHorizontalAlignment(privacyPolicyLink, HorizontalPanel.ALIGN_LEFT);
    linksPanel.setCellVerticalAlignment(privacyPolicyLink, VerticalPanel.ALIGN_MIDDLE);

    HTML seperator1 = new HTML("|");
    seperator1.setStyleName("bottom-panel-links-seperator");
    linksPanel.add(seperator1);
    linksPanel.setCellHorizontalAlignment(seperator1, HorizontalPanel.ALIGN_LEFT);
    linksPanel.setCellVerticalAlignment(seperator1, VerticalPanel.ALIGN_MIDDLE);

    linksPanel.add(copyrightPolicyLink);
    linksPanel.setCellHorizontalAlignment(copyrightPolicyLink, HorizontalPanel.ALIGN_LEFT);
    linksPanel.setCellVerticalAlignment(copyrightPolicyLink, VerticalPanel.ALIGN_MIDDLE);

    basePanel.add(linksPanel);
    basePanel.setCellHorizontalAlignment(linksPanel, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(linksPanel, VerticalPanel.ALIGN_MIDDLE);
}