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

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

Introduction

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

Prototype

protected Label(Element element) 

Source Link

Document

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

Usage

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

License:Open Source License

public DefaultListBrowseControl(ListPanel listPanel) {
    this.listPanel = listPanel;

    initWidget(basePanel);//  ww  w .  j  a  v a  2  s.c o  m
    //      Window.alert("1");
    basePanel.setStyleName("list-browse-control");

    previousPage = UIImages.getImageBundle(UIImages.defaultSkin).getPrevGreyed();
    previousPage.addClickListener(this);
    previousPage.setStyleName("list-browse-control-image");
    previousPage.setTitle(ConferenceGlobals.getTooltip("list.previous"));
    this.previousPagePanel.add(previousPage);
    this.previousPagePanel.setCellVerticalAlignment(previousPage, VerticalPanel.ALIGN_MIDDLE);
    this.basePanel.add(this.previousPagePanel);
    this.basePanel.setCellVerticalAlignment(this.previousPagePanel, VerticalPanel.ALIGN_MIDDLE);

    this.label = new Label(" ");
    this.label.setStyleName("list-browse-control-label");
    this.basePanel.add(this.label);
    this.basePanel.setCellVerticalAlignment(this.label, VerticalPanel.ALIGN_MIDDLE);

    nextPage = UIImages.getImageBundle(UIImages.defaultSkin).getNextGreyed();
    nextPage.addClickListener(this);
    nextPage.setStyleName("list-browse-control-image");
    nextPage.setTitle(ConferenceGlobals.getTooltip("list.next"));
    this.nextPagePanel.add(nextPage);
    this.nextPagePanel.setCellVerticalAlignment(nextPage, VerticalPanel.ALIGN_MIDDLE);
    this.basePanel.add(this.nextPagePanel);
    this.basePanel.setCellVerticalAlignment(this.nextPagePanel, VerticalPanel.ALIGN_MIDDLE);

    //      this.previousPage.setVisible(false);
    //      this.nextPage.setVisible(false);

    this.pageSize = listPanel.getList().getMaxVisibleEntries();
    this.currentNumberOfPages = 1;
    this.currentPageIndex = 0;
    //      Window.alert("2");
}

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

License:Open Source License

public DefaultMultipleListsBrowseControl(DefaultListBrowseControl list1BrowseControl) {
    this.list1BrowseControl = list1BrowseControl;

    initWidget(basePanel);/*  w  w w .j ava  2s . c  o m*/
    //      Window.alert("1");
    basePanel.setStyleName("list-browse-control");

    previousPage = UIImages.getImageBundle(UIImages.defaultSkin).getPrevGreyed();
    previousPage.addClickListener(this);
    previousPage.setStyleName("list-browse-control-image");
    this.previousPagePanel.add(previousPage);
    this.previousPagePanel.setCellVerticalAlignment(previousPage, VerticalPanel.ALIGN_MIDDLE);
    this.basePanel.add(this.previousPagePanel);
    this.basePanel.setCellVerticalAlignment(this.previousPagePanel, VerticalPanel.ALIGN_MIDDLE);

    this.label = new Label(" ");
    this.label.setStyleName("list-browse-control-label");
    this.basePanel.add(this.label);
    this.basePanel.setCellVerticalAlignment(this.label, VerticalPanel.ALIGN_MIDDLE);

    nextPage = UIImages.getImageBundle(UIImages.defaultSkin).getNextGreyed();
    nextPage.addClickListener(this);
    nextPage.setStyleName("list-browse-control-image");
    this.nextPagePanel.add(nextPage);
    this.nextPagePanel.setCellVerticalAlignment(nextPage, VerticalPanel.ALIGN_MIDDLE);
    this.basePanel.add(this.nextPagePanel);
    this.basePanel.setCellVerticalAlignment(this.nextPagePanel, VerticalPanel.ALIGN_MIDDLE);

    //      this.previousPage.setVisible(false);
    //      this.nextPage.setVisible(false);

    //      this.pageSize = listPanel.getList().getMaxVisibleEntries();
    //      this.currentNumberOfPages = 1;
    //      this.currentPageIndex = 0;
    //      Window.alert("2");
    this.list1BrowseControl.setListBrowseControlListener(this);
}

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

License:Open Source License

public ListPanelsContainer(String lhsLinkText, String lhsLinkTooltip, ClickListener lhsLinkClickListener,
        String rhsLinkText, String rhsLinkTooltip, ClickListener rhsLinkClickListener) {
    initWidget(this.basePanel);

    this.lhsLinkText = lhsLinkText;
    this.lhsLinkClickLstener = lhsLinkClickListener;
    this.rhsLinkText = rhsLinkText;
    this.rhsLinkClickLstener = rhsLinkClickListener;

    //footerPanel  = new DockPanel();
    //footerPanel.setStyleName("list-container-footer");
    if (lhsLinkText != null || rhsLinkText != null) {
        if (lhsLinkText != null) {
            lhsLink = new Label(lhsLinkText);
            lhsLink.setWordWrap(false);//from   ww  w .ja  v  a2 s .co m
            //lhsLink.setStyleName("common-text");
            //lhsLink.addStyleName("list-container-footer-link");
            //lhsLink.addStyleName("common-anchor");
            lhsLink.setTitle(lhsLinkTooltip);
            if (lhsLinkClickListener != null) {
                lhsLink.addClickListener(lhsLinkClickListener);
            }
            //footerPanel.add(lhsLink,DockPanel.WEST);
        }
        if (rhsLinkText != null) {
            rhsLink = new Label(rhsLinkText);
            rhsLink.setWordWrap(false);
            //rhsLink.setStyleName("common-text");
            //rhsLink.addStyleName("list-container-footer-link");
            //rhsLink.addStyleName("common-anchor");
            rhsLink.setTitle(rhsLinkTooltip);
            if (rhsLinkClickListener != null) {
                rhsLink.addClickListener(rhsLinkClickListener);
            }
            //footerPanel.add(rhsLink,DockPanel.EAST);
        }
        //         HTML seperator = new HTML(" ");
        //footerPanel.add(seperator,DockPanel.CENTER);
        //footerPanel.setCellWidth(seperator,"100%");
    } else {
        //         HTML seperator = new HTML(" ");
        //footerPanel.add(seperator,DockPanel.CENTER);
        //footerPanel.setCellWidth(seperator,"100%");
    }

    //this.basePanel.add(this.footerPanel);
}

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

License:Open Source License

public Widget getSubtabsPanel() {
    if (this.subTabsPanel == null) {
        this.subTabsPanel = new HorizontalPanel();
        int size = this.subTabs.size();
        for (int i = 0; i < size; i++) {
            CommonSubTab subTab = (CommonSubTab) this.subTabs.elementAt(i);
            if (subTab.isTypeComment()) {
                subTab.addStyleName("common-text");
            } else {
                subTab.addStyleName("console-sub-tab-link");
            }/*from   w w  w .  j a v  a  2  s. c  om*/
            if (i > 0) {
                HTML seperator = new HTML("|");
                seperator.setStyleName("console-sub-tab-seperator");
                this.subTabsPanel.add(seperator);
            }

            this.subTabsPanel.add(subTab);
            if (subTab.getImage() != null) {
                this.subTabsPanel.add(subTab.getImage());
                this.subTabsPanel.setCellHorizontalAlignment(subTab, HorizontalPanel.ALIGN_RIGHT);
                this.subTabsPanel.setCellHorizontalAlignment(subTab.getImage(), HorizontalPanel.ALIGN_RIGHT);
            }
        }
        if (this.comment != null) {
            Label label = new Label(comment);
            label.setStyleName("common-text");
            this.subTabsPanel.add(label);
        }
        if (this.shareControlPanel != null) {
            this.subTabsPanel.add(this.shareControlPanel);
            this.subTabsPanel.setCellHorizontalAlignment(shareControlPanel, HorizontalPanel.ALIGN_RIGHT);
        }
    }
    return this.subTabsPanel;
}

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

License:Open Source License

protected void createPanels() {
    this.tabsPanel = new DockPanel();
    this.tabsPanel.setStyleName("dm-tab-bar");
    this.subTabsPanel = new DockPanel();
    this.subTabsPanel.setStyleName("dm-sub-tab-bar");
    this.contentPanel = new DockPanel();

    leftGroupTabs = new HorizontalPanel();
    tabsPanel.add(leftGroupTabs, DockPanel.WEST);
    tabsPanel.setCellVerticalAlignment(leftGroupTabs, VerticalPanel.ALIGN_BOTTOM);
    tabsPanel.setCellHorizontalAlignment(leftGroupTabs, HorizontalPanel.ALIGN_LEFT);

    leftGroupSubTabs = new HorizontalPanel();
    subTabsPanel.add(leftGroupSubTabs, DockPanel.WEST);
    subTabsPanel.setCellHorizontalAlignment(leftGroupSubTabs, HorizontalPanel.ALIGN_LEFT);
    subTabsPanel.setCellVerticalAlignment(leftGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);

    leftGroupContentPanel = new VerticalPanel();
    leftGroupContentPanel.setStyleName("left-group-content-panel");
    contentPanel.add(leftGroupContentPanel, DockPanel.WEST);
    contentPanel.setCellHorizontalAlignment(leftGroupContentPanel, HorizontalPanel.ALIGN_CENTER);
    contentPanel.setCellVerticalAlignment(leftGroupContentPanel, VerticalPanel.ALIGN_TOP);

    poppedOutWorkspaceContent = new HorizontalPanel();
    poppedOutWorkspaceContent.add(new Label("."));

    leftTabGroup = new CommonTabGroup(this, name, CommonTabGroup.LEFT, leftGroupTabs, leftGroupSubTabs,
            leftGroupContentPanel, this.leftGroupContentWidth, this.leftGroupContentHeight);

    if (this.rightGroupName != null && this.rightGroupWidth != null) {
        this.rightGroupContentVisible = true;
        rightGroupTabs = new HorizontalPanel();
        rightGroupTabs.setWidth(rightGroupWidth);

        tabsPanel.add(rightGroupTabs, DockPanel.EAST);
        tabsPanel.setCellVerticalAlignment(rightGroupTabs, VerticalPanel.ALIGN_BOTTOM);
        tabsPanel.setCellHorizontalAlignment(rightGroupTabs, HorizontalPanel.ALIGN_RIGHT);

        rightGroupTabs.add(meetingClock);
        rightGroupTabs.setCellVerticalAlignment(meetingClock, VerticalPanel.ALIGN_BOTTOM);
        rightGroupTabs.setCellHorizontalAlignment(meetingClock, HorizontalPanel.ALIGN_RIGHT);

        rightGroupSubTabs = new HorizontalPanel();
        rightGroupSubTabs.setWidth(rightGroupWidth);
        subTabsPanel.add(rightGroupSubTabs, DockPanel.EAST);
        subTabsPanel.setCellHorizontalAlignment(rightGroupSubTabs, HorizontalPanel.ALIGN_RIGHT);
        subTabsPanel.setCellVerticalAlignment(rightGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);

        rightGroupContentPanel = new VerticalPanel();
        rightGroupContentPanel.setWidth(rightGroupWidth);
        contentPanel.add(rightGroupContentPanel, DockPanel.EAST);
        contentPanel.setCellHorizontalAlignment(rightGroupContentPanel, HorizontalPanel.ALIGN_LEFT);
        contentPanel.setCellVerticalAlignment(rightGroupContentPanel, VerticalPanel.ALIGN_TOP);

        rightTabGroup = new CommonTabGroup(this, name, CommonTabGroup.RIGHT, rightGroupTabs, rightGroupSubTabs,
                rightGroupContentPanel, this.rightGroupContentWidth, this.rightGroupContentHeight);

        this.rightGroupHideControl = new Image("images/opentriangle.gif");//,15,15);
        this.rightGroupHideControl.addClickListener(this);
        this.rightGroupHideControl.setStyleName("hide-discuss-panel-button");
        rightTabGroup.setHideControl(this.rightGroupHideControl);
        rightTabGroup.setOpenControlListener(this);
    } else {/*from   w w w  . jav  a2s .com*/
        //   Just to make sure that the subtabs panel expands horizontally.
        rightGroupSubTabs = new HorizontalPanel();
        rightGroupSubTabs.add(new HTML("&nbsp;"));
        subTabsPanel.add(rightGroupSubTabs, DockPanel.EAST);
        subTabsPanel.setCellHorizontalAlignment(rightGroupSubTabs, HorizontalPanel.ALIGN_RIGHT);
        subTabsPanel.setCellVerticalAlignment(rightGroupSubTabs, VerticalPanel.ALIGN_MIDDLE);
    }
    subTabsAndContentPanel = new DockPanel();
    subTabsAndContentPanel.setStyleName("dm-tab-content");
    subTabsAndContentPanel.add(subTabsPanel, DockPanel.NORTH);
    subTabsAndContentPanel.add(poppedOutWorkspaceContent, DockPanel.NORTH);
    this.poppedOutWorkspaceContent.setVisible(false);
    subTabsAndContentPanel.add(contentPanel, DockPanel.CENTER);
    roundedPanel = new RoundedPanel(subTabsAndContentPanel);

    tabbedPage.add(tabsPanel);
    tabbedPage.add(roundedPanel);
}

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 w w  .ja v a2  s .c om
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 CommonModalDialog(String title) {
    this.title = title;

    HorizontalPanel caption = new HorizontalPanel();
    caption.setWidth("100%");
    captionText = new Label(title);
    //      captionText.setStyleName("common-table-header");
    caption.add(captionText);//  w w w .  j a  v  a  2 s .  c o m
    caption.setCellWidth(captionText, "100%");

    close = UIImages.getImageBundle(UIImages.defaultSkin).getCloseDialog();
    close.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            hide();
        }
    });
    caption.add(close);

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

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

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

License:Open Source License

public static CommonUserInformationDialog getCommonUserInformationDialog(String title, String message) {
    if (CommonUserInformationDialog.theDialog == null) {
        Label label = new Label(message);
        label.setStyleName("common-text");
        CommonUserInformationDialog.theDialog = new CommonUserInformationDialog(title, label);
    }/*w w w.  ja v a  2  s  .  c o  m*/
    return CommonUserInformationDialog.theDialog;
}

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

License:Open Source License

public void setMessage(String title, String message) {
    Label label = new Label(message);
    label.setStyleName("common-text");
    this.setContentWidget(title, label);
    //      if (title != null)
    //      {/*www .  j a  va2 s  . c  o  m*/
    //         this.captionText.setText(title);
    //      }
    //      if (comment == null)
    //      {
    //         //   This means that the dialog was added a complete widget.
    //         this.comment = message;
    //         messageText = new Label(this.comment);
    //         messageText.setWordWrap(true);
    //         messageText.setStyleName("common-text");
    //         this.contentWidget = messageText;
    //         vp.add(messageText);
    //         vp.setCellHorizontalAlignment(this.messageText, HorizontalPanel.ALIGN_CENTER);
    //         vp.setCellVerticalAlignment(this.messageText, VerticalPanel.ALIGN_MIDDLE);
    //      }
    //      else if (this.messageText != null)
    //      {
    //         this.messageText.setText(message);
    //      }
}

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

License:Open Source License

protected Widget getContent() {
    if (this.contentWidget != null) {
        return this.contentWidget;
    } else {/*from www  . j av  a2s  . c  o m*/
        VerticalPanel vp = new VerticalPanel();

        messageText = new Label(this.comment);
        messageText.setWordWrap(true);
        messageText.setStyleName("common-text");
        vp.add(messageText);

        return vp;
    }
}