本文整理了Java中com.google.gwt.dom.client.Element
类的一些代码示例,展示了Element
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element
类的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
[英]All HTML element interfaces derive from this class.
[中]所有HTML元素接口都派生自此类。
代码示例来源:origin: kaaproject/kaa
sdkConfigurationVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER);
sdkConfigurationVersion.setWidth("100%");
detailsTable.getFlexCellFormatter().setHeight(row, 0, "40px");
sdkProfileVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER);
sdkProfileVersion.setWidth("100%");
detailsTable.getFlexCellFormatter().setHeight(row, 0, "40px");
sdkNotificationVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER);
sdkNotificationVersion.setWidth("100%");
detailsTable.getFlexCellFormatter().setHeight(row, 0, "40px");
sdkAefMapsGridLabel.getElement()
.getParentElement()
.getStyle()
.setPropertyPx("paddingBottom", 10);
detailsTable.setWidget(++row, 0, sdkAefMapsGrid);
sdkAefMapsGrid.getElement().getParentElement().getStyle().setPropertyPx("paddingBottom", 10);
detailsTable.getFlexCellFormatter().setColSpan(row, 0, 3);
代码示例来源:origin: libgdx/libgdx
this.root = config.rootPanel;
} else {
Element element = Document.get().getElementById("embed-" + GWT.getModuleName());
if (element == null) {
VerticalPanel panel = new VerticalPanel();
panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
element.appendChild(panel.getElement());
root = panel;
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Add the class name if it doesn't exist or removes it if does.
*
* @param className the class name to be toggled
*/
public final void toggleClassName(String className) {
boolean added = addClassName(className);
if (!added) {
removeClassName(className);
}
}
代码示例来源:origin: kaaproject/kaa
private void setCheckBoxStyle(CheckBox box) {
Element input = box.getElement().getFirstChildElement();
input.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
Element label = input.getNextSiblingElement();
label.getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
label.getStyle().setPaddingLeft(5, Unit.PX);
label.getStyle().setFontSize(13, Unit.PX);
}
代码示例来源:origin: kaaproject/kaa
/**
* Instantiates a new CtlSchemasViewImpl.
*/
public CtlSchemasViewImpl() {
super(true);
if (displayShowHigherLevelScopeCheckBox()) {
showHigherScopeCheckBox = new CheckBox(Utils.constants.displayHigherScopes());
showHigherScopeCheckBox.addStyleName(Utils.kaaAdminStyle.bAppContentTitle());
Element.as(showHigherScopeCheckBox.getElement().getChild(0))
.getStyle().setMarginRight(10, Unit.PX);
showHigherScopeCheckBox.setValue(defaultShowHigherLevelScopes());
appendToolbarWidget(showHigherScopeCheckBox);
}
}
代码示例来源:origin: kaaproject/kaa
template = GWT.create(Template.class);
String definedStyles = getElement().getAttribute("style");
getElement().setAttribute("style",
definedStyles + "; vertical-align:middle;");
Element textElement = DOM.createElement("span");
textElement.setInnerText(text + " ");
DOM.insertChild(getElement(), textElement, 0);
Element caretSpan = DOM.createElement("span");
caretSpan.setClassName(Utils.kaaAdminStyle.caret());
DOM.appendChild(getElement(), caretSpan);
代码示例来源:origin: com.google.gwt/gwt-servlet
public CustomScrollPanel(Resources resources) {
super(DOM.createDiv(), DOM.createDiv(), DOM.createDiv());
containerElem.setClassName(CommonResources.getInlineBlockStyle());
scrollable.getStyle().setOverflow(Overflow.SCROLL);
scrollable.appendChild(containerElem);
scrollableLayer = layout.attachChild(scrollable);
getElement().getStyle().setOverflow(Overflow.HIDDEN);
cornerElem = Document.get().createDivElement();
cornerElem.addClassName(style.customScrollPanelCorner());
cornerLayer = layout.attachChild(cornerElem);
代码示例来源:origin: kaaproject/kaa
schemaNamePanel.add(endpointProfSchemaName);
schemaNamePanel.setCellWidth(endpointProfSchemaName, "200px");
endpointProfSchemaName.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);
schemaButtonsPanel.add(downloadEndpointProfileJsonButton);
schemaNamePanel.add(schemaButtonsPanel);
schemaButtonsPanel.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);
formPanel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
schemaNamePanel.add(serverProfSchemaName);
schemaNamePanel.setCellWidth(serverProfSchemaName, "200px");
serverProfSchemaName.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);
schemaButtonsPanel.add(editServerProfileButton);
schemaNamePanel.add(schemaButtonsPanel);
schemaButtonsPanel.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);
serverFormPanel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
schemaButtonsPanel.getElement().getParentElement().getStyle().setPaddingLeft(10, Unit.PX);
schemaNamePanel.setSpacing(6);
serverFormPanel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
Label groupsLabel = new Label(Utils.constants.endpointGroups());
detailsTable.setWidget(++row, 0, groupsLabel);
groupsLabel.getElement().getParentElement().getStyle().setPaddingBottom(10, Unit.PX);
detailsTable.setWidget(++row, 0, groupsGrid);
代码示例来源:origin: com.google.gwt/gwt-servlet
tableHeaderScroller = tableHeaderContainer.getElement().getParentElement();
headerPanel.setFooterWidget(tableFooterContainer);
tableFooterScroller = tableFooterContainer.getElement().getParentElement();
tableHeaderScroller.getStyle().setOverflow(Overflow.HIDDEN);
tableFooterScroller.getStyle().setOverflow(Overflow.HIDDEN);
if (tableData.tableElem.getTBodies().getLength() > 0) {
tableData.section = tableData.tableElem.getTBodies().getItem(0);
} else {
tableData.section = Document.get().createTBodyElement();
tableData.tableElem.appendChild(tableData.section);
tableDataScroller.setHeight("100%");
headerPanel.setContentWidget(tableDataScroller);
tableDataContainer = tableData.getElement().getParentElement();
tableDataContainer.getStyle().setDisplay(Display.BLOCK);
代码示例来源:origin: com.google.gwt/gwt-servlet
private Element createContainer() {
Element container = Document.get().createDivElement().cast();
container.getStyle().setPosition(Position.ABSOLUTE);
container.getStyle().setDisplay(Display.NONE);
container.getStyle().setLeft(0.0, Unit.PX);
container.getStyle().setWidth(100.0, Unit.PCT);
return container;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* When enabled, the background will be blocked with a semi-transparent pane
* the next time it is shown. If the PopupPanel is already visible, the glass
* will not be displayed until it is hidden and shown again.
*
* @param enabled true to enable, false to disable
*/
public void setGlassEnabled(boolean enabled) {
this.isGlassEnabled = enabled;
if (enabled && glass == null) {
glass = Document.get().createDivElement();
glass.setClassName(glassStyleName);
glass.getStyle().setPosition(Position.ABSOLUTE);
glass.getStyle().setLeft(0, Unit.PX);
glass.getStyle().setTop(0, Unit.PX);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private void init(ImageAdapter images, boolean useLeafImages) {
setImages(images, useLeafImages);
setElement(DOM.createDiv());
getElement().getStyle().setProperty("position", "relative");
// Fix rendering problem with relatively-positioned elements and their
// children by
// forcing the element that is positioned relatively to 'have layout'
getElement().getStyle().setProperty("zoom", "1");
focusable = FocusPanel.impl.createFocusable();
focusable.getStyle().setProperty("fontSize", "0");
focusable.getStyle().setProperty("position", "absolute");
// Hide focus outline in Mozilla/Webkit
focusable.getStyle().setProperty("outline", "0px");
// Hide focus outline in IE 6/7
focusable.setAttribute("hideFocus", "true");
DOM.setIntStyleAttribute(focusable, "zIndex", -1);
DOM.appendChild(getElement(), focusable);
sinkEvents(Event.ONMOUSEDOWN | Event.ONCLICK | Event.KEYEVENTS);
DOM.sinkEvents(focusable, Event.FOCUSEVENTS);
// The 'root' item is invisible and serves only as a container
// for all top-level items.
root = new TreeItem(true);
root.setTree(this);
setStyleName("gwt-Tree");
// Add a11y role "tree"
Roles.getTreeRole().set(focusable);
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Ensure that the animation frame exists and return it.
*
* @return the animation frame
*/
Element ensureAnimationFrame() {
if (animationFrame == null) {
animationFrame = Document.get().createDivElement();
animationFrame.getStyle().setOverflow(Overflow.HIDDEN);
animationFrame.getStyle().setDisplay(Display.NONE);
getElement().appendChild(animationFrame);
}
return animationFrame;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public void onResize(ResizeEvent event) {
Style style = glass.getStyle();
int winWidth = Window.getClientWidth();
int winHeight = Window.getClientHeight();
// Hide the glass while checking the document size. Otherwise it would
// interfere with the measurement.
style.setDisplay(Display.NONE);
style.setWidth(0, Unit.PX);
style.setHeight(0, Unit.PX);
int width = Document.get().getScrollWidth();
int height = Document.get().getScrollHeight();
// Set the glass size to the larger of the window's client size or the
// document's scroll size.
style.setWidth(Math.max(width, winWidth), Unit.PX);
style.setHeight(Math.max(height, winHeight), Unit.PX);
// The size is set. Show the glass again.
style.setDisplay(Display.BLOCK);
}
};
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void clearTraces() {
Style style = textWidget.getElement().getStyle();
style.clearLeft();
style.clearTop();
style.clearPosition();
style.clearZIndex();
stretchControl.getStyle().clearTop();
stretchControl.getStyle().clearLeft();
stretchControl.getStyle().clearDisplay();
JQueryWrapper.select("." + STRETCHER_BASE).setCss("display", "");
}
代码示例来源:origin: com.google.gwt/gwt-servlet
focusableWidget.setFocus(true);
if (scrollOnSelectEnabled) {
((Widget) focusableWidget).getElement().scrollIntoView();
int containerTop = getAbsoluteTop();
int left = selectedElem.getAbsoluteLeft() - containerLeft;
int top = selectedElem.getAbsoluteTop() - containerTop;
int width = selectedElem.getPropertyInt("offsetWidth");
int height = selectedElem.getPropertyInt("offsetHeight");
DOM.setIntStyleAttribute(focusable, "left", 0);
DOM.setIntStyleAttribute(focusable, "top", 0);
return;
focusable.getStyle().setProperty("left", left + "px");
focusable.getStyle().setProperty("top", top + "px");
focusable.getStyle().setProperty("width", width + "px");
focusable.getStyle().setProperty("height", height + "px");
focusable.scrollIntoView();
代码示例来源:origin: fr.lteconsulting/hexa.core
public void addFull(Widget widget)
{
panel.add( widget );
widget.setWidth( "100%" );
widget.setHeight( "100%" );
widget.getElement().getParentElement().getParentElement().getStyle().setHeight( 100, Unit.PCT );
}
代码示例来源:origin: com.google.gwt/gwt-servlet
public Element attachChild(Element parent, Element child, Element before) {
DivElement container = Document.get().createDivElement();
container.appendChild(child);
container.getStyle().setPosition(Position.ABSOLUTE);
container.getStyle().setOverflow(Overflow.HIDDEN);
fillParent(child);
Element beforeContainer = null;
if (before != null) {
beforeContainer = before.getParentElement();
assert beforeContainer.getParentElement()
== parent : "Element to insert before must be a sibling";
}
parent.insertBefore(container, beforeContainer);
return container;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
newWidget.removeFromParent();
contentElem.removeChild(widget.getElement());
widget = null;
contentElem.setInnerHTML("");
DOM.appendChild(contentElem, newWidget.getElement());
if (Tree.shouldTreeDelegateFocusToElement(widget.getElement())) {
widget.getElement().setAttribute("tabIndex", "-1");
代码示例来源:origin: com.extjs/gxt
private void updateGroupWidths() {
if (!enableGrouping || ds.getCount() < 1) {
return;
}
String tw = Math.max(cm.getTotalWidth(), el.dom.getOffsetWidth() - getScrollAdjust()) + "px";
NodeList<Element> gs = getGroups();
for (int i = 0, len = gs.getLength(); i < len; i++) {
Element e = gs.getItem(i).getFirstChild().cast();
e.getStyle().setProperty("width", tw);
}
}
内容来源于网络,如有侵权,请联系作者删除!