当前位置: 首页>>代码示例>>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;未经允许,请勿转载。