當前位置: 首頁>>代碼示例>>Java>>正文


Java HTML.setWordWrap方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.HTML.setWordWrap方法的典型用法代碼示例。如果您正苦於以下問題:Java HTML.setWordWrap方法的具體用法?Java HTML.setWordWrap怎麽用?Java HTML.setWordWrap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.HTML的用法示例。


在下文中一共展示了HTML.setWordWrap方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createAdditionalInfoWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private Widget createAdditionalInfoWidget() {
  String documentation = completionItem.getItem().getDocumentation();
  if (documentation == null || documentation.trim().isEmpty()) {
    documentation = "No documentation found.";
  }

  HTML widget = new HTML(documentation);
  widget.setWordWrap(true);
  widget.getElement().getStyle().setColor(theme.completionPopupItemTextColor());
  widget.getElement().getStyle().setFontSize(13, Style.Unit.PX);
  widget.getElement().getStyle().setMarginLeft(4, Style.Unit.PX);
  widget.getElement().getStyle().setOverflow(Overflow.AUTO);
  widget.getElement().getStyle().setProperty("userSelect", "text");
  widget.setHeight("100%");
  return widget;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:17,代碼來源:CompletionItemBasedCompletionProposal.java

示例2: CmdButton

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public CmdButton(String name, Widget icon, Command cmd, String label, String desc) {
    this.name = name;
    this.command = cmd;
    this.name = name;
    String htmlstr = label == null ? name : label;
    html = new HTML(htmlstr);
    if (desc != null) {
        html.setTitle(desc);
    }
    this.command = cmd;
    html.setWordWrap(false);
    if (command instanceof GeneralCommand) {
        addListeners();
        setButtonEnabled(((GeneralCommand)command).isEnabled());
    }

    GwtUtil.setStyles(iconHolderLeft, "padding", "none", "marginRight", "3px");
    GwtUtil.setStyle(html, "padding", "6px 0");
    container = GwtUtil.makeHoriPanel(null, null, iconHolderLeft, html, iconHolderRight);
    container.setCellVerticalAlignment(iconHolderLeft, VerticalPanel.ALIGN_MIDDLE);
    container.setCellVerticalAlignment(iconHolderRight, VerticalPanel.ALIGN_MIDDLE);
    setIconLeft(icon);
    setIconRight(null);
    GwtUtil.setStyle(container, "margin", "0px auto");
    initWidget(new SimplePanel(container));
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:27,代碼來源:Toolbar.java

示例3: NewURIFieldWidget

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public NewURIFieldWidget(AttributeValue v) {
	super(v.getLabel());
	this.value = v;
	if (value.getCtrl().isReadonly()) {
		HTML html = new HTML();
		if (!this.value.isNullValue()) {
			html.setHTML("<a href='javascript:;'>" + this.value.getStringValue() +"</a>");
		}
		html.addClickListener(new ClickListener() {

			public void onClick(Widget sender) {
				Window.open(value.getStringValue(), "_blank", "");
				
			}
			
		});
		
		html.setWordWrap(true);
		html.setTitle(this.value.getStringValue());
		addField(html);
		html.setStyleName("mdv-form-input-readonly");			
		setRequired(false);
		
	} else {
		box = new TextBox();
		box.setText(value.getStringValue());
		box.addKeyboardListener(this);
		setRequired(value.getCtrl().isRequiered());
		addField(box);
	}
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:33,代碼來源:NewURIFieldWidget.java

示例4: BarcodeDialogBox

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
BarcodeDialogBox(String projectName, String appInstallUrl) {
      super(false, true);
      setStylePrimaryName("ode-DialogBox");
      setText(MESSAGES.barcodeTitle(projectName));

      ClickHandler buttonHandler = new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          hide();
        }
      };

      Button cancelButton = new Button(MESSAGES.cancelButton());
      cancelButton.addClickHandler(buttonHandler);
      Button okButton = new Button(MESSAGES.okButton());
      okButton.addClickHandler(buttonHandler);
      HTML barcodeQrcode = new HTML("<center>" + BlocklyPanel.getQRCode(appInstallUrl) + "</center>");
      HorizontalPanel buttonPanel = new HorizontalPanel();
      buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
      HTML warningLabel = new HTML(MESSAGES.barcodeWarning(
          "<a href=\"" + "http://appinventor.mit.edu/explore/ai2/share.html" +
          "\" target=\"_blank\">",
          "</a>"));
      warningLabel.setWordWrap(true);
      warningLabel.setWidth("200px");  // set width to get the text to wrap
      HorizontalPanel warningPanel = new HorizontalPanel();
      warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
      warningPanel.add(warningLabel);

      // The cancel button is removed from the panel since it has no meaning in this
      // context.  But the logic is still here in case we want to restore it, and as
      // an example of how to code this stuff in GWT.
      // buttonPanel.add(cancelButton);
      buttonPanel.add(okButton);
      buttonPanel.setSize("100%", "24px");
      VerticalPanel contentPanel = new VerticalPanel();
      contentPanel.add(barcodeQrcode);
      contentPanel.add(buttonPanel);
      contentPanel.add(warningPanel);
//      contentPanel.setSize("320px", "100%");
      add(contentPanel);
    }
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:43,代碼來源:ShowBarcodeCommand.java

示例5: ProgressBarDialogBox

import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public ProgressBarDialogBox(String serviceName, ProjectNode projectNode) {
  super(false, true);
  this.serviceName = serviceName;
  setStylePrimaryName("ode-DialogBox");
  setText(projectNode.getName() + " " + MESSAGES.ProgressBarFor());

  //click handler for the mini html buttons
  ClickHandler buttonHandler = new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      hide();
      progressBarShow++;
    }
  };

  //declare the ok button
  dismissButton.addClickHandler(buttonHandler);
  HorizontalPanel buttonPanel = new HorizontalPanel();
  buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  dismissButton.setVisible(false); // we don't need the button unless we get an error

  //warning label
  warningLabel = new HTML("");
  warningLabel.setWordWrap(true);
  warningLabel.setWidth("60em");  // set width to get the text to wrap

  //warning panel
  HorizontalPanel warningPanel = new HorizontalPanel();
  warningPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
  warningPanel.add(warningLabel);

  // button panel
  buttonPanel.add(dismissButton);
  buttonPanel.setSize("100%", "24px");

  //content panel
  VerticalPanel contentPanel = new VerticalPanel();
  contentPanel.add(mpb);
  contentPanel.add(warningPanel);
  contentPanel.add(buttonPanel);
  setWidget(contentPanel);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:43,代碼來源:ProgressBarDialogBox.java


注:本文中的com.google.gwt.user.client.ui.HTML.setWordWrap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。