Example usage for com.google.gwt.user.client.ui HTML HTML

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

Introduction

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

Prototype

protected HTML(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:com.dimdim.conference.ui.common.client.tab.CommonTabGroup.java

License:Open Source License

public void setTabSelected(CommonTab tab) {
    boolean tabChanged = false;
    if (this.tabsFiller == null) {
        this.tabsFiller = new HTML(" ");
        this.tabsOrientationPanel.add(this.tabsFiller, DockPanel.CENTER);
        this.tabsOrientationPanel.setCellWidth(this.tabsFiller, "100%");
    }//from ww  w  .j  a  v a  2 s  .c  om
    if (lastSelectedTab != null) {
        if (lastSelectedTab != tab) {
            this.lastSelectedTab.setTabSelected(false);
            this.subTabsPanel.remove(this.lastSelectedTab.getSubtabsPanel());
            this.lastSelectedTab = tab;
            tabChanged = true;
        }
    } else {
        lastSelectedTab = tab;
        tabChanged = true;
    }

    if (tabChanged) {
        Widget w = this.lastSelectedTab.getSubtabsPanel();
        this.subTabsPanel.add(w);
        this.subTabsPanel.setCellVerticalAlignment(w, VerticalPanel.ALIGN_MIDDLE);
        if (this.orientation == CommonTabGroup.RIGHT) {
            this.subTabsPanel.setCellHorizontalAlignment(w, HorizontalPanel.ALIGN_RIGHT);
        }
        this.lastSelectedTab.setTabSelected(true);

        //   Change the tab content.
    }
}

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

License:Open Source License

/**
 * Same chat panel is used for global as well as personal chats. Global
 * chat is simply identified by using 'other' argument as null.
 *///from  ww  w .jav  a 2  s . c o  m
public NewChatPanel(UIRosterEntry me, UIRosterEntry other) {
    this.me = me;
    this.other = other;
    if (other != null) {
        this.toId = other.getUserId();
    }
    this.lastActivityTime = System.currentTimeMillis();
    if (ConferenceGlobals.isBrowserIE()) {
        spaceSequence = "DIMDIM_LTwbr>";
    }

    //   Add the central scroll panel that will hold the messages.

    scrollPanel = new ScrollPanel();
    scrollPanel.add(this.chatMessages);
    scrollPanel.setStyleName("dm-chat-message-area");

    //   A small and short instructions / message area.

    instructionPanel = new HorizontalPanel();
    instructionPanel.setStyleName("chat-instruction-panel");
    instructionPanel.setWidth("248px");

    //in public chat add powered by dimdim logo else have the help text
    if (null == toId) {
        HorizontalPanel hp = new HorizontalPanel();

        HorizontalPanel tempSpacer = new HorizontalPanel();
        tempSpacer.setWidth("10px");
        tempSpacer.add(new Label("  "));
        hp.add(tempSpacer);
        hp.setCellHorizontalAlignment(tempSpacer, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(tempSpacer, VerticalPanel.ALIGN_MIDDLE);

        PNGImage image = new PNGImage("images/logo_powered.png", 8, 14);
        hp.add(image);
        //instructionPanel.setCellWidth(image,"100%");
        hp.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);

        //hp.setBorderWidth(1);
        HTML instruction = new HTML("Powered By <a href='#'><u> Dimdim </u></a>");
        instruction.addClickListener(new ClickListener() {
            public void onClick(Widget sender) {
                openDimdimWebSite();
            }
        });
        instruction.setStyleName("poweredby-text");
        hp.add(instruction);
        //instructionPanel.setCellWidth(instruction,"100%");
        hp.setCellHorizontalAlignment(instruction, HorizontalPanel.ALIGN_LEFT);
        hp.setCellVerticalAlignment(instruction, VerticalPanel.ALIGN_MIDDLE);

        instructionPanel.add(hp);
        //instructionPanel.setCellWidth(instruction,"100%");
        instructionPanel.setCellHorizontalAlignment(hp, HorizontalPanel.ALIGN_LEFT);
        instructionPanel.setCellVerticalAlignment(hp, VerticalPanel.ALIGN_MIDDLE);

    } else {
        Label instruction = new Label(UIStrings.getChatPanelInstruction());
        instruction.setStyleName("chat-instruction");
        instructionPanel.add(instruction);
        //instructionPanel.setCellWidth(instruction,"100%");
        instructionPanel.setCellHorizontalAlignment(instruction, HorizontalPanel.ALIGN_LEFT);
        instructionPanel.setCellVerticalAlignment(instruction, VerticalPanel.ALIGN_MIDDLE);
    }

    Label emoticon = new Label(UIStrings.getChatPanelEmoticonInstruction());
    emoticon.setStyleName("chat-emoticon-lable");
    instructionPanel.add(emoticon);
    //instructionPanel.setCellWidth(emoticon,"30%");
    instructionPanel.setCellHorizontalAlignment(emoticon, HorizontalPanel.ALIGN_RIGHT);
    instructionPanel.setCellVerticalAlignment(emoticon, VerticalPanel.ALIGN_MIDDLE);

    //   Add the text area that the users will type their messages in.

    sendText = new TextArea();
    sendText.setText("");
    if (null == toId) {
        sendText.setText(UIStrings.getChatPanelInstruction());
        sendText.setStyleName("chat-instruction");
    }
    //if (ConferenceGlobals.isBrowserIE())
    //{
    sendText.setVisibleLines(2);
    //}
    //else
    //{
    //   sendText.setVisibleLines(1);
    //}
    sendText.setStyleName("chat-text-area");

    keyboardListener = new KeyboardListenerAdapter() {
        public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        }

        public void onKeyUp(Widget sender, char keyCode, int modifiers) {
            if (keyCode == KeyboardListener.KEY_ENTER) {
                sendChatMessage();
            }
        }
    };
    sendText.addKeyboardListener(keyboardListener);
    sendText.addFocusListener(this);

    //   Assemble the overall chat panel.

    initWidget(pane);
    pane.setWidth("100%");
    pane.add(outer);
    outer.setWidth("100%");

    outer.add(scrollPanel);
    scrollPanel.addStyleName("dm-chat-message-area-pane");

    outer.add(this.instructionPanel);
    outer.setCellWidth(this.instructionPanel, "100%");
    outer.setCellHorizontalAlignment(this.instructionPanel, HorizontalPanel.ALIGN_LEFT);

    outer.add(this.sendText);
    outer.setCellWidth(this.sendText, "100%");
    outer.setCellHorizontalAlignment(this.sendText, HorizontalPanel.ALIGN_CENTER);
    this.sendText.setStyleName("dm-chat-text-area");

    this.rosterModel = ClientModel.getClientModel().getRosterModel();

    //      Window.alert("created popup..");
    //setting up emoticons popup panel
    ePopUP = new EmoticonsPopup(sendText);
    emoticon.addMouseListener(new MouseListenerAdapter() {
        public void onMouseEnter(Widget sender) {
            int left = sender.getAbsoluteLeft() - 5;
            int top = sender.getAbsoluteTop() - 75;
            ePopUP.setPopupPosition(left, top);
            ePopUP.showHoverPopup();
            ePopUP.popupVisible();
        }
    });

    if (emoticonsMap == null) {
        emoticonsMap = new HashMap();
        prepareEmoticonsList();
        //         this is to handle :) and :( also         
    }
}

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

License:Open Source License

private void addHtmlHTextToTextBox(String text, boolean host) {

    text = decodeEmoticonSpecialChars(text);
    bufferMessage(text, host);/*from ww  w  .j av  a2  s  .  c o  m*/
    int lineNum = 0;
    {
        //   Add the first section to the box and trim the string.
        HTML html = new HTML(text);
        html.setWordWrap(true);
        html.setStyleName("chat-message");
        if (lineNum == 0) {
            html.addStyleName("chat-message-first-line");
        }

        addText(html, host);
    }
}

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

License:Open Source License

/**
 * Same chat panel is used for global as well as personal chats. Global
 * chat is simply identified by using 'other' argument as null.
 *///  w  ww  .j a v  a2 s . com
public NewChatPopup(NewChatPanel chatPanel, int index) {
    super(false);
    this.index = index;
    this.chatPanel = chatPanel;
    this.me = this.chatPanel.getMe();
    this.other = this.chatPanel.getOther();
    this.rosterModel = ClientModel.getClientModel().getRosterModel();
    //   Add header.

    header = new DockPanel();
    header.setStyleName("dm-user-info-header");
    header.setWidth("248px");
    header.setSpacing(4);

    String role = this.me.getRole();
    if (other != null) {
        role = other.getRole();
        toId = other.getUserId();
    }
    Image image = UserGlobals.getUserGlobals().getRoleImageUrl(role);
    header.add(image, DockPanel.WEST);
    header.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);

    String name = this.me.getDisplayName();
    if (other != null) {
        name = other.getDisplayName();
    }

    name = ConferenceGlobals.getDisplayString("console.private.chat.with", "Private chat with") + " " + name;

    nameLabel = new FixedLengthLabel(name, 27);
    nameLabel.setStyleName("dm-popup-header-label");
    nameLabel.addStyleName("draggable-panel-header");
    nameLabel.addClickListener(this);
    nameLabel.setWordWrap(false);
    nameLabel.addMouseListener(this);

    header.add(nameLabel, DockPanel.WEST);
    header.setCellVerticalAlignment(nameLabel, VerticalPanel.ALIGN_MIDDLE);

    HTML filler = new HTML("");
    header.add(filler, DockPanel.CENTER);
    header.setCellVerticalAlignment(filler, VerticalPanel.ALIGN_MIDDLE);

    headerButtons = new HorizontalPanel();
    headerButtons.setStyleName("chat-header-buttons-panel");

    minimizeImage = UIImages.getImageBundle(UIImages.defaultSkin).getMinimize();
    //minimizeImage.setStyleName("minimize-chat-popup");
    minimizeImage.addStyleName("chat-header-button");
    headerButtons.add(minimizeImage);
    minimizeImage.addClickListener(this);

    closeImage = UIImages.getImageBundle(UIImages.defaultSkin).getClose();
    //closeImage.setStyleName("close-chat-popup");
    closeImage.addStyleName("chat-header-button");
    headerButtons.add(closeImage);
    closeImage.addClickListener(this);

    this.setImage();

    header.add(headerButtons, DockPanel.EAST);
    header.setCellWidth(filler, "100%");
    //   Assemble the overall chat panel.

    add(pane);
    this.setHeight(NewChatPopup.privateChatPanelHeight + "px");
    pane.setWidth("100%");
    if (ConferenceGlobals.isBrowserFirefox()) {
        pane.add(scWrapperPanel);
        scWrapperPanel.setSize("248px", NewChatPopup.privateChatPanelHeight + "px");
        scWrapperPanel.add(outer);
        scWrapperPanel.setAlwaysShowScrollBars(false);
    } else {
        pane.add(hzWrapperPanel);
        hzWrapperPanel.setSize("248px", NewChatPopup.privateChatPanelHeight + "px");
        hzWrapperPanel.add(outer);
    }

    outer.add(header, DockPanel.NORTH);

    outer.add(this.chatPanel, DockPanel.CENTER);
    outer.setCellWidth(chatPanel, "100%");

    setStyleName("dm-chat-popup");
    //      Window.addWindowResizeListener(this);

    addPopupListener(this);
    chatPanel.setUnreadMessaeListener(this);

    this.setHeight();
}

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 www  .  j a  v a 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.UserControlDialog.java

License:Open Source License

protected HTML createTextHTML(String text, String styleName) {
    HTML html = new HTML(text);
    html.setStyleName("common-table-text");
    if (styleName != null) {
        html.addStyleName(styleName);/* ww w  . j  a  va2  s.  c o m*/
    }
    return html;
}

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);//from   w  ww.  j  a v a 2 s.com

    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.InvitationPreviewDialog.java

License:Open Source License

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

    //      basePanel.setStyleName("send-invitation-preview-box");
    //      Window.alert("3");

    //      HTML presentersComment = new HTML(UIGlobals.getInvitePresentersComment());
    //      basePanel.add(presentersComment);
    //      basePanel.setCellWidth(presentersComment,"100%");
    //      presentersComment.setStyleName("invitations-preview-comment");
    //      basePanel.add(presenters);
    //      basePanel.setCellWidth(presenters,"100%");
    //      presenters.setStyleName("invitations-preview-textarea");

    HTML line1 = new HTML("&nbsp;");
    line1.setStyleName("line-break");
    basePanel.add(line1);/*from www.  jav a2  s .com*/

    //      Window.alert("4");
    HTML attendeesComment = new HTML(UIGlobals.getInviteAttendeesComment());
    basePanel.add(attendeesComment);
    basePanel.setCellWidth(attendeesComment, "100%");
    attendeesComment.setStyleName("invitations-preview-comment");
    basePanel.add(attendees);
    basePanel.setCellWidth(attendees, "100%");
    attendees.setStyleName("invitations-preview-textarea");

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

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

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

    attendees.setTabIndex(1);
    message.setTabIndex(2);
    //      Window.alert("6");
    if (this.currentAttendees != null) {
        this.attendees.setText(this.currentAttendees);
    }
    if (this.currentPresenters != null) {
        this.presenters.setText(this.currentPresenters);
    }

    errorMessageLabel = new Label(UIStrings.getValidEmailRquired());
    errorMessageLabel.setStyleName("email-error-message");
    errorMessageLabel.setWordWrap(true);
    errorMessageLabel.setVisible(false);
    this.basePanel.add(errorMessageLabel);
    this.basePanel.setCellVerticalAlignment(errorMessageLabel, VerticalPanel.ALIGN_BOTTOM);

    //      RoundedPanel rp = new RoundedPanel(basePanel);
    //      rp.setStyleName("send-invitation-preview-rounded-corner-box");

    //      Window.alert("7");

    attendees.addKeyboardListener(new KeyboardListenerAdapter() {
        public void onKeyDown(Widget arg0, char arg1, int arg2) {
            errorMessageLabel.setVisible(false);
        }
    });

    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 w w  w  .  j av a 2  s .c  o  m

    //   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.CheckPanel.java

License:Open Source License

private void setMessageText(String text) {
    //Window.alert("result div id ="+resultTextDivId);
    //Window.alert("div element = "+RootPanel.get(this.resultTextDivId));
    RootPanel.get(this.resultTextDivId).clear();
    RootPanel.get(this.resultTextDivId).add(new Label(""));
    HTML lbl = new HTML(text);
    lbl.setStyleName("console-label");
    RootPanel.get(this.resultTextDivId).add(lbl);
}