本文整理了Java中com.google.gwt.user.client.Element.getElementsByTagName()
方法的一些代码示例,展示了Element.getElementsByTagName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getElementsByTagName()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getElementsByTagName
暂无
代码示例来源:origin: com.extjs/gxt
/**
* Returns the <TD> HtmlElement which represents the Grid's header cell for
* the specified column index.
*
* @param index the column index
* @return the <TD> element.
*/
public Element getHeaderCell(int index) {
return mainHd.dom.getElementsByTagName("td").getItem(index);
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
public static Element getElementByAttribute(String attr, String value) {
return getElementByAttribute(RootPanel.getBodyElement().getElementsByTagName("*"), attr, value);
}
代码示例来源:origin: GwtMaterialDesign/gwt-material
public static Element getElementByAttribute(String attr, String value) {
return getElementByAttribute(RootPanel.getBodyElement().getElementsByTagName("*"), attr, value);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
protected Element getFileInputElement() {
return getElement().getElementsByTagName("input").getItem(0);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
/**
* Adds iframe covers for all child iframe elements
*
* @param rootElement
* The parent element
* @return A set of elements with the iframe covers
*/
private static Set<Element> addIframeCovers(Element rootElement) {
Set<Element> coveredIframes = new HashSet<Element>();
NodeList<com.google.gwt.dom.client.Element> iframes = rootElement
.getElementsByTagName("iframe");
for (int i = 0; i < iframes.getLength(); i++) {
Element iframe = (Element) iframes.getItem(i);
addIframeCover(iframe);
coveredIframes.add(iframe);
}
return coveredIframes;
}
代码示例来源:origin: org.vaadin.addons/dragdroplayouts
/**
* Adds iframe covers for all child iframe elements
*
* @param rootElement
* The parent element
* @return A set of elements with the iframe covers
*/
private static Set<Element> addIframeCovers(Element rootElement) {
Set<Element> coveredIframes = new HashSet<Element>();
NodeList<com.google.gwt.dom.client.Element> iframes = rootElement
.getElementsByTagName("iframe");
for (int i = 0; i < iframes.getLength(); i++) {
Element iframe = (Element) iframes.getItem(i);
addIframeCover(iframe);
coveredIframes.add(iframe);
}
return coveredIframes;
}
代码示例来源:origin: oVirt/ovirt-engine
public void setCustomStyle(final String customStyle) {
if (customStyle != null) {
getElement().getElementsByTagName("textarea").getItem(0).addClassName(customStyle); //$NON-NLS-1$
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
public void addContentWidgetStyleName(String style) {
if (style != null) {
getElement().getElementsByTagName("textarea").getItem(0).addClassName(style); //$NON-NLS-1$
}
}
}
代码示例来源:origin: org.kuali.student.core/ks-common-ui
private void grabFocus() {
Widget mainContent = contentPanel.getWidget();
NodeList<Element> nodeList = mainContent.getElement().getElementsByTagName("*");
for (int i = 0; i < nodeList.getLength(); i++) {
Element e = nodeList.getItem(i);
if (FOCUSABLE_TAGS.contains(e.getTagName().toUpperCase())) {
e.focus();
return;
}
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
protected void afterRender() {
super.afterRender();
map = new Map(getElement().getElementsByTagName("div").getItem(0), options);
}
代码示例来源:origin: oVirt/ovirt-engine
private void updateItemAvailability(String itemName, boolean isEnabled) {
for (int i = 0; i < bootSequenceBox.getItemCount(); i++) {
if (bootSequenceBox.getItemText(i).equals(itemName)) {
NodeList<Element> options = bootSequenceBox.getElement().getElementsByTagName("option"); //$NON-NLS-1$
if (!isEnabled) {
options.getItem(i).setAttribute("disabled", "disabled"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
options.getItem(i).removeAttribute("disabled"); //$NON-NLS-1$
}
}
}
}
代码示例来源:origin: org.opennms.features/org.opennms.features.gwt-snmpselect-list
@Override
public void onModuleLoad() {
if(Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").equals("opennms-snmpSelectList")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:snmpSelectList");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
Element elem = nodes.getItem(i);
createView(elem);
}
}
}
}
代码示例来源:origin: org.opennms.features/org.opennms.features.gwt-suggestion-combobox
/**
* This is the entry point method.
*/
@Override
public void onModuleLoad() {
if(Window.Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").contains("opennms-nodeSuggestionCombobox")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:nodeSuggestionCombobox");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
createView(nodes.getItem(i));
}
}
}
}
代码示例来源:origin: org.opennms.features/org.opennms.features.gwt-ksc-combobox
/**
* This is the entry point method.
*/
@Override
public void onModuleLoad() {
if(Window.Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").contains("opennms-kscReportCombobox")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:kscReportCombobox");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
createView(nodes.getItem(i));
}
}
}
}
代码示例来源:origin: org.opennms.features/org.opennms.features.node-page-list
/**
* This is the entry point method.
*/
@Override
public void onModuleLoad() {
if(Navigator.getUserAgent().contains("MSIE")) {
NodeList<Element> divs = RootPanel.getBodyElement().getElementsByTagName("div");
for(int j = 0; j < divs.getLength(); j++) {
Element element = divs.getItem(j);
if(element.hasAttribute("name") && element.getAttribute("name").equals("opennms-interfacelist")) {
createView(element);
}
}
}else {
NodeList<Element> nodes = RootPanel.getBodyElement().getElementsByTagName("opennms:interfacelist");
if(nodes.getLength() > 0) {
for(int i = 0; i < nodes.getLength(); i++) {
Element elem = nodes.getItem(i);
createView(elem);
}
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
protected void addRootNode(final TreeItem rootItem, final TreeItem leafItem) {
rootItem.getElement().getStyle().setBackgroundColor("#eff3ff"); //$NON-NLS-1$
rootItem.getElement().getStyle().setMarginBottom(1, Unit.PX);
rootItem.getElement().getStyle().setPadding(0, Unit.PX);
if (leafItem != null) {
rootItem.addItem(leafItem);
// Defer styling in order to override padding done in:
// com.google.gwt.user.client.ui.Tree -> showLeafImage
Scheduler.get().scheduleDeferred(() -> {
leafItem.getElement().getStyle().setBackgroundColor("#ffffff"); //$NON-NLS-1$
leafItem.getElement().getStyle().setMarginLeft(20, Unit.PX);
leafItem.getElement().getStyle().setPadding(0, Unit.PX);
Boolean isLeafEmpty = (Boolean) leafItem.getUserObject();
if (isLeafEmpty != null && isLeafEmpty.equals(Boolean.TRUE)) {
rootItem.getElement().getElementsByTagName("td").getItem(0).getStyle().setVisibility(Visibility.HIDDEN); //$NON-NLS-1$
}
rootItem.getElement().getElementsByTagName("td").getItem(1).getStyle().setWidth(100, Unit.PCT); //$NON-NLS-1$
});
}
tree.addItem(rootItem);
}
代码示例来源:origin: de.knightsoft-net/gwt-mt-widgets
private InputElement getInputElement(final Widget widget) {
if (widget.getElement().hasTagName(InputElement.TAG)) {
return InputElement.as(widget.getElement());
}
final NodeList<Element> l = widget.getElement().getElementsByTagName(InputElement.TAG);
if (l.getLength() > 0) {
return InputElement.as(l.getItem(0));
}
return null;
}
代码示例来源:origin: ManfredTremmel/gwt-bean-validators
private InputElement getInputElement(final Widget widget) {
if (widget.getElement().hasTagName(InputElement.TAG)) {
return InputElement.as(widget.getElement());
}
final NodeList<Element> l = widget.getElement().getElementsByTagName(InputElement.TAG);
if (l.getLength() > 0) {
return InputElement.as(l.getItem(0));
}
return null;
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public boolean execute() {
counter[0]++;
NodeList<Element> buttons = getElement().getElementsByTagName("li");
if (buttons.getLength() > 0) {
Element firstButton = buttons.getItem(0);
Element lastButton = buttons.getItem(buttons.getLength() - 1);
if (firstButton.getAbsoluteTop() != lastButton.getAbsoluteTop()) {
tabCount--;
render();
}
return false;
}
if (counter[0] > 10) { // safe exit
return false;
}
return true;
}
}, 500);
代码示例来源:origin: bedatadriven/activityinfo
@Override
protected void afterRender() {
super.afterRender();
Extents countryBounds = searchPresenter.getCountryBounds();
MapOptions mapOptions = new MapOptions();
mapOptions.setCenter(new LatLng(countryBounds.getCenterY(), countryBounds.getCenterX()));
mapOptions.setZoom(6);
mapOptions.setProperty("crs", new EPSG3857());
TileLayer baseLayer = new TileLayer(MapboxLayers.MAPBOX_STREETS, new Options());
markerLayer = new LayerGroup(new ILayer[0]);
map = new Map(getElement().getElementsByTagName("div").getItem(0), mapOptions);
map.addLayer(baseLayer);
map.addLayer(markerLayer);
bindEvents();
}
内容来源于网络,如有侵权,请联系作者删除!