List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:com.dimdim.conference.ui.user.client.email.EmailControlPanel.java
License:Open Source License
protected Widget getContent() { ScrollPanel scroller = new ScrollPanel(); scroller.setStyleName("list-popup-scroll-panel"); VerticalPanel table = new VerticalPanel(); scroller.add(scrolledTable);//ww w .j a v a 2 s . c om HorizontalPanel header = new HorizontalPanel(); header.add(createLabel(".", "user-image-header")); header.add(createLabel(UIStrings.getNameLabel(), "lobby-name")); header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email")); Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header"); accept.addStyleName("common-anchor"); header.add(accept); Label deny = createLabel("", "user-chat-button-header"); header.add(deny); header.addStyleName("common-dialog-row"); table.add(header); table.add(scroller); table.setCellWidth(scroller, "100%"); int size = this.listModel.getListSize(); int i = 0; for (i = 0; i < size; i++) { EmailTaskListEntry etle = (EmailTaskListEntry) this.listModel.getListEntryAt(i); this.results.addElement(etle); HorizontalPanel row = new HorizontalPanel(); HorizontalPanel hp1 = new HorizontalPanel(); Image image = etle.getImage1Url(); 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 = createTextHTML(etle.getName(), "lobby-name"); nameLabel.addStyleName("common-anchor"); row.add(nameLabel); Label emailLabel = createTextHTML(etle.getEmailResult().getTarget(), "lobby-email"); emailLabel.addStyleName("common-anchor"); row.add(emailLabel); 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); this.checkBoxes.addElement(cb2); HorizontalPanel hp4 = new HorizontalPanel(); Label cb3 = new Label(""); 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); this.rows.addElement(row); } return table; }
From source file:com.dimdim.conference.ui.user.client.meetinglobby.MeetingLobbyControlPanel.java
License:Open Source License
protected Widget getContent() { ScrollPanel scroller = new ScrollPanel(); scroller.setStyleName("list-popup-scroll-panel"); VerticalPanel table = new VerticalPanel(); scrolledTable = new VerticalPanel(); scroller.add(scrolledTable);//from ww w . j av a 2s .c o m // table.setStyleName("list-control-table"); HorizontalPanel header = new HorizontalPanel(); header.add(createLabel(".", "user-image-header")); header.add(createLabel(UIStrings.getNameLabel(), "lobby-name")); header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email")); Label accept = createLabel(UIStrings.getAcceptLabel(), "user-chat-button-header"); accept.addStyleName("common-anchor"); accept.addClickListener(this.acceptList); header.add(accept); Label deny = createLabel(UIStrings.getDenyLabel(), "user-chat-button-header"); deny.addStyleName("common-anchor"); deny.addClickListener(this.denyList); header.add(deny); header.addStyleName("common-dialog-row"); table.add(header); table.add(scroller); table.setCellWidth(scroller, "100%"); int size = this.listModel.getListSize(); int i = 0; for (i = 0; i < size; i++) { UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i); UIRosterEntry user = ule.getUser(); this.users.addElement(user); HorizontalPanel row = new HorizontalPanel(); HorizontalPanel hp1 = new HorizontalPanel(); Image image = ule.getImage1Url(); 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 = createTextHTML(user.getDisplayName(), "lobby-name"); nameLabel.addStyleName("common-anchor"); row.add(nameLabel); Label emailLabel = createTextHTML(user.getUserId(), "lobby-email"); emailLabel.addStyleName("common-anchor"); row.add(emailLabel); HorizontalPanel hp3 = new HorizontalPanel(); // CheckBox cb2 = new CheckBox(); RadioButton cb2 = new RadioButton(user.getUserId()); 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); this.acceptBoxes.addElement(cb2); this.acceptList.addRadioButton(cb2); HorizontalPanel hp4 = new HorizontalPanel(); // CheckBox cb3 = new CheckBox(); RadioButton cb3 = new RadioButton(user.getUserId()); 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); this.denyBoxes.addElement(cb3); this.denyList.addRadioButton(cb3); row.addStyleName("common-dialog-row"); scrolledTable.add(row); this.rows.addElement(row); } return table; }
From source file:com.dimdim.conference.ui.user.client.MoodControlPopup.java
License:Open Source License
protected HorizontalPanel getMoodPanel(UserMood mood, boolean custom) { /*//from w ww. java 2s . c o m FocusPanel pane = new FocusPanel(); pane.addMouseListener(new MouseListenerAdapter() { public void onMouseEnter(Widget sender) { sender.addStyleName("mood-menu-entry-selected"); } public void onMouseLeave(Widget sender) { sender.removeStyleName("mood-menu-entry-selected"); } }); */ final HorizontalPanel moodPanel = new HorizontalPanel(); // pane.add(moodPanel); moodPanel.setStyleName("mood-menu-entry"); if (!custom) { moodPanel.addStyleName("mood-menu-entry-border"); } Image moodImage = UIImages.getImageBundle(UIImages.defaultSkin).getNewMoodImageUrl(mood.getMood()); moodImage.setStyleName(mood.getImageStyleName()); moodPanel.add(moodImage); moodPanel.setCellVerticalAlignment(moodImage, VerticalPanel.ALIGN_MIDDLE); Label moodLabel = getMoodLabel(mood, custom); moodLabel.addStyleName("mood-label"); moodPanel.add(moodLabel); moodPanel.setCellVerticalAlignment(moodLabel, VerticalPanel.ALIGN_MIDDLE); moodLabel.addMouseListener(new MouseListenerAdapter() { public void onMouseEnter(Widget sender) { moodPanel.addStyleName("mood-menu-entry-selected"); } public void onMouseLeave(Widget sender) { moodPanel.removeStyleName("mood-menu-entry-selected"); } }); moodPanel.setTitle(mood.getDisplayLabel()); return moodPanel; }
From source file:com.dimdim.conference.ui.user.client.questiontask.QuestionsControlPanel.java
License:Open Source License
protected Widget getContent() { ScrollPanel scroller = new ScrollPanel(); scroller.setStyleName("list-popup-scroll-panel"); VerticalPanel table = new VerticalPanel(); scroller.add(scrolledTable);//w w w .java2 s.c o m HorizontalPanel header = new HorizontalPanel(); header.add(createLabel(".", "user-image-header")); header.add(createLabel(UIStrings.getNameLabel(), "lobby-name")); header.add(createLabel(UIStrings.getEmailLabel(), "lobby-email")); Label accept = createLabel(UIStrings.getResolveLabel(), "user-chat-button-header"); accept.addStyleName("common-anchor"); header.add(accept); Label deny = createLabel("", "user-chat-button-header"); header.add(deny); header.addStyleName("common-dialog-row"); table.add(header); table.add(scroller); table.setCellWidth(scroller, "100%"); int size = this.listModel.getListSize(); int i = 0; for (i = 0; i < size; i++) { UserListEntry ule = (UserListEntry) this.listModel.getListEntryAt(i); UIRosterEntry user = ule.getUser(); this.users.addElement(user); HorizontalPanel row = new HorizontalPanel(); HorizontalPanel hp1 = new HorizontalPanel(); Image image = ule.getImage1Url(); 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 = createTextHTML(user.getDisplayName(), "lobby-name"); nameLabel.addStyleName("common-anchor"); row.add(nameLabel); Label emailLabel = createTextHTML(user.getUserId(), "lobby-email"); emailLabel.addStyleName("common-anchor"); row.add(emailLabel); 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); this.checkBoxes.addElement(cb2); HorizontalPanel hp4 = new HorizontalPanel(); Label cb3 = new Label(""); 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); this.rows.addElement(row); } return table; }
From source file:com.dimdim.conference.ui.user.client.SetDisplayNamePopup.java
License:Open Source License
protected Widget getContent() { //basePanel.add(this.settingsMainComment); //basePanel.setCellWidth(this.settingsMainComment,"100%"); //this.settingsMainComment.setStyleName("invitations-preview-comment"); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.addStyleName("chat-text-area"); Label label = new Label("New Name:"); label.setStyleName("common-text"); label.addStyleName("meeting-info-label"); hPanel.add(label);//from www . j a va2s .c o m displayName = new TextBox(); displayName.setText(currentUser.getDisplayName()); displayName.setStyleName("common-text"); displayName.addStyleName("chat-text-area"); displayName.setMaxLength(12); hPanel.add(displayName); basePanel.add(hPanel); basePanel.setCellVerticalAlignment(hPanel, VerticalPanel.ALIGN_MIDDLE); basePanel.add(new Label(" ")); displayName.addClickListener(new ClickListener() { public void onClick(Widget sender) { errorLabel.setText(" "); } }); errorLabel.setStyleName("common-text"); errorLabel.addStyleName("common-error-message"); basePanel.add(errorLabel); return basePanel; }
From source file:com.dimdim.conference.ui.user.client.SingleAttendeePermissionsControlDialog.java
License:Open Source License
protected Widget getContent() { VerticalPanel table = new VerticalPanel(); UIResources uiResources = UIResources.getUIResources(); HorizontalPanel header = new HorizontalPanel(); header.add(createLabel(".", "user-image-header")); header.add(createLabel(UIStrings.getNameLabel(), "user-name-header")); header.add(createLabel(UIStrings.getEmailLabel(), "user-email-header")); if (ConferenceGlobals.privateChatEnabled) { Label chat = createLabel(UIStrings.getChatLabel(), "user-chat-button-header"); // chat.addStyleName("common-anchor"); header.add(chat);//from w w w .j a va 2 s .c om } if (!ConferenceGlobals.isPresenterAVAudioDisabled()) { String label = UIStrings.getAudioLabel(); if (ConferenceGlobals.isPresenterAVVideoOnly()) { label = UIStrings.getVideoLabel(); } 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.setCellWidth(header, "100%"); { UserListEntry ule = (UserListEntry) listEntry; UIRosterEntry user = ule.getUser(); HorizontalPanel row = new HorizontalPanel(); HorizontalPanel hp1 = new HorizontalPanel(); Image image = ule.getImage1Url(); 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"); // nameLabel.addStyleName("common-anchor"); row.add(nameLabel); String subject = uiResources.getConferenceInfoAndDecode64("subject"); String mailToTag = "<a href=\"mailto:" + user.getUserId() + "?subject=" + subject + "\">" + user.getUserId() + "</a>"; HTML emailLabel = new HTML("<span>" + mailToTag + "</span>"); emailLabel.setStyleName("common-table-text"); emailLabel.addStyleName("user-email"); emailLabel.addStyleName("common-anchor"); row.add(emailLabel); if (ConferenceGlobals.privateChatEnabled) { HorizontalPanel hp2 = new HorizontalPanel(); this.chatControl = new CheckBox(); hp2.add(chatControl); hp2.setStyleName("user-chat-button"); hp2.setCellHorizontalAlignment(chatControl, HorizontalPanel.ALIGN_LEFT); hp2.setCellVerticalAlignment(chatControl, VerticalPanel.ALIGN_MIDDLE); row.add(hp2); row.setCellHorizontalAlignment(hp2, HorizontalPanel.ALIGN_LEFT); row.setCellVerticalAlignment(hp2, VerticalPanel.ALIGN_MIDDLE); chatControl.setChecked(user.isChatOn()); } if (!ConferenceGlobals.isPresenterAVAudioDisabled()) { HorizontalPanel hp3 = new HorizontalPanel(); this.audioControl = new CheckBox(); hp3.add(audioControl); hp3.setStyleName("user-chat-button"); hp3.setCellHorizontalAlignment(audioControl, HorizontalPanel.ALIGN_LEFT); hp3.setCellVerticalAlignment(audioControl, VerticalPanel.ALIGN_MIDDLE); row.add(hp3); row.setCellHorizontalAlignment(hp3, HorizontalPanel.ALIGN_LEFT); row.setCellVerticalAlignment(hp3, VerticalPanel.ALIGN_MIDDLE); audioControl.setChecked(user.isAudioOn()); if (!user.isAudioOn()) { audioControl.setEnabled(userManager.canEnableAudioFor(user.getUserId())); } } row.addStyleName("common-dialog-row"); table.add(row); } return table; }
From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java
License:Open Source License
protected Widget getLinks() { HorizontalPanel panel = new HorizontalPanel(); final UIRosterEntry otherUser = ((UserListEntry) userEntry).getUser(); if (UIGlobals.isActivePresenter(me) && !me.getUserId().equals(otherUser.getUserId())) { Label removeLink = new Label(UIStrings.getRemoveLabel()); removeLink.setStyleName("common-text"); removeLink.addStyleName("common-anchor"); removeLink.addStyleName("dm-hover-popup-link"); removeLink.addStyleName("user-remove-control-link"); removeLink.addClickListener(new ClickListener() { public void onClick(Widget sender) { String userName = otherUser.getDisplayName(); ConfirmationDialog cd = new ConfirmationDialog( ConferenceGlobals.getDisplayString("remove.header", "Remove") + " " + userName, ConferenceGlobals.getDisplayString("remove.desc", "Are you sure you want to remove ") + userName, "default-message", new ConfirmationListener() { public void onOK() { userManager.removeUser(otherUser); }/* w w w. ja va 2 s .c om*/ public void onCancel() { } }); cd.drawDialog(); hide(); } }); panel.add(removeLink); panel.setCellHorizontalAlignment(removeLink, HorizontalPanel.ALIGN_LEFT); } if (me.getUserId().equals(otherUser.getUserId())) { Label changePictureLink = new Label(UIStrings.getChangePictureLabel()); changePictureLink.setStyleName("common-text"); changePictureLink.addStyleName("common-anchor"); changePictureLink.addStyleName("dm-hover-popup-link"); changePictureLink.addStyleName("user-change-picture-control-link"); changePictureLink.addClickListener(new ClickListener() { public void onClick(Widget sender) { ChangePictureDialog dlg = new ChangePictureDialog(userManager, me); dlg.drawDialog(); hide(); } }); panel.add(changePictureLink); panel.setCellWidth(changePictureLink, "100%"); panel.setCellHorizontalAlignment(changePictureLink, HorizontalPanel.ALIGN_RIGHT); } return panel; }
From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java
License:Open Source License
protected void writeHeader3() { HorizontalPanel header = new HorizontalPanel(); /*/* w w w . j a v a 2s .c om*/ if(ConferenceGlobals.privateChatEnabled) { addControl(header,userEntry.getImage1Url(),controlsProvider.getImage1ClickListener()); addControl(header,userEntry.getImage2Url(),controlsProvider.getImage2ClickListener()); } addControl(header,userEntry.getImage3Url(),controlsProvider.getImage3ClickListener()); addControl(header,userEntry.getImage4Url(),controlsProvider.getImage4ClickListener());*/ Label userID = new Label(((UserListEntry) userEntry).getUser().getDisplayName()); userID.setStyleName("user-menu-item"); header.add(userID); /*Label email = new Label(me.getEmail()); email.setStyleName("user-menu-item"); email.addStyleName("common-anchor"); header.add(email);*/ header.setCellHorizontalAlignment(userID, HorizontalPanel.ALIGN_LEFT); //header.setCellHorizontalAlignment(email, HorizontalPanel.ALIGN_RIGHT); //header.setBorderWidth(1); headerPanel.add(header); header.setSize("100%", "100%"); headerPanel.setCellWidth(header, "100%"); }
From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java
License:Open Source License
/** * This will create a menu item with one label * @param panel// ww w . j a va2s . com * @param labelText * @param clickListener * @param hideOnClick */ private void addMoodControl(VerticalPanel panel, String labelText, ClickListener clickListener, boolean hideOnClick) { HorizontalPanel imageNText = new HorizontalPanel(); // FocusPanel focusPanel = new FocusPanel(); Label lbl = new Label(labelText); lbl.setStyleName("user-menu-entry"); imageNText.add(lbl); imageNText.setCellHorizontalAlignment(lbl, HorizontalPanel.ALIGN_LEFT); HTML lbl2 = new HTML("»"); //lbl2.setStyleName("user-menu-item"); imageNText.add(lbl2); imageNText.setCellHorizontalAlignment(lbl2, HorizontalPanel.ALIGN_RIGHT); imageNText.setCellWidth(lbl, "100%"); imageNText.setCellHeight(lbl2, "100%"); imageNText.setWidth("100%"); //imageNText.setBorderWidth(1); // focusPanel.add(imageNText); if (null != clickListener) { HoverStyler hs = new HoverStyler(moodListener, imageNText, null); lbl.addMouseListener(hs); lbl.addStyleName("user-menu-entry-enabled"); lbl.addClickListener(clickListener); lbl2.addMouseListener(hs); lbl2.addClickListener(clickListener); } else { lbl.addStyleName("user-menu-entry-disabled"); } if (hideOnClick) { ClickListener clickListener2 = new ClickListener() { public void onClick(Widget w) { //Window.alert(" clicked on an item now hiding menu"); hide(); } }; lbl.addClickListener(clickListener2); } panel.add(imageNText); panel.setCellWidth(imageNText, "100%"); }
From source file:com.dingziran.effective.client.content.widgets.CwBasicButton.java
License:Apache License
/** * Constructor.//from ww w. j a v a 2s . co m * * @param constants the constants */ public CwBasicButton(CwConstants constants) { super(constants.cwBasicButtonName(), constants.cwBasicButtonDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a panel to align the widgets HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setSpacing(10); final String msg = constants.cwBasicButtonClickMessage(); // Add a normal button Button normalButton = new Button(constants.cwBasicButtonNormal(), new ClickHandler() { public void onClick(ClickEvent event) { Window.alert(msg); } }); normalButton.ensureDebugId("cwBasicButton-normal"); hPanel.add(normalButton); // Add a disabled button Button disabledButton = new Button(constants.cwBasicButtonDisabled()); disabledButton.ensureDebugId("cwBasicButton-disabled"); disabledButton.setEnabled(false); hPanel.add(disabledButton); view.setExample(hPanel); }