Example usage for com.google.gwt.user.client.ui VerticalPanel setCellVerticalAlignment

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

Introduction

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

Prototype

public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:com.audata.client.HomePanel.java

License:Open Source License

/**
 * Public contructor. Builds the HomePanel
 */// ww w  .  j  av  a2s  .  c  om
public HomePanel() {

    final VerticalPanel verticalPanel = new VerticalPanel();
    initWidget(verticalPanel);
    verticalPanel.setSize("100%", "100%");

    final Image image = new Image();
    verticalPanel.add(image);
    verticalPanel.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE);
    verticalPanel.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER);
    image.setUrl("images/title/welcome.jpg");

    final HTML html = new HTML(LANG.homepage_Text());
    html.setWidth("100%");
    verticalPanel.add(html);
    html.setStyleName("audoc-welcomeText");
    setSize("100%", "100%");
    verticalPanel.setCellVerticalAlignment(html, HasVerticalAlignment.ALIGN_BOTTOM);
}

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

License:Apache License

public ChartWidget(DashboardController dashboardController, DashboardSettings dashboardSettings,
        ChartSettings chartSettings) {//from   w w  w  .jav a2s .  co m
    this.controller = dashboardController;
    String id = "chartWidget" + widgetId++;
    this.getElement().setId(id);
    tabPanel = new TabLayoutPanel(28, Unit.PX);
    tabPanel.setAnimationDuration(100);
    // tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
    // tabPanel.ensureDebugId("cwTabPanel");

    this.setText("New Chart");

    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setSpacing(4);
    Image image = new Image(MdConstants.IMG_OK_CHECK);
    image.getElement().setId(id + "OkButtonImage");
    image.setSize("24px", "24px");
    PushButton okButton = new PushButton(image);
    okButton.getElement().setId(this.getElement().getId() + "OkButton");
    okButton.setTitle("Build Chart");
    okButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            clickOkButton();
        }
    });

    image = new Image(MdConstants.IMG_CANCEL_X);
    image.setSize("24px", "24px");
    image.getElement().setId(id + "CloseButtonImage");
    PushButton closeButton = new PushButton(image);
    closeButton.getElement().setId(this.getElement().getId() + "CloseButton");
    closeButton.setTitle("Cancel");

    closeButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            controller.getWidgetController().removeWidget(ChartWidget.this);
        }
    });

    buttonPanel.add(okButton);
    buttonPanel.add(closeButton);

    // HTML metricGroupText = new HTML("EDIT");
    chartEditorPanel = new ChartEditorPanel(this, controller, dashboardSettings, chartSettings);
    // When there is a value for chart settings, it means it was loaded form the server.
    // Click Ok button programatically to load chart
    if (chartSettings != null) {
        clickOkButton();
        setText(chartSettings.getTitle());
    }
    Image editImage = new Image(MdConstants.IMG_PENCIL);
    editImage.getElement().setId("editTabImage");
    editImage.setSize("16px", "16px");
    editImage.getElement().setId("editImage");
    tabPanel.add(chartEditorPanel, editImage);

    // HTML rolesText = new HTML("VIEW");
    Image viewImage = new Image(MdConstants.IMG_VIEW_EYE);
    viewImage.getElement().setId("viewTabImage");
    viewImage.setSize("16px", "16px");
    // chartViewerPanel = new ChartViewerPanel(id);
    chartContainer = new VerticalPanel();
    // Initialize this to an empty panel
    chartViewPanel = new EmptyChartPanel();
    // chartViewPanel.setBorderWidth(2);
    chartViewPanel.setSpacing(2);
    chartViewPanel.setWidth("100%");
    // chartContainer.setBorderWidth(2);
    chartContainer.setSpacing(2);
    chartContainer.setWidth("100%");
    chartContainer.setHeight("100%");

    chartContainer.add(chartViewPanel);
    tabPanel.add(chartContainer, viewImage);

    // Return the content
    tabPanel.selectTab(0);
    tabPanel.getElement().setId(id + "TabPanel");
    tabPanel.setHeight("455px");
    tabPanel.setWidth("505px");

    this.setHeight("530");
    this.setWidth("500px");

    VerticalPanel mainPanel = new VerticalPanel();
    mainPanel.add(tabPanel);
    mainPanel.add(buttonPanel);
    mainPanel.setCellVerticalAlignment(buttonPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    mainPanel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_CENTER);

    mainPanel.setWidth("100%");
    mainPanel.setHeight("100%");

    this.setWidget(mainPanel);
    this.setModal(false);
}

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);//from w w w . j a v a  2 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.CreateDashboardDialog.java

License:Apache License

private void init() {
    this.setWidth("375px");
    this.setText("Create New Dashboard");

    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.add(new HTML("<b>Name:</b>"));
    nameBox = new TextBox();
    nameBox.getElement().setId("createDashboardNameTextBox");
    nameBox.setWidth("290px");
    nameBox.addKeyUpHandler(new KeyUpHandler() {
        @Override//from   www.  j  a va 2s  .  co m
        public void onKeyUp(KeyUpEvent event) {
            createButton.setEnabled(nameBox.getValue().length() > 0);
        }
    });
    notesArea = new TextArea();
    notesArea.setWidth("290px");
    notesArea.getElement().setId("createDashboardNotesArea");
    dialogVPanel.add(nameBox);
    dialogVPanel.add(new HTML("<br><b>Dashboard Notes:</b>"));
    dialogVPanel.add(notesArea);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    // // Add a close button at the bottom of the dialog
    Image image = new Image(MdConstants.IMG_OK_CHECK);
    image.setSize(MdConstants.IMG_SIZE, MdConstants.IMG_SIZE);
    createButton = new PushButton(image);
    createButton.setEnabled(false);
    createButton.setSize(MdConstants.IMG_SIZE, MdConstants.IMG_SIZE);
    createButton.getElement().setId("createDashboardOkButton");
    createButton.setTitle("Create new dashboard");
    createButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            createButtonClicked();
        }
    });
    image = new Image(MdConstants.IMG_CANCEL_X);
    image.setSize(MdConstants.IMG_SIZE, MdConstants.IMG_SIZE);
    cancelButton = new PushButton(image);
    cancelButton.getElement().setId("createDashboardCancelButton");
    cancelButton.setSize(MdConstants.IMG_SIZE, MdConstants.IMG_SIZE);
    cancelButton.setTitle("Cancel");
    cancelButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            CreateDashboardDialog.this.hide();
        }
    });

    HorizontalPanel dialogButtonPanel = new HorizontalPanel();
    dialogButtonPanel.setSpacing(8);
    dialogButtonPanel.add(createButton);
    dialogButtonPanel.add(cancelButton);
    dialogVPanel.add(dialogButtonPanel);

    dialogVPanel.setSpacing(4);
    dialogVPanel.setCellHorizontalAlignment(dialogButtonPanel, HasHorizontalAlignment.ALIGN_CENTER);
    dialogVPanel.setCellVerticalAlignment(dialogButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE);
    this.setWidget(dialogVPanel);
    this.setGlassEnabled(true);
    this.setModal(true);
    this.center();
    nameBox.setFocus(true);
}

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

License:Open Source License

/**
 * If the panel is being added to the first or second section, then add straight away.
 * For sticky entries add to the // w  w w .  j  av a2  s  . c  om
 * @param sectionPanel
 * @param listEntryPanel
 */
protected void addEntryPanelToSection(VerticalPanel sectionPanel, ListEntryPanel listEntryPanel) {
    //Window.alert("addEntryPanelToSection--1");
    if (sectionPanel != this.scrollableEntriesPanel) {
        sectionPanel.add(listEntryPanel);
        sectionPanel.setCellHorizontalAlignment(listEntryPanel, HasAlignment.ALIGN_LEFT);
        sectionPanel.setCellVerticalAlignment(listEntryPanel, HasAlignment.ALIGN_MIDDLE);
        sectionPanel.setCellWidth(listEntryPanel, "100%");

        listEntryPanel.setPanelVisible(true);
    } else {
        this.scrollablePanels.add(listEntryPanel);
        int i = this.getNumberOfScrollableEntries();
        if (this.scrollableEntriesPanel.getWidgetCount() < i) {
            sectionPanel.add(listEntryPanel);
            sectionPanel.setCellHorizontalAlignment(listEntryPanel, HasAlignment.ALIGN_LEFT);
            sectionPanel.setCellVerticalAlignment(listEntryPanel, HasAlignment.ALIGN_MIDDLE);
            sectionPanel.setCellWidth(listEntryPanel, "100%");

            listEntryPanel.setPanelVisible(true);
        } else {
            this.browseControl.numberOfPanelsChanged();
        }
    }
    //      listEntryPanel.setVisible(false);
    //      Window.alert("addEntryPanelToSection--3");
}

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);/*w  ww. ja  va2s. 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%");

    //      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);//w  w  w  .j a va  2s  . c o m
    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.resources.client.ResourceTypeListEntryPopupPanel.java

License:Open Source License

private void writeListPanel(DockPanel outer) {
    Vector vec = new Vector();
    UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource();
    numberOfItems = 0;//from  ww w  .j av a2 s .  com

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

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

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

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

From source file:com.dimdim.conference.ui.user.client.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 www. j ava  2 s .  co  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;
}

From source file:com.edgenius.wiki.gwt.client.portal.Portal.java

License:Open Source License

public Portal(PortalVisitor visitor, int column, boolean showLogo) {
    this.visitor = visitor;
    this.column = column;

    visitor.setPortal(this);

    functionBtnBar = new FunctionWidget(null);
    VerticalPanel panel = new VerticalPanel();

    //logo and function bar
    FlowPanel logoBar = new FlowPanel();
    if (showLogo) {
        LogoRenderWidget logo = new LogoRenderWidget();
        logoBar.add(logo);//  ww w .j a va 2  s  .c  om
    }
    logoBar.add(functionBtnBar);
    logoBar.setWidth("100%");
    panel.add(logoBar);

    panel.setCellVerticalAlignment(logoBar, HasVerticalAlignment.ALIGN_BOTTOM);
    DOM.setElementAttribute(panel.getElement(), "width", "100%");

    boundaryPanel.setSize("100%", "100%");
    boundaryPanel.addStyleName(Css.PORTAL);
    columnsPanel.addStyleName(Css.PORTAL_CONTAINER);
    boundaryPanel.add(columnsPanel);
    panel.add(boundaryPanel);

    this.setWidget(panel);
}