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

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

Introduction

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

Prototype

public HorizontalPanel() 

Source Link

Document

Creates an empty horizontal panel.

Usage

From source file:com.dimdim.conference.ui.layout.client.widget.MeetingAssistentDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel basePanel = new VerticalPanel();
    //      VerticalPanel   basePanel2 = new VerticalPanel();
    basePanel.setStyleName("meeting-assistent-panel");

    headerPanel1 = new DockPanel();
    headerPanel1.setStyleName("meeting-assistent-header-1");
    closeButton = new PNGImage("images/assistent/close.png", 16, 16);
    closeButton.addStyleName("anchor-cursor");
    headerPanel1.add(closeButton, DockPanel.EAST);
    headerPanel1.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_RIGHT);
    headerPanel1.setCellVerticalAlignment(closeButton, VerticalPanel.ALIGN_TOP);
    closeButton.addClickListener(this);

    Label filler1 = new Label(" ");
    HorizontalPanel filler1Panel = new HorizontalPanel();
    filler1Panel.add(filler1);//from www .  j av  a  2 s  . com
    headerPanel1.add(filler1Panel, DockPanel.CENTER);
    headerPanel1.setCellWidth(filler1Panel, "100%");

    basePanel.add(headerPanel1);
    basePanel.setCellHorizontalAlignment(headerPanel1, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(headerPanel1, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(headerPanel1, "100%");

    //      headerPanel2 = new DockPanel();
    Label label = new Label(ConferenceGlobals.getDisplayString("meeting.assistant.title",
            "What would you like to do with Web Meeting today?"));
    label.setStyleName("meeting-assistent-header-2");
    //      headerPanel2.setStyleName("meeting-assistent-header-2");
    //      headerPanel2.add(label,DockPanel.CENTER);
    //      headerPanel2.setCellHorizontalAlignment(label,HorizontalPanel.ALIGN_CENTER);
    //      headerPanel2.setCellVerticalAlignment(label,VerticalPanel.ALIGN_TOP);
    //      headerPanel2.setCellWidth(label,"100%");

    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(label);
    labelPanel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_CENTER);
    basePanel.add(labelPanel);
    basePanel.setCellHorizontalAlignment(labelPanel, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(labelPanel, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(labelPanel, "100%");

    //      basePanel.add(basePanel2);
    //      basePanel.setCellHorizontalAlignment(basePanel2,HorizontalPanel.ALIGN_CENTER);
    //      basePanel.setCellVerticalAlignment(basePanel2,VerticalPanel.ALIGN_TOP);
    //      basePanel.setCellWidth(basePanel2,"100%");

    //      ImageButtonPanel desktopButton = new ImageButtonPanel("Share Desktop Screen",null,
    //            "label-base","red-label-normal","red-label-mouseover");
    String desktopButtonColor = "gray";
    if (ConferenceGlobals.publisherEnabled) {
        desktopButtonColor = "red";
    }
    desktopButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.desktop", "Share Desktop Screen"), null,
            desktopButtonColor);
    basePanel.add(desktopButton);
    basePanel.setCellHorizontalAlignment(desktopButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(desktopButton, VerticalPanel.ALIGN_MIDDLE);
    desktopButton.addClickListener(this);

    String whiteboardButtonColor = "gray";
    if (ConferenceGlobals.whiteboardEnabled) {
        whiteboardButtonColor = "green";
    }
    whiteboardButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.whiteboard", "Share Whiteboard"), null,
            whiteboardButtonColor);
    basePanel.add(whiteboardButton);
    basePanel.setCellHorizontalAlignment(whiteboardButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(whiteboardButton, VerticalPanel.ALIGN_MIDDLE);
    whiteboardButton.addClickListener(this);

    ImageButtonPanel2 pptButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.presentation", "Share a Presentation"), null,
            "blue");
    basePanel.add(pptButton);
    basePanel.setCellHorizontalAlignment(pptButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(pptButton, VerticalPanel.ALIGN_MIDDLE);
    //Window.alert("click lietener = "+middlePanel.getShareButtonListener());
    pptButton.addClickListener(this);
    pptButton.addClickListener(middlePanel.getShareButtonListener());

    Label label2 = new Label(" ");
    basePanel.add(label2);
    basePanel.setCellHorizontalAlignment(label2, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(label2, VerticalPanel.ALIGN_MIDDLE);

    ScrollPanel sPanel = new ScrollPanel();
    sPanel.setSize("550px", "390px");
    sPanel.add(basePanel);

    return sPanel;
}

From source file:com.dimdim.conference.ui.layout2.client.MeetingAssistentDialog.java

License:Open Source License

protected Widget getContent() {
    VerticalPanel basePanel = new VerticalPanel();
    basePanel.setStyleName("meeting-assistent-panel");

    headerPanel1 = new DockPanel();
    headerPanel1.setStyleName("meeting-assistent-header-1");
    closeButton = new PNGImage("images/assistent/close.png", 16, 16);
    closeButton.addStyleName("anchor-cursor");
    headerPanel1.add(closeButton, DockPanel.EAST);
    headerPanel1.setCellHorizontalAlignment(closeButton, HorizontalPanel.ALIGN_RIGHT);
    headerPanel1.setCellVerticalAlignment(closeButton, VerticalPanel.ALIGN_TOP);
    closeButton.addClickListener(this);

    Label filler1 = new Label(" ");
    HorizontalPanel filler1Panel = new HorizontalPanel();
    filler1Panel.add(filler1);//from  w  ww  . j a va  2  s.  c  om
    headerPanel1.add(filler1Panel, DockPanel.CENTER);
    headerPanel1.setCellWidth(filler1Panel, "100%");

    basePanel.add(headerPanel1);
    basePanel.setCellHorizontalAlignment(headerPanel1, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(headerPanel1, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(headerPanel1, "100%");

    Label label = new Label(ConferenceGlobals.getDisplayString("meeting.assistant.title",
            "What would you like to do with Web Meeting today?"));
    label.setStyleName("meeting-assistent-header-2");
    HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.add(label);
    labelPanel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_CENTER);
    basePanel.add(labelPanel);
    basePanel.setCellHorizontalAlignment(labelPanel, HorizontalPanel.ALIGN_CENTER);
    basePanel.setCellVerticalAlignment(labelPanel, VerticalPanel.ALIGN_TOP);
    basePanel.setCellWidth(labelPanel, "100%");

    String desktopButtonColor = "gray";
    if (ConferenceGlobals.publisherEnabled) {
        desktopButtonColor = "red";
    }
    desktopButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.desktop", "Share Desktop Screen"), null,
            desktopButtonColor);
    basePanel.add(desktopButton);
    basePanel.setCellHorizontalAlignment(desktopButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(desktopButton, VerticalPanel.ALIGN_MIDDLE);
    desktopButton.addClickListener(this);

    String whiteboardButtonColor = "gray";
    if (ConferenceGlobals.whiteboardEnabled) {
        whiteboardButtonColor = "green";
    }
    whiteboardButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.whiteboard", "Share Whiteboard"), null,
            whiteboardButtonColor);
    basePanel.add(whiteboardButton);
    basePanel.setCellHorizontalAlignment(whiteboardButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(whiteboardButton, VerticalPanel.ALIGN_MIDDLE);
    whiteboardButton.addClickListener(this);

    String pptButtonColor = "gray";
    if (ConferenceGlobals.docEnabled) {
        pptButtonColor = "blue";
    }
    ImageButtonPanel2 pptButton = new ImageButtonPanel2(
            ConferenceGlobals.getDisplayString("meeting.assistant.presentation", "Share a Presentation"), null,
            pptButtonColor);
    basePanel.add(pptButton);
    basePanel.setCellHorizontalAlignment(pptButton, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(pptButton, VerticalPanel.ALIGN_MIDDLE);
    //      pptButton.addClickListener(middlePanel.getShareButtonListener());
    if (ConferenceGlobals.docEnabled) {
        pptButton.addClickListener(this);
        pptButton.addClickListener(this.shareClickListener);
    }

    Label label2 = new Label(" ");
    basePanel.add(label2);
    basePanel.setCellHorizontalAlignment(label2, HorizontalPanel.ALIGN_RIGHT);
    basePanel.setCellVerticalAlignment(label2, VerticalPanel.ALIGN_MIDDLE);

    ScrollPanel sPanel = new ScrollPanel();
    sPanel.setSize("550px", "390px");
    sPanel.add(basePanel);

    return sPanel;
}

From source file:com.dimdim.conference.ui.panels.client.ChatWidget.java

License:Open Source License

private void fillContent(WorkspacePanel workSpace) {
    chatWidget = new DiscussionWidget(ClientModel.getClientModel().getRosterModel().getCurrentUser(),
            workSpace);//from   w ww.ja v a  2  s  .c  o  m
    chatWidget.setSize("100%", "100%");
    chatPanel.add(chatWidget);
    chatPanel.setCellHorizontalAlignment(chatWidget, HorizontalPanel.ALIGN_CENTER);
    FocusPanel otherLinksPanel = new FocusPanel();
    HorizontalPanel h1 = new HorizontalPanel();

    chatLink = new Label(ConferenceGlobals.getDisplayString("workspace.hide.chat.label", "Public Chat"));
    chatLink.setStyleName("common-text");
    chatLink.addStyleName("common-bold-text");

    h1.setWidth("100%");
    h1.add(chatLink);
    h1.setCellWidth(chatLink, "100%");
    h1.setCellHorizontalAlignment(chatLink, HorizontalPanel.ALIGN_CENTER);
    Image img = getPublicChatCloseImage();
    h1.add(img);
    Label l = new Label(" ");
    l.setWidth("10px");
    h1.add(l);

    otherLinksPanel.add(h1);
    otherLinksPanel
            .setTitle(ConferenceGlobals.getDisplayString("workspace.hide.chat.title", "Click to hide Chat"));

    verticalPanel.add(chatWidget);

    otherLinksPanel.setWidth("100%");
    otherLinksPanel.addStyleName("anchor-cursor");
    otherLinksPanel.addClickListener(this);

    workspaceLayout.addPanelToLayout("chat_pod_header", otherLinksPanel);
    workspaceLayout.addPanelToLayout("chat_pod_content", verticalPanel);

    addChatWidget();
}

From source file:com.dimdim.conference.ui.panels.client.StopRecordingFormWidget.java

License:Open Source License

private void addField(Widget w1, Widget w2, String w1Width, String w2Width) {
    HorizontalPanel hp1 = new HorizontalPanel();
    w1.setStyleName("common-text");
    hp1.add(w1);//from  www. jav  a  2 s.  com
    hp1.setCellWidth(w1, w1Width);
    if (w2 != null) {
        w2.setStyleName("common-text");
        hp1.add(w2);
        hp1.setCellWidth(w2, w2Width);
    }
    this.add(hp1);
    this.setCellWidth(hp1, "100%");
}

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

License:Open Source License

protected Widget getContent() {
    table = new VerticalPanel();
    Widget content = table;// ww  w  . ja va2  s .c o  m
    //      table.setStyleName("list-control-table");
    UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource();

    HorizontalPanel header = new HorizontalPanel();
    header.add(createLabel(".", "resource-image-header"));
    header.add(createLabel(UIStrings.getNameLabel(), "resource-name-header"));
    header.add(createLabel(UIStrings.getTypeLabel(), "resource-type-header"));
    if (this.allowResourceControl) {
        deleteHeader = createLabel(UIStrings.getDeleteLabel(), "resource-delete-button-header");
        deleteHeader.addStyleName("common-anchor-default-color");
        deleteHeader.addClickListener(this);
        header.add(deleteHeader);
    }
    header.addStyleName("common-dialog-row");
    table.add(header);

    int size = this.listModel.getListSize();
    if (size > 5) {
        VerticalPanel vp = new VerticalPanel();
        ScrollPanel scroller = new ScrollPanel();
        scroller.setStyleName("resource-control-dialog-height");
        scroller.add(table);
        vp.add(scroller);
        content = vp;
    }
    int i = 0;

    Vector sortedList = getSortedList(listModel);
    for (i = 0; i < size; i++) {
        ResourceListEntry rle = (ResourceListEntry) sortedList.get(i);
        UIResourceObject res = rle.getResource();
        if (this.typeName != null && !res.getResourceType().equals(this.typeName)) {
            continue;
        }
        //         UIListEntryPanelMouseAndClickListener mcl = new UIListEntryPanelMouseAndClickListener(
        //               rle,this.resourceListAndEntryProperties,this.listEntryManager);
        //         mcl.setSecondLevelPopup(true);

        HorizontalPanel row = new HorizontalPanel();

        HorizontalPanel hp1 = new HorizontalPanel();
        Image image = getImage(res);
        hp1.add(image);
        hp1.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_CENTER);
        hp1.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
        hp1.addStyleName("resource-image");
        row.add(hp1);
        row.setCellHorizontalAlignment(hp1, HorizontalPanel.ALIGN_CENTER);
        row.setCellVerticalAlignment(hp1, VerticalPanel.ALIGN_MIDDLE);

        //         table.setWidget((i+1), 0, image);
        Label nameLabel = createTextHTML(res.getResourceName(), "resource-name", 23);
        //         nameLabel.addStyleName("common-anchor");
        //         nameLabel.addClickListener(mcl);
        //         nameLabel.addMouseListener(mcl);
        row.add(nameLabel);

        row.add(createTextHTML(ResourceGlobals.getResourceGlobals().getResourceTypeNiceName(res),
                "resource-type"));

        if (this.allowResourceControl) {
            HorizontalPanel hp2 = new HorizontalPanel();
            CheckBox cb = new CheckBox();
            hp2.add(cb);
            hp2.setStyleName("resource-delete-button");
            hp2.setCellHorizontalAlignment(cb, HorizontalPanel.ALIGN_LEFT);
            hp2.setCellVerticalAlignment(cb, VerticalPanel.ALIGN_MIDDLE);
            row.add(hp2);
            row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT);
            row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE);
            cb.addClickListener(this);
            this.checkBoxes.put(res.getResourceId(), cb);
            this.checkBoxes2.put(cb, cb);
            if (!ResourceGlobals.allowDelete(res) || (currentActiveResource != null
                    && currentActiveResource.getResourceId().equals(res.getResourceId()))) {
                cb.setEnabled(false);
            }
        }
        row.addStyleName("common-dialog-row");
        table.add(row);
        this.rows.put(res.getResourceId(), row);
    }
    return content;
}

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

License:Open Source License

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

    Label comment = new Label(ResourceGlobals.getResourceGlobals().getDeleteComment1(resource));
    comment.setStyleName("common-text");
    comment.addStyleName("common-table-header");
    table.add(comment);//from   ww w  .  j a va2 s . c  o m

    HorizontalPanel namePanel = new HorizontalPanel();

    Image image = listEntry.getImage1Url();
    namePanel.add(image);

    Label nameLabel = new Label(resource.getResourceName());
    nameLabel.setStyleName("common-text");
    nameLabel.addStyleName("common-table-text");
    namePanel.add(nameLabel);

    //      Label qm = new Label("?");
    //      qm.setStyleName("common-text");
    //      qm.addStyleName("common-table-header");
    //      namePanel.add(qm);

    table.add(namePanel);

    //      String s = ResourceGlobals.getResourceGlobals().getDeleteComment2(resource);
    //      if (s != null && s.length() > 0)
    //      {
    //         Label comment2 = new Label(s);
    //         comment2.setStyleName("common-text");
    //         comment2.addStyleName("common-table-header");
    //         table.add(comment2);
    //      }

    //      HTML line1 = new HTML("&nbsp;");
    //      line1.setStyleName("resource-delete-dialog-line-break");
    //      table.add(line1);

    return table;
}

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

License:Open Source License

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

    //      Label comment = new Label("Rename");
    //      comment.setStyleName("common-text");
    //      comment.addStyleName("common-table-header");
    //      table.add(comment);

    HorizontalPanel namePanel = new HorizontalPanel();

    Image image = listEntry.getImage1Url();
    namePanel.add(image);/*from  ww  w  .jav a2s.  c o  m*/

    Label nameLabel = new Label(resource.getResourceName());
    nameLabel.setStyleName("common-text");
    nameLabel.addStyleName("common-table-text");
    namePanel.add(nameLabel);

    table.add(namePanel);

    Label comment2 = new Label(ResourceGlobals.getResourceGlobals().getRenameComment1(resource));
    comment2.setStyleName("common-text");
    comment2.addStyleName("common-table-header");
    table.add(comment2);

    this.newName = new TextBox();
    this.newName.setText("");
    this.newName.setStyleName("common-text");
    this.newName.addStyleName("common-table-text");
    this.newName.setStyleName("resource-rename-new-name");
    this.newName.setMaxLength(40);
    table.add(this.newName);
    this.newName.addKeyboardListener(this);

    return table;
}

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

License:Open Source License

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

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

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

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

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

From source file:com.dimdim.conference.ui.sharing.client.CollaborationWidgetDisplayPanel.java

License:Open Source License

public CollaborationWidgetDisplayPanel() {
    this.moviePanel = new HorizontalPanel();
}

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

License:Open Source License

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

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

    //   Custom Photo caption

    Label comment1 = new Label(UserGlobals.getUserGlobals().getChangePictureComment1());
    comment1.setStyleName("change-photo-picture-caption");
    comment1.addStyleName("common-text");
    contentPanel.add(comment1);//from w  ww  .j  a va 2s  .c o  m

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

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

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

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

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

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

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

    //   Default Photo Caption

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

    //   Photo Panel

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

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

    return contentPanel;
}