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

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

Introduction

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

Prototype

public void setCellHorizontalAlignment(IsWidget w, HorizontalAlignmentConstant align) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:com.cognitivemedicine.metricsdashboard.client.charts.ChartEditorPanel.java

License:Apache License

public ChartEditorPanel(ChartWidget parent, DashboardController dashboardController,
        DashboardSettings dashboardSettings, ChartSettings chartSettings) {
    this.parentWidget = parent;
    this.controller = dashboardController;

    String parentId = parent.getElement().getId();

    titleBox = new TextBox();
    titleBox.getElement().setId(parentId + "chartTitleBox");

    periodList = new ListBox();
    periodList.setVisibleItemCount(1);//from  w w  w  . j a v  a  2  s.  c o m
    periodList.getElement().setId(parentId + "periodList");
    for (Period p : Period.values()) {
        periodList.addItem(p.getDisplayValue(), p.getSymbol());
    }

    datetimePicker = new CalendarPicker(parentId, true);

    granularityList = new ListBox();
    granularityList.setVisibleItemCount(1);
    granularityList.getElement().setId(parentId + "granularityList");
    granularityList.addItem("", "");
    for (Granularity g : Granularity.values()) {
        granularityList.addItem(g.getDisplayValue(), g.getSymbol());
    }

    metricGroupList = new ListBox();
    metricGroupList.setVisibleItemCount(1);
    metricGroupList.getElement().setId(parentId + "groupList");
    //        for (MetricGroup g : controller.getMetricsGroups().values()) {
    //            metricGroupList.addItem(g.getName(), g.getName());
    //        }
    metricGroupList.addItem(ALL_METRICS);
    for (String g : controller.getMetaGroupMap().keySet()) {
        metricGroupList.addItem(g, g);
    }
    metricGroupList.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            metricGroupListChanged();
        }
    });

    availableMetricsList = new MultiSelectListBox();
    availableMetricsList.setVisibleItemCount(6);
    availableMetricsList.getElement().setId(parentId + "availableMetricsList");
    //        for (Metric m : controller.getAvailableMetrics().values()) {
    //            availableMetricsList.addItem(m.getName(), m.getName());
    //        }
    for (MetaDefinition m : controller.getMetaDefinitions()) {
        availableMetricsList.addItem(m.toString(), m.toString());
    }

    chartTypeList = new ListBox();
    chartTypeList.setVisibleItemCount(1);
    chartTypeList.getElement().setId(parentId + "chartTypeList");
    for (ChartType c : ChartType.values()) {
        chartTypeList.addItem(c.name());
    }

    liveUpdatesCheckBox = new CheckBox("Live Updates");
    liveUpdatesCheckBox.getElement().setId(parentId + "liveUpdatesCheckBox");

    if (chartSettings != null) {
        loadChartSettings(chartSettings);
    }

    dashboardSettingsUpdated(dashboardSettings);

    mainPanel = new VerticalPanel();
    mainPanel.setSpacing(4);
    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    // this.add(createFormPanel("Title", titleBox));
    HorizontalPanel titlePanel = new HorizontalPanel();
    HTML titleLabel = new HTML("Title" + ": ");
    titleLabel.setWidth("115px");
    titleBox.setWidth("265px");
    titlePanel.add(titleLabel);
    titlePanel.add(titleBox);
    titlePanel.setCellHorizontalAlignment(titleLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    mainPanel.add(titlePanel);
    mainPanel.add(new HTML("<hr>"));
    mainPanel.add(createFormPanel("Metric", metricGroupList));
    mainPanel.add(createFormPanel("Supported Queries", availableMetricsList));
    //        mainPanel.add(createFormPanel("Chart Type", chartTypeList));
    mainPanel.add(new HTML("<hr>"));
    mainPanel.add(createFormPanel("Period", periodList));
    mainPanel.add(datetimePicker);
    mainPanel.add(new HTML("<hr>"));
    mainPanel.add(createFormPanel("Granularity", granularityList));
    // mainPanel.add(new HTML("<hr>"));
    HorizontalPanel updatePanel = new HorizontalPanel();
    HTML updateLabel = new HTML("Live Updates: ");
    updateLabel.setWidth("115px");
    //        titleBox.setWidth("190px");
    // updatePanel.add(updateLabel);
    updatePanel.add(liveUpdatesCheckBox);
    updatePanel.setCellHorizontalAlignment(updateLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    // mainPanel.add(updatePanel);

    this.setHeight("100%");
    this.setWidth("100%");
    this.add(mainPanel);
    this.setCellHorizontalAlignment(mainPanel, HasHorizontalAlignment.ALIGN_CENTER);
    this.setCellVerticalAlignment(mainPanel, HasVerticalAlignment.ALIGN_MIDDLE);

    // this.add(new HTML(, liveUpdatesCheckBox));
    // this.add(buttonPanel);
    // this.setCellHorizontalAlignment(buttonPanel,HasHorizontalAlignment.ALIGN_CENTER);
}

From source file:com.cognitivemedicine.metricsdashboard.client.charts.ChartEditorPanel.java

License:Apache License

private HorizontalPanel createFormPanel(String fieldName, ListBox list) {
    HorizontalPanel panel = new HorizontalPanel();
    HTML nameLabel = new HTML(fieldName + ": ");
    nameLabel.setWidth("115px");
    list.setWidth("275px");
    // panel.setCellHorizontalAlignment(nameLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    // this.setCellVerticalAlignment(checkBox, HasVerticalAlignment.ALIGN_MIDDLE);
    panel.add(nameLabel);//w  w w  .  jav  a2s  .c  om
    panel.add(list);
    panel.setCellHorizontalAlignment(nameLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    return panel;
}

From source file:com.cognitivemedicine.metricsdashboard.client.dashboard.DashboardMainPanel.java

License:Apache License

private void initUi() {
    mainPanel = new VerticalPanel();
    mainPanel.setWidth("300px");
    mainPanel.setSpacing(4);//w  w w.  jav a2  s  .c  om

    VerticalPanel titlePanel = new VerticalPanel();
    titlePanel.setWidth("100%");
    HorizontalPanel logoutPanel = new HorizontalPanel();
    Image logoutImage = new Image(MdConstants.IMG_LOGOUT);
    logoutImage.getElement().getStyle().setCursor(Cursor.POINTER);
    logoutImage.setSize("16px", "16px");
    logoutImage.setTitle("Log Out");
    logoutImage.getElement().getStyle().setProperty("cursor", "hand");
    logoutImage.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.logOut();
        }
    });

    HTML logOutLabel = new HTML("<u><font size=-2>Log Out </font></u>");
    logOutLabel.setHeight("10px");
    // logOutLabel.setStyleName("logoutButton");
    logOutLabel.setStylePrimaryName("logoutButton");
    logOutLabel.getElement().getStyle().setProperty("right", "5px");
    // logOutLabel.getElement().getStyle().setProperty("cursor", "hand");
    logOutLabel.getElement().getStyle().setCursor(Cursor.POINTER);
    logOutLabel.setWidth("100%");
    logOutLabel.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.logOut();
        }
    });

    logoutPanel.add(logOutLabel);
    logoutPanel.add(logoutImage);
    logoutPanel.setSpacing(2);

    logoutPanel.setCellHorizontalAlignment(logoutImage, HasHorizontalAlignment.ALIGN_RIGHT);
    logoutPanel.setCellHorizontalAlignment(logOutLabel, HasHorizontalAlignment.ALIGN_RIGHT);

    titlePanel.getElement().getStyle().setProperty("marginLeft", "50");
    titleLabel = new HTML("<font size=4>&nbsp;</font>");
    titleLabel.getElement().setId("dashboardTitleLabel");

    titlePanel.add(logoutPanel);
    titlePanel.add(titleLabel);

    titlePanel.setCellHorizontalAlignment(logoutPanel, HasHorizontalAlignment.ALIGN_RIGHT);

    DecoratorPanel titleDecor = new DecoratorPanel();
    titleDecor.setWidth("250px");
    titleDecor.setHeight("30px");
    mainPanel.add(titlePanel);

    mainPanel.setCellVerticalAlignment(logOutLabel, HasVerticalAlignment.ALIGN_MIDDLE);
    mainPanel.setCellHorizontalAlignment(logOutLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    mainPanel.setCellHorizontalAlignment(titleLabel, HasHorizontalAlignment.ALIGN_LEFT);
    mainPanel.setCellVerticalAlignment(titleLabel, HasVerticalAlignment.ALIGN_MIDDLE);

    Image image = new Image(MdConstants.IMG_TOOLS);
    image.setSize(MdConstants.IMG_SIZE, MdConstants.IMG_SIZE);
    adminConsoleButton = new PushButton(image);
    adminConsoleButton.getElement().setId("adminConsoleButton");
    adminConsoleButton.setSize("50px", MdConstants.IMG_SIZE);
    adminConsoleButton.setTitle("Show Admin Console");
    adminConsoleButton.setEnabled(false);
    adminConsoleButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            AdminConsole console = new AdminConsole(controller);
        }
    });

    editorDecorator = new DecoratorPanel();
    editorDecorator.setTitle("Dashboard Editor");
    editorDecorator.setWidth("315px");

    toolstripPanel = new DashboardToolStripBar(this);

    dashboardListBox = new ListBox(false);
    dashboardListBox.getElement().setId("dashboardListBox");
    dashboardListBox.setWidth("295px");
    dashboardListBox.setVisibleItemCount(10);
    dashboardListBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            dashboardListChanged();
        }
    });

    notesArea = new TextArea();
    notesArea.setVisibleLines(2);
    notesArea.setWidth("290px");
    notesArea.setHeight("50px");
    notesArea.getElement().setId("notesTextArea");

    VerticalPanel editorVerticalPanel = new VerticalPanel();
    editorVerticalPanel.setSpacing(4);
    editorVerticalPanel.add(toolstripPanel);
    editorVerticalPanel.add(dashboardListBox);
    editorVerticalPanel.add(new HTML("<font size=-1><b>Dashboard Notes:</b></font></br>"));
    editorVerticalPanel.add(notesArea);
    editorVerticalPanel.setCellVerticalAlignment(toolstripPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    editorVerticalPanel.setCellHorizontalAlignment(toolstripPanel, HasHorizontalAlignment.ALIGN_CENTER);
    editorDecorator.setWidget(editorVerticalPanel);

    settingsPanel = new DashboardSettingsPanel(this);

    mainPanel.add(editorDecorator);
    mainPanel.add(settingsPanel);
    // mainPanel.add(adminConsoleButton);

    mainPanel.setCellVerticalAlignment(editorDecorator, HasVerticalAlignment.ALIGN_MIDDLE);
    mainPanel.setCellHorizontalAlignment(editorDecorator, HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setCellVerticalAlignment(settingsPanel, HasVerticalAlignment.ALIGN_TOP);
    mainPanel.setCellHorizontalAlignment(settingsPanel, HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setCellVerticalAlignment(adminConsoleButton, HasVerticalAlignment.ALIGN_MIDDLE);
    mainPanel.setCellHorizontalAlignment(adminConsoleButton, HasHorizontalAlignment.ALIGN_CENTER);

    this.add(mainPanel);
}

From source file:com.cognitivemedicine.metricsdashboard.client.dialogs.AuthenticationDialog.java

License:Apache License

/**
 * Creates a consistent sized panel for form elements
 * //from  www.j a v a2  s. co  m
 * @param fieldName
 * @param widget
 * @return
 */
private HorizontalPanel createFormPanel(String fieldName, FocusWidget widget) {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(4);
    HTML nameLabel = new HTML(fieldName + ": ");
    nameLabel.setWidth("115px");
    // Weird workaround - the PasswordTextBoxes render wider than the ListBoxes, even when set to
    // the same size
    if (widget instanceof ListBox) {
        widget.setWidth("325px");
    } else {
        widget.setWidth("315px");
    }

    panel.add(nameLabel);
    panel.add(widget);
    panel.setCellHorizontalAlignment(nameLabel, HasHorizontalAlignment.ALIGN_RIGHT);
    return panel;
}

From source file:com.dimdim.conference.ui.common.client.list.ListEntryPanel.java

License:Open Source License

protected Image setImage(DockPanel imagePanel, Image image, Image imageUrl, ClickListener clickListener,
        HorizontalPanel subPanel, String tooltip, boolean rightAlign) {
    Image image2 = image;/*from  ww  w.j av  a  2s.co m*/
    if (image != null) {
        //Window.alert("prev image = is not null");
        if (subPanel != null) {
            //Window.alert("subpanel = is not null so removing..");
            subPanel.remove(image);
            image2 = null;
        } else if (imagePanel != null) {
            imagePanel.remove(image);
            image2 = null;
        }

    }
    if (imageUrl != null) {
        /*
        if (imageUrl.endsWith("xxx"))
        {
           Image image = new Image(imageUrl);
           image.addStyleName("list-entry-panel-image");
           imagePanel.add(image,DockPanel.WEST);
           imagePanel.setCellHorizontalAlignment(image,HorizontalPanel.ALIGN_CENTER);
           imagePanel.setCellVerticalAlignment(image,VerticalPanel.ALIGN_MIDDLE);
           if (clickListener != null)
           {
              image.addClickListener(clickListener);
           }
        }
        else
        */
        //         else
        {
            image2 = imageUrl;
            image2.addStyleName("list-entry-panel-image");
            if (subPanel != null) {
                subPanel.add(image2);
                subPanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                subPanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
            } else {
                if (rightAlign) {
                    imagePanel.add(image2, DockPanel.EAST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_RIGHT);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                } else {
                    imagePanel.add(image2, DockPanel.WEST);
                    imagePanel.setCellHorizontalAlignment(image2, HorizontalPanel.ALIGN_CENTER);
                    imagePanel.setCellVerticalAlignment(image2, VerticalPanel.ALIGN_MIDDLE);
                }
            }
            if (clickListener != null) {
                image2.addClickListener(clickListener);
                //image2.addStyleName("anchor-cursor");
            }
            if (tooltip != null) {
                image2.setTitle(tooltip);
            }
        }
    }
    return image2;
}

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 w  ww  .  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.util.CommonModalDialog.java

License:Open Source License

public void drawDialog() {
    this.defaultCloseListener = new ClickListener() {
        public void onClick(Widget sender) {
            hide();//from  ww  w.j  av  a2 s . c om
        }
    };
    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 ww .j  a v a2  s . c om*/
    //      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.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  ww.  ja v  a2  s .c  om*/
    //      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.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  .  ja va 2s  . c om
                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);
}