本文整理汇总了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;
}
示例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));
}
示例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);
}
}
示例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);
}
示例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);
}