本文整理了Java中com.google.gwt.dom.client.Element.setPropertyString()
方法的一些代码示例,展示了Element.setPropertyString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.setPropertyString()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:setPropertyString
[英]Sets a property on this element.
[中]设置此元素的属性。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the elements css class name.
*
* @param elem the element
* @param className the class name
*/
static final void setClassname(final Element elem, final String className) {
elem.setPropertyString("className", className);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void onDetach() {
panel.container.setPropertyString("onresize", null);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the width of the table's border. This border is displayed around all
* cells in the table.
*
* @param width the width of the border, in pixels
*/
public void setBorderWidth(int width) {
tableElem.setPropertyString("border", "" + width);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the width of the border to be applied to all cells in this panel. This
* is particularly useful when debugging layouts, in that it allows you to see
* explicitly the cells that contain this panel's children.
*
* @param width the width of the panel's cell borders, in pixels
*/
public void setBorderWidth(int width) {
table.setPropertyString("border", "" + width);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setText(String text) {
elem.setPropertyString("value", text);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets a property on the given element.
*
* @param elem the element whose property is to be set
* @param prop the name of the property to be set
* @param value the new property value
* @deprecated Use {@link Element#setPropertyString(String, String)} instead.
*/
@Deprecated
public static void setElementProperty(Element elem, String prop, String value) {
elem.setPropertyString(prop, value);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets a property on the given element.
*
* @param elem the element whose property is to be set
* @param attr the name of the property to be set
* @param value the new property value
* @deprecated Use the more appropriately named
* {@link Element#setPropertyString(String, String)} instead.
*/
@Deprecated
public static void setAttribute(Element elem, String attr, String value) {
elem.setPropertyString(attr, value);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the width of the specified column.
*
* @param column the column of the cell whose width is to be set
* @param width the cell's new width, in percentage or pixel units
* @throws IndexOutOfBoundsException
*/
public void setWidth(int column, String width) {
ensureColumn(column).setPropertyString("width", width);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public Element createElement() {
Element elem = super.createElement();
elem.setPropertyString("src", "about:blank");
return elem;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the height of the cell associated with the given widget, related to
* the panel as a whole.
*
* @param w the widget whose cell height is to be set
* @param height the cell's height, in CSS units
*/
public void setCellHeight(Widget w, String height) {
Element td = getWidgetTd(w);
if (td != null) {
td.setPropertyString("height", height);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void setHTML(@IsSafeHtml String html) {
elem.setPropertyString("value", html);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the width of the cell associated with the given widget, related to the
* panel as a whole.
*
* @param w the widget whose cell width is to be set
* @param width the cell's width, in CSS units
*/
public void setCellWidth(Widget w, String width) {
Element td = getWidgetTd(w);
if (td != null) {
td.setPropertyString("width", width);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the height of the specified cell.
*
* @param row the row of the cell whose height is to be set
* @param column the column of the cell whose height is to be set
* @param height the cell's new height, in CSS units
* @throws IndexOutOfBoundsException
*/
public void setHeight(int row, int column, String height) {
prepareCell(row, column);
Element elem = getCellElement(bodyElem, row, column);
elem.setPropertyString("height", height);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the width of the specified cell.
*
* @param row the row of the cell whose width is to be set
* @param column the column of the cell whose width is to be set
* @param width the cell's new width, in CSS units
* @throws IndexOutOfBoundsException
*/
public void setWidth(int row, int column, String width) {
// Give the subclass a chance to prepare the cell.
prepareCell(row, column);
getCellElement(bodyElem, row, column).setPropertyString("width", width);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the history token referenced by this hyperlink. This is the history
* token that will be passed to {@link History#newItem} when this link is
* clicked.
*
* @param targetHistoryToken the new history token, which may not be null (use
* {@link Anchor} instead if you don't need history processing)
*/
@SuppressIsSafeUriCastCheck //TODO(bangert): Refactor setPropertyString
public void setTargetHistoryToken(String targetHistoryToken) {
assert targetHistoryToken != null
: "targetHistoryToken must not be null, consider using Anchor instead";
this.targetHistoryToken = targetHistoryToken;
String hash = History.encodeHistoryToken(targetHistoryToken);
anchorElem.setPropertyString("href", "#" + hash);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Sets the horizontal alignment of the specified cell.
*
* @param row the row of the cell whose alignment is to be set
* @param column the column of the cell whose alignment is to be set
* @param align the cell's new horizontal alignment as specified in
* {@link HasHorizontalAlignment}.
* @throws IndexOutOfBoundsException
*/
public void setHorizontalAlignment(int row, int column,
HorizontalAlignmentConstant align) {
prepareCell(row, column);
Element elem = getCellElement(bodyElem, row, column);
elem.setPropertyString("align", align.getTextAlignString());
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void ensureDebugId(Element elem, String baseID, String id) {
assert baseID != null;
baseID = (baseID.length() > 0) ? baseID + "-" : "";
String prefix = DebugInfo.getDebugIdPrefix();
String debugId = ((prefix == null) ? "" : prefix) + baseID + id;
String attribute = DebugInfo.getDebugIdAttribute();
if (DebugInfo.isDebugIdAsProperty()) {
elem.setPropertyString(attribute, debugId);
} else {
elem.setAttribute(attribute, debugId);
}
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private static void dispatchUnhandledEvent(Event evt) {
Element element = evt.getCurrentEventTarget().cast();
element.setPropertyString("__gwtLastUnhandledEvent", evt.getType());
dispatchEvent(evt);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@SuppressIsSafeUriCastCheck //TODO(bangert): refactor away setproperty.
private ClickableHeader() {
// Anchor is used to allow keyboard access.
super(DOM.createAnchor());
Element elem = getElement();
elem.setPropertyString("href", "javascript:void(0);");
// Avoids layout problems from having blocks in inlines.
elem.getStyle().setProperty("display", "block");
sinkEvents(Event.ONCLICK);
setStyleName(STYLENAME_HEADER);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private DefaultHeader(Imager imager, String text) {
this.imager = imager;
iconImage = imager.makeImage();
// I do not need any Widgets here, just a DOM structure.
Element root = DOM.createTable();
Element tbody = DOM.createTBody();
Element tr = DOM.createTR();
final Element imageTD = DOM.createTD();
labelTD = DOM.createTD();
setElement(root);
DOM.appendChild(root, tbody);
DOM.appendChild(tbody, tr);
DOM.appendChild(tr, imageTD);
DOM.appendChild(tr, labelTD);
// set image TD to be same width as image.
imageTD.setPropertyString("align", "center");
imageTD.setPropertyString("valign", "middle");
imageTD.getStyle().setProperty("width", iconImage.getWidth() + "px");
DOM.appendChild(imageTD, iconImage.getElement());
setText(text);
addOpenHandler(this);
addCloseHandler(this);
setStyle();
}
内容来源于网络,如有侵权,请联系作者删除!