List of usage examples for com.google.gwt.user.client.ui HTML HTML
protected HTML(Element element)
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);// ww w . j a v a 2s . 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
private void presOnSelf(VerticalPanel row) { //addControl(row, UIImages.getImageBundle(UIImages.defaultSkin).getInvite(), presenterSelfTextArray[0], sendInviteListener, true); // if("true".equalsIgnoreCase(ConferenceGlobals.getShowInviteLinks())) if (this.allowInvites) { addControl(row, presenterSelfTextArray[1], sendInviteListener, true); }//w w w . j a v a2s .c o m if (UIGlobals.isOrganizer(me) && !UIGlobals.isActivePresenter(me)) { makePresenterListener = new ClickListener() { public void onClick(Widget sender) { if (controlsProvider.getUserSignoutListener().isRecordingInProgress()) { // Recording must be stopped before switching presenters. DefaultCommonDialog.showMessage( ConferenceGlobals.getDisplayString("recording.progress.heading", "Recording in progress"), ConferenceGlobals.getDisplayString("recording.progress.desc", "Recording must be stopped before changing the presenter control.")); } else { if (ConferenceGlobals.getClientLayout() != null) { ConferenceGlobals.getClientLayout().closePopout(); } userManager.makeActivePresenter(me); } } }; } addControl(row, presenterSelfTextArray[6], makePresenterListener, true); HTML line1 = new HTML(" "); line1.setStyleName("section-break"); row.add(line1); addControl(row, presenterSelfTextArray[5], changeDisplayListener, true); addMoodControl(row, presenterSelfTextArray[4], moodListener, false); HTML line2 = new HTML(" "); line2.setStyleName("section-break"); row.add(line2); if (ConferenceGlobals.recordingEnabled) { if (ClientModel.getClientModel().getRecordingModel().isRecordingActive()) { addControl(row, ConferenceGlobals.getDisplayString("usermenu.stop.recording.label", "Stop Recording"), recordListener, true); } else { addControl(row, ConferenceGlobals.getDisplayString("usermenu.start.recording.label", "Start Recording"), recordListener, true); } } if (!ConferenceGlobals.isPresenterAVAudioDisabled()) { addControl(row, presenterSelfTextArray[2], controlsProvider.getImage3ClickListener(), true); } addControl(row, presenterSelfTextArray[7], signoutListener, true); }
From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java
License:Open Source License
private void attendeeOnSelf(VerticalPanel row) { // if("true".equalsIgnoreCase(ConferenceGlobals.getShowInviteLinks())) if (this.allowInvites) { addControl(row, attendeeSelfTextArray[0], sendInviteListener, true); }// w w w.j av a2 s.c om addControl(row, attendeeSelfTextArray[4], feedbackListener, true); HTML line1 = new HTML(" "); line1.setStyleName("section-break"); row.add(line1); addControl(row, attendeeSelfTextArray[5], changeDisplayListener, true); addMoodControl(row, attendeeSelfTextArray[3], moodListener, false); HTML line2 = new HTML(" "); line2.setStyleName("section-break"); row.add(line2); if (me.isAudioOn() || me.isVideoOn()) { addControl(row, attendeeSelfTextArray[2], controlsProvider.getImage3ClickListener(), true); } else { addControl(row, attendeeSelfTextArray[2], (ClickListener) null, true); } addControl(row, attendeeSelfTextArray[6], signoutListener, true); }
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//from w w w .j ava 2s. c o m * @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.CwCheckBox.java
License:Apache License
/** * Constructor.//from w w w. j a v a 2s . c o m * * @param constants the constants */ public CwCheckBox(CwConstants constants) { super(constants.cwCheckBoxName(), constants.cwCheckBoxDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a vertical panel to align the check boxes VerticalPanel vPanel = new VerticalPanel(); HTML label = new HTML(constants.cwCheckBoxCheckAll()); label.ensureDebugId("cwCheckBox-label"); vPanel.add(label); // Add a checkbox for each day of the week String[] daysOfWeek = constants.cwCheckBoxDays(); for (int i = 0; i < daysOfWeek.length; i++) { String day = daysOfWeek[i]; CheckBox checkBox = new CheckBox(day); checkBox.ensureDebugId("cwCheckBox-" + day); // Disable the weekends if (i >= 5) { checkBox.setEnabled(false); } vPanel.add(checkBox); } view.setExample(vPanel); }
From source file:com.dingziran.effective.client.content.widgets.CwCustomButton.java
License:Apache License
/** * Constructor.//from w w w .j av a2 s . c om * * @param constants the constants */ public CwCustomButton(CwConstants constants) { super(constants.cwCustomButtonName(), constants.cwCustomButtonDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a panel to layout the widgets VerticalPanel vpanel = new VerticalPanel(); HorizontalPanel pushPanel = new HorizontalPanel(); pushPanel.setSpacing(10); HorizontalPanel togglePanel = new HorizontalPanel(); togglePanel.setSpacing(10); // Combine all the panels vpanel.add(new HTML(constants.cwCustomButtonPush())); vpanel.add(pushPanel); vpanel.add(new HTML("<br><br>" + constants.cwCustomButtonToggle())); vpanel.add(togglePanel); // Add a normal PushButton PushButton normalPushButton = new PushButton(new Image(Showcase.images.gwtLogo())); normalPushButton.ensureDebugId("cwCustomButton-push-normal"); pushPanel.add(normalPushButton); // Add a disabled PushButton PushButton disabledPushButton = new PushButton(new Image(Showcase.images.gwtLogo())); disabledPushButton.ensureDebugId("cwCustomButton-push-disabled"); disabledPushButton.setEnabled(false); pushPanel.add(disabledPushButton); // Add a normal ToggleButton ToggleButton normalToggleButton = new ToggleButton(new Image(Showcase.images.gwtLogo())); normalToggleButton.ensureDebugId("cwCustomButton-toggle-normal"); togglePanel.add(normalToggleButton); // Add a disabled ToggleButton ToggleButton disabledToggleButton = new ToggleButton(new Image(Showcase.images.gwtLogo())); disabledToggleButton.ensureDebugId("cwCustomButton-toggle-disabled"); disabledToggleButton.setEnabled(false); togglePanel.add(disabledToggleButton); view.setExample(vpanel); }
From source file:com.dingziran.effective.client.content.widgets.CwDatePicker.java
License:Apache License
/** * Constructor./* ww w. j a v a 2s . c om*/ * * @param constants the constants */ public CwDatePicker(CwConstants constants) { super(constants.cwDatePickerName(), constants.cwDatePickerDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a basic date picker DatePicker datePicker = new DatePicker(); final Label text = new Label(); // Set the value in the text box when the user selects a date datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() { public void onValueChange(ValueChangeEvent<Date> event) { Date date = event.getValue(); String dateString = DateTimeFormat.getMediumDateFormat().format(date); text.setText(dateString); } }); // Set the default value datePicker.setValue(new Date(), true); // Create a DateBox DateTimeFormat dateFormat = DateTimeFormat.getLongDateFormat(); DateBox dateBox = new DateBox(); dateBox.setFormat(new DateBox.DefaultFormat(dateFormat)); // Combine the widgets into a panel and return them VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new HTML(constants.cwDatePickerLabel())); vPanel.add(text); vPanel.add(datePicker); vPanel.add(new HTML(constants.cwDatePickerBoxLabel())); vPanel.add(dateBox); view.setExample(vPanel); }
From source file:com.dingziran.effective.client.content.widgets.CwFileUpload.java
License:Apache License
/** * Constructor.//from w w w . j a va 2 s . c om * * @param constants the constants */ public CwFileUpload(CwConstants constants) { super(constants.cwFileUploadName(), constants.cwFileUploadDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a vertical panel to align the content VerticalPanel vPanel = new VerticalPanel(); // Add a label vPanel.add(new HTML(constants.cwFileUploadSelectFile())); // Add a file upload widget final FileUpload fileUpload = new FileUpload(); fileUpload.ensureDebugId("cwFileUpload"); vPanel.add(fileUpload); final String msg1 = constants.cwFileUploadNoFileError(); final String msg2 = constants.cwFileUploadSuccessful(); // Add a button to upload the file Button uploadButton = new Button(constants.cwFileUploadButton()); uploadButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { String filename = fileUpload.getFilename(); if (filename.length() == 0) { Window.alert(msg1); } else { Window.alert(msg2); } } }); vPanel.add(new HTML("<br>")); vPanel.add(uploadButton); view.setExample(vPanel); }
From source file:com.dingziran.effective.client.content.widgets.CwHyperlink.java
License:Apache License
/** * Constructor./*from w w w. j a v a2 s. c om*/ * * @param constants the constants */ public CwHyperlink(CwConstants constants) { super(constants.cwHyperlinkName(), constants.cwHyperlinkDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Add a label VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new HTML(constants.cwHyperlinkChoose())); vPanel.setSpacing(5); // Add a hyper link to each section in the Widgets category ShowcaseConstants allConstants = (ShowcaseConstants) constants; vPanel.add(getHyperlink(CwCheckBox.class, allConstants.cwCheckBoxName())); vPanel.add(getHyperlink(CwRadioButton.class, allConstants.cwRadioButtonName())); vPanel.add(getHyperlink(CwBasicButton.class, allConstants.cwBasicButtonName())); vPanel.add(getHyperlink(CwCustomButton.class, allConstants.cwCustomButtonName())); vPanel.add(getHyperlink(CwFileUpload.class, allConstants.cwFileUploadName())); vPanel.add(getHyperlink(CwDatePicker.class, allConstants.cwDatePickerName())); view.setExample(vPanel); }
From source file:com.dingziran.effective.client.content.widgets.CwRadioButton.java
License:Apache License
/** * Constructor.//from w w w . java2 s. co m * * @param constants the constants */ public CwRadioButton(CwConstants constants) { super(constants.cwRadioButtonName(), constants.cwRadioButtonDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a vertical panel to align the radio buttons VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new HTML(constants.cwRadioButtonSelectColor())); // Add some radio buttons to a group called 'color' String[] colors = constants.cwRadioButtonColors(); for (int i = 0; i < colors.length; i++) { String color = colors[i]; RadioButton radioButton = new RadioButton("color", color); radioButton.ensureDebugId("cwRadioButton-color-" + color); if (i == 2) { radioButton.setEnabled(false); } vPanel.add(radioButton); } // Add a new header to select your favorite sport vPanel.add(new HTML("<br>" + constants.cwRadioButtonSelectSport())); // Add some radio buttons to a group called 'sport' String[] sports = constants.cwRadioButtonSports(); for (int i = 0; i < sports.length; i++) { String sport = sports[i]; RadioButton radioButton = new RadioButton("sport", sport); radioButton.ensureDebugId("cwRadioButton-sport-" + sport.replaceAll(" ", "")); if (i == 2) { radioButton.setValue(true); } vPanel.add(radioButton); } view.setExample(vPanel); }