List of usage examples for com.google.gwt.user.client.ui HTML HTML
protected HTML(Element element)
From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java
License:Open Source License
private HTML getFileIconedName(String name, FileType type) { HTML html = null;//from w w w.j a v a 2s. co m if (type == FileType.DIR) { html = new HTML(FolderManagementConstants.ICON_FOLDER + FolderManagementConstants.OPEN_SPAN_TAG + name + FolderManagementConstants.CLOSE_SPAN_TAG); } else if (type == FileType.MM) { html = new HTML(FolderManagementConstants.ICON_MM + FolderManagementConstants.OPEN_SPAN_TAG + name + FolderManagementConstants.CLOSE_SPAN_TAG); } else if (type == FileType.IMG) { html = new HTML(FolderManagementConstants.ICON_IMG + FolderManagementConstants.OPEN_SPAN_TAG + name + FolderManagementConstants.CLOSE_SPAN_TAG); } else if (type == FileType.DOC) { html = new HTML(FolderManagementConstants.ICON_DOC + FolderManagementConstants.OPEN_SPAN_TAG + name + FolderManagementConstants.CLOSE_SPAN_TAG); } else { html = new HTML(FolderManagementConstants.ICON_OTHER + FolderManagementConstants.OPEN_SPAN_TAG + name + FolderManagementConstants.CLOSE_SPAN_TAG); } return html; }
From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.widget.DisplayDialogBox.java
License:Open Source License
public DisplayDialogBox(Map<Integer, String> fileIndexVsNameMap, final HandlerManager eventBus) { super();// www . jav a2 s . co m setWidget(BINDER.createAndBindUi(this)); this.eventBus = eventBus; final VerticalPanel labelPanel = new VerticalPanel(); if (fileIndexVsNameMap != null && !fileIndexVsNameMap.isEmpty()) { for (final Entry<Integer, String> labelString : fileIndexVsNameMap.entrySet()) { totalCounter++; final HorizontalPanel horizontalPanel = new HorizontalPanel(); HTML html = new HTML(FolderManagementConstants.REMOVE_ICON_FOLDER_GIF); Label label = new Label(labelString.getValue()); horizontalPanel.add(html); horizontalPanel.add(label); horizontalPanel.setSpacing(3); labelPanel.add(horizontalPanel); html.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { labelPanel.remove(horizontalPanel); if (--totalCounter == 0) { addNoFilesLabel(labelPanel); } eventBus.fireEvent(new RemoveAttachmentEvent(labelString.getKey())); } }); } } else { addNoFilesLabel(labelPanel); } addStyleName(FolderManagementConstants.CSS_CONFIGURABLE_DIALOG_BOX); Button closeButton = new Button(LocaleDictionary.get().getConstantValue(FolderManagementConstants.CLOSE), new ClickHandler() { @Override public void onClick(ClickEvent arg0) { hide(); } }); HorizontalPanel horizontalButtonPanel = new HorizontalPanel(); horizontalButtonPanel.add(closeButton); horizontalButtonPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER); ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.add(labelPanel); scrollPanel.setWidth(_200PX); scrollPanel.setHeight(_200PX); scrollPanel.addStyleName(FolderManagementConstants.BORDER); setHeight(_100PX); verticalPanel.add(scrollPanel); verticalPanel.add(horizontalButtonPanel); verticalPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER); setModal(true); setVisible(true); show(); center(); closeButton.setFocus(true); }
From source file:com.eucalyptus.webui.client.view.ConfirmationViewImpl.java
License:Open Source License
@Override public void display(String caption, String subject, SafeHtml html) { this.setText(caption); contentPanel.clear();// w w w.j a va 2 s . c om this.subject.setText(subject); HTML widget = new HTML(html); widget.setStyleName(gridStyle.html()); contentPanel.setWidget(widget); center(); show(); }
From source file:com.example.app.client.EchoWidget.java
License:Apache License
private Widget label(String text) { return new HTML("<b>" + text + ":</b> "); }
From source file:com.example.farmwebapp.client.gui.SignUp.java
@SuppressWarnings("deprecation") public IsWidget getSignUpPanel() { rb_doctor.setChecked(true);//from w w w. j av a 2s . c om /** * PROFESSION RADIO BUTTONS */ hp_profession.add(rb_doctor); hp_profession.add(rb_pharmacist); hp_profession.getElement().setAttribute("cellpadding", "5"); rb_pharmacist.setStyleName("moveRadioBtn"); vp.add(hp_profession); /** * NAME FIELD */ lb_nameSuffix.addItem(" "); lb_nameSuffix.addItem("Jr."); lb_nameSuffix.addItem("Sr."); hp_prefixContainer.add(lb_namePrefix); hp_prefixContainer.add(tb_nameFirst); ft.setText(0, 0, "NAME"); ft.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(0, 1, tb_nameFirst); tb_nameFirst.setPixelSize(CELLWIDTH, CELLHEIGHT); tb_nameFirst.setTitle("First"); ft.setWidget(0, 2, tb_nameLast); tb_nameLast.setPixelSize(CELLWIDTH, CELLHEIGHT); tb_nameLast.setTitle("Last"); ft.setWidget(0, 3, lb_nameSuffix); tb_nameSuffix.setPixelSize(CELLWIDTH, CELLHEIGHT); /** * USERNAME FIELD */ ft.setText(1, 0, "USERNAME"); ft.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(1, 1, tb_username); tb_username.setPixelSize(CELLWIDTH, CELLHEIGHT); //ft.setWidget(2, 1, tb_usernameConfirm); //tb_usernameConfirm.setPixelSize(CELLWIDTH, CELLHEIGHT); /** * PASSWORD FIELD */ ft.setText(3, 0, "PASSWORD"); ft.getCellFormatter().setVerticalAlignment(3, 0, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(3, 1, ptb_password); ptb_password.setPixelSize(CELLWIDTH, CELLHEIGHT); ft.setWidget(4, 1, ptb_passwordConfirm); ptb_passwordConfirm.setPixelSize(CELLWIDTH, CELLHEIGHT); ptb_passwordConfirm.setTitle("Confirm Password"); ptb_passwordConfirm.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { String originalPassword = ptb_password.getText(); if (originalPassword != ptb_passwordConfirm.getText()) { ptb_passwordConfirm.setStyleName(ptb_password.getStyleName() + " incorrectvalidator"); } else if (originalPassword == ptb_passwordConfirm.getText() && originalPassword.length() != 0) { ptb_passwordConfirm.setStyleName(ptb_password.getStyleName() + " correctvalidator"); } else if (originalPassword.length() == 0 && ptb_passwordConfirm.getText().length() == 0) { ptb_passwordConfirm.setStyleName(ptb_password.getStyleName() + " clearvalidator"); } } }); /** * DATE OF BIRTH FIELD */ db_dob.setFormat(new DateBox.DefaultFormat(dateFormat)); ft.setText(5, 0, "DATE OF BIRTH"); ft.getCellFormatter().setVerticalAlignment(5, 0, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(5, 1, db_dob); tb_dob.setPixelSize(CELLWIDTH, CELLHEIGHT); db_dob.setPixelSize(CELLWIDTH, CELLHEIGHT); /** * EMAIL FIELD */ ft.setText(1, 2, "EMAIL"); ft.getCellFormatter().setVerticalAlignment(1, 2, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(1, 3, tb_email); tb_email.setPixelSize(CELLWIDTH, CELLHEIGHT); ft.setWidget(2, 3, tb_emailConfirm); tb_emailConfirm.setPixelSize(CELLWIDTH, CELLHEIGHT); tb_emailConfirm.setTitle("Confirm Email"); tb_emailConfirm.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { String originalEmail = tb_email.getText(); if (originalEmail != tb_emailConfirm.getText()) { tb_emailConfirm.setStyleName(tb_email.getStyleName() + " incorrectvalidator"); } else if (originalEmail == tb_emailConfirm.getText()) { tb_emailConfirm.setStyleName(tb_email.getStyleName() + " correctValidator"); } } }); /** * PHONE NUMBER FIELD */ ft.setText(3, 2, "PHONE NUMBER"); ft.getCellFormatter().setVerticalAlignment(4, 2, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(3, 3, tb_phoneNo); tb_phoneNo.setPixelSize(CELLWIDTH, CELLHEIGHT); tb_phoneNo.setTitle("xxx-xxx-xxxx"); // Will only accept numerics tb_phoneNo.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if (!Character.isDigit(event.getCharCode())) { ((TextBox) event.getSource()).cancelKey(); } } }); /** * LICENSE NUMBER */ ft.setText(4, 2, "LICENSE NUMBER"); ft.getCellFormatter().setVerticalAlignment(3, 2, HasVerticalAlignment.ALIGN_BOTTOM); ft.setWidget(4, 3, tb_licenseNo); tb_licenseNo.setPixelSize(CELLWIDTH, CELLHEIGHT); /** * SIGN UP BUTTON */ ft.setWidget(5, 3, signUpArrow); signUpArrow.setPixelSize(25, 25); ft.getCellFormatter().setVerticalAlignment(5, 3, HasVerticalAlignment.ALIGN_BOTTOM); signUpArrow.getElement().setAttribute("align", "right"); signUpArrow.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { HTML s_DBData; String s_SelectedProfession = "not sected"; if (rb_doctor.getValue()) s_SelectedProfession = "Doctor"; if (rb_pharmacist.getValue()) s_SelectedProfession = "Pharmacist"; try { s_DBData = new HTML("User Type: " + s_SelectedProfession + "<br>Name: " + tb_nameFirst.getText() + "," + tb_nameLast.getText() + ", " + lb_nameSuffix.getSelectedItemText() + "<br>User name: " + tb_username.getText() + " Password: " + ptb_password.getText() + "<br>Email: " + tb_email.getText() + "<br>Date of Birth: " + db_dob.getValue() + "<br>Phone Number: " + tb_phoneNo.getText() + "<br>License Number: " + tb_licenseNo.getText()); PopUps popups = new PopUps(); popups.showDialog("Data sent to DB:\r\n" + s_DBData); } catch (Exception e) { } } }); signUpArrow.addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { signUpArrow.getElement().getStyle().setCursor(Cursor.POINTER); } }); /** * FORM PLACEMENT AND ATTRIBUTES */ ft.getElement().setAttribute("cellpadding", "10"); vp.add(hp); vp.add(ft); return vp; }
From source file:com.flatown.client.InfoPanel.java
License:Apache License
public void addBreak() { add(new HTML("<br>")); }
From source file:com.flatown.client.InfoPanel.java
License:Apache License
public void addExample(String prefix, String text) { HTML example = new HTML(prefix + ": <code>" + text + "</code>"); DOM.setStyleAttribute(example.getElement(), "margin", "0px 5px 0px 5px"); add(example);/*from w w w. j a va 2 s . c o m*/ }
From source file:com.fujitsu.gwt.bewebapp.client.content.text.RichTextToolbar.java
License:Open Source License
/** Initialize the options on the toolbar **/ private void buildTools() { //Init the TOP Panel forst topPanel.add(bold = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 0, 20, 20, GUI_HOVERTEXT_BOLD)); topPanel.add(italic = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 60, 20, 20, GUI_HOVERTEXT_ITALIC)); //topPanel.add(underline = createToggleButton(HTTP_STATIC_ICONS_GIF,0,140,20,20,GUI_HOVERTEXT_UNDERLINE)); //topPanel.add(stroke = createToggleButton(HTTP_STATIC_ICONS_GIF,0,120,20,20,GUI_HOVERTEXT_STROKE)); topPanel.add(new HTML(" ")); //topPanel.add(subscript = createToggleButton(HTTP_STATIC_ICONS_GIF,0,600,20,20,GUI_HOVERTEXT_SUBSCRIPT)); //topPanel.add(superscript = createToggleButton(HTTP_STATIC_ICONS_GIF,0,620,20,20,GUI_HOVERTEXT_SUPERSCRIPT)); topPanel.add(new HTML(" ")); topPanel.add(alignleft = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 460, 20, 20, GUI_HOVERTEXT_ALIGNLEFT)); topPanel.add(// w ww . j ava 2s.c o m alignmiddle = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 420, 20, 20, GUI_HOVERTEXT_ALIGNCENTER)); topPanel.add( alignright = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 480, 20, 20, GUI_HOVERTEXT_ALIGNRIGHT)); //topPanel.add(headerlist = createHeaderList()); topPanel.add(fontsizelist = createFontSizeList()); //topPanel.add(new HTML(" ")); //topPanel.add(inserth1 = createTextPushButton("HI",20,20, GUI_HOVERTEXT_H1)); //topPanel.add(inserth2 = createTextPushButton("H2",20,20, GUI_HOVERTEXT_H2)); //topPanel.add(inserth3 = createTextPushButton("H3",20,20, GUI_HOVERTEXT_H3)); //topPanel.add(insertp = createTextPushButton("P",20,20, GUI_HOVERTEXT_P)); topPanel.add(new HTML(" ")); topPanel.add(orderlist = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 80, 20, 20, GUI_HOVERTEXT_ORDERLIST)); topPanel.add( unorderlist = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 20, 20, 20, GUI_HOVERTEXT_UNORDERLIST)); topPanel.add( indentright = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 400, 20, 20, GUI_HOVERTEXT_IDENTRIGHT)); topPanel.add(indentleft = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 540, 20, 20, GUI_HOVERTEXT_IDENTLEFT)); topPanel.add(new HTML(" ")); topPanel.add(generatelink = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 500, 20, 20, GUI_HOVERTEXT_LINK)); topPanel.add(breaklink = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 640, 20, 20, GUI_HOVERTEXT_BREAKLINK)); topPanel.add(new HTML(" ")); topPanel.add(insertline = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 360, 20, 20, GUI_HOVERTEXT_HLINE)); topPanel.add(insertimage = createPushButton(HTTP_STATIC_ICONS_GIF, 0, 380, 20, 20, GUI_HOVERTEXT_IMAGE)); topPanel.add(new HTML(" ")); topPanel.add(removeformatting = createPushButton(HTTP_STATIC_ICONS_GIF, 20, 460, 20, 20, GUI_HOVERTEXT_REMOVEFORMAT)); topPanel.add(new HTML(" ")); topPanel.add( texthtml = createToggleButton(HTTP_STATIC_ICONS_GIF, 0, 260, 20, 20, GUI_HOVERTEXT_SWITCHVIEW)); //Init the BOTTOM Panel //bottomPanel.add(fontlist = createFontList()); //bottomPanel.add(headerlist = createHeaderList()); //bottomPanel.add(headerlist = createHeaderList()); //bottomPanel.add(fontsizelist = createFontSizeList()); }
From source file:com.fullmetalgalaxy.client.chat.MAppChat.java
License:Open Source License
@Override public void onChannelMessage(Object p_message) { if (p_message instanceof ChatMessage) { ChatMessage p_msg = (ChatMessage) p_message; if (!p_msg.isEmpty()) { String text = SafeHtmlUtils.htmlEscape(p_msg.getText()); text = SmileyCollection.INSTANCE.replace(text); text = text.replace("\n", "<br/>"); HTML label = new HTML("<b>[" + p_msg.getFromPseudo() + "]</b> " + text); m_msgList.add(label);//www. j ava2 s . co m scrollPanel.ensureVisible(label); } } }
From source file:com.fullmetalgalaxy.client.creation.DlgLoadMap.java
License:Open Source License
protected void redraw() { m_panel.clear();/* w ww.ja v a 2 s .c om*/ m_maps = new HashMap<Image, String>(); // add original map Image image = new Image("/puzzles/original/icon.jpg"); //image.setPixelSize( 96, 64 ); image.addClickHandler(this); m_maps.put(image, "/puzzles/original/model.bin"); m_panel.add(image); // add FMC map image = new Image("/puzzles/fullmetalconquete/icon.jpg"); //image.setPixelSize( 96, 64 ); image.addClickHandler(this); m_maps.put(image, "/puzzles/fullmetalconquete/model.bin"); m_panel.add(image); // add Madhya map image = new Image("/puzzles/madhya/icon.jpg"); // image.setPixelSize( 96, 64 ); image.addClickHandler(this); m_maps.put(image, "/puzzles/madhya/model.bin"); m_panel.add(image); // add TF22 map image = new Image("/puzzles/tf22/icon.jpg"); // image.setPixelSize( 96, 64 ); image.addClickHandler(this); m_maps.put(image, "/puzzles/tf22/model.bin"); m_panel.add(image); m_panel.add(new HTML("ou ID de la partie:<br/>")); m_panel.add(m_txtCustom); m_panel.add(m_btnCustom); m_panel.add(new HTML("<br/>")); m_panel.add(m_btnCancel); }