本文整理了Java中com.google.gwt.user.client.Element.getTagName()
方法的一些代码示例,展示了Element.getTagName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getTagName()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:getTagName
暂无
代码示例来源:origin: com.extjs/gxt
protected boolean isInput(Element target) {
String tag = target.getTagName();
return "input".equalsIgnoreCase(tag) || "textarea".equalsIgnoreCase(tag);
}
代码示例来源:origin: com.extjs/gxt
protected boolean isInput(Element target) {
String tag = target.getTagName();
return "INPUT".equals(tag) || "TEXTAREA".equals(tag);
}
代码示例来源:origin: com.extjs/gxt
protected boolean isMenuTriggerOver(ComponentEvent ce) {
return menu != null && ce.getTarget().getTagName().equalsIgnoreCase("EM");
}
代码示例来源:origin: com.extjs/gxt
protected boolean isMenuTriggerOut(ComponentEvent ce) {
return menu != null && !ce.getTarget().getTagName().equalsIgnoreCase("EM");
}
代码示例来源:origin: com.extjs/gxt
private final void removeChildren(Element parent) {
Element child = null;
while ((child = parent.getFirstChildElement().cast()) != null) {
parent.removeChild(child);
}
String tag = parent.getTagName().toLowerCase();
if (!tag.equals("table") && !tag.equals("tbody") && !tag.equals("tr") && !tag.equals("td")) {
parent.setInnerHTML("");
}
}
}
代码示例来源:origin: com.extjs/gxt
/**
* Returns true if the passed element has a border box.
*
* @param element the element to test
* @return true if the passed element has a border box
*/
public static boolean isBorderBox(Element element) {
assert element != null : "Element may not be null";
String tag = element.getTagName().toLowerCase();
Boolean r = borderBoxMap.get(tag);
if (r == null) {
Element testElement = (Element) Document.get().createElement(tag);
testElement.getStyle().setPropertyPx("padding", 1);
testElement.getStyle().setPropertyPx("width", 100);
testElement.getStyle().setProperty("visibility", "hidden");
testElement.getStyle().setProperty("position", "absolute");
XDOM.getBody().appendChild(testElement);
r = testElement.getOffsetWidth() == 100;
XDOM.getBody().removeChild(testElement);
borderBoxMap.put(tag, r);
}
return r;
}
代码示例来源:origin: com.googlecode.gwtupload/jsupload
/**
* adds a javascript DOM element to the upload form at the specified position
*/
public void addElement(Element e, int index) {
Widget w = null;
if (e.getTagName().toLowerCase().equals("input") && e.getAttribute("type").toLowerCase().equals("hidden")) {
if (! Document.get().getBody().isOrHasChild(e)) {
Document.get().getBody().appendChild(e);
}
w = Hidden.wrap(e);
} else {
w = new HTML();
DOM.appendChild(w.getElement(), e);
}
uploader.add(w, index);
}
代码示例来源:origin: com.extjs/gxt
protected void onMouseDown(GridEvent<M> e) {
if (isDisableTextSelection() && GXT.isWebKit) {
String tagName = e.getEvent().getEventTarget().<Element> cast().getTagName();
if (!"input".equalsIgnoreCase(tagName) && !"textarea".equalsIgnoreCase(tagName)) {
e.preventDefault();
}
}
if (e.getRowIndex() != -1) {
fireEvent(Events.RowMouseDown, e);
if (e.getColIndex() != -1) {
fireEvent(Events.CellMouseDown, e);
}
}
}
代码示例来源:origin: net.sf.advanced-gwt/advanced-gwt
/**
* Searches for the td element strting from the clicked element to upper levels of the DOM tree.
*
* @param clickElement is an element that is clicked.
* @return a found element or <code>null</code> if the clicked element is not the td tag and not nested
* into any td.
*/
protected Element getCellElement(Element clickElement) {
while (clickElement != null && !"td".equalsIgnoreCase(clickElement.getTagName()))
clickElement = DOM.getParent(clickElement);
if (clickElement == null)
return null;
Element tr = DOM.getParent(clickElement);
Element tbody = DOM.getParent(tr);
Element table = DOM.getParent(tbody);
if (getElement().equals(table))
return clickElement;
else
return getCellElement(table);
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
public void testStructure() {
MaterialSignaturePad signaturePad = getWidget();
assertEquals("CANVAS", signaturePad.getElement().getTagName());
}
代码示例来源:origin: org.jboss.errai/errai-ui
+ field.getClass().getName() + " [" + field.getElement() + "]");
if (!element.getTagName().equals(field.getElement().getTagName())) {
logger.warning("Replacing Element type [" + element.getTagName() + "] in " + templateFile + " with type ["
+ field.getElement().getTagName() + "] for " + fieldName + " in " + componentType);
代码示例来源:origin: com.extjs/gxt
if (node instanceof Element) {
Element child = (Element) node;
String tag = child.getTagName();
if (tag != null && child.getTagName().equalsIgnoreCase("link")) {
String href = child.getAttribute("href");
if (href.length() != 0 && href.indexOf("gxt-all.css") != -1) {
代码示例来源:origin: com.extjs/gxt
protected void onClick(ComponentEvent ce) {
if (isClickToChange() && ce.getTarget() != thumb.el().dom) {
if (vertical) {
setValue(reverseValue(ce.getClientY() - innerEl.getTop(false)));
} else {
setValue(reverseValue(ce.getClientX() - innerEl.getLeft(false)));
}
}
if (!ce.getTarget().getTagName().equals("INPUT")) {
focus();
}
}
代码示例来源:origin: GwtMaterialDesign/gwt-material
@Override
public void add(final Widget child) {
String tagName = child.getElement().getTagName();
if (child instanceof ListItem || tagName.toLowerCase().startsWith("li")) {
child.getElement().getStyle().setDisplay(Style.Display.BLOCK);
add(child, (Element) getElement());
} else {
ListItem li = new ListItem(child);
// Checks if there are sub dropdown components
if (child instanceof MaterialLink) {
MaterialLink link = (MaterialLink) child;
handlers.add(link.addClickHandler(event -> SelectionEvent.fire(MaterialDropDown.this, child)));
for (int i = 0; i < link.getWidgetCount(); i++) {
if (link.getWidget(i) instanceof MaterialDropDown) {
registerHandler(link.addClickHandler(DomEvent::stopPropagation));
link.stopTouchStartEvent();
}
}
}
if (child instanceof HasWaves) {
li.setWaves(((HasWaves) child).getWaves());
((HasWaves) child).setWaves(null);
}
li.getElement().getStyle().setDisplay(Style.Display.BLOCK);
add(li, (Element) getElement());
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
public void testStructure() {
MaterialLiveStamp liveStamp = getWidget();
assertTrue(liveStamp instanceof AbstractValueWidget);
assertEquals("SPAN", liveStamp.getElement().getTagName());
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material
@Override
public void add(final Widget child) {
String tagName = child.getElement().getTagName();
if (child instanceof ListItem || tagName.toLowerCase().startsWith("li")) {
child.getElement().getStyle().setDisplay(Style.Display.BLOCK);
add(child, (Element) getElement());
} else {
ListItem li = new ListItem(child);
// Checks if there are sub dropdown components
if (child instanceof MaterialLink) {
MaterialLink link = (MaterialLink) child;
handlers.add(link.addClickHandler(event -> SelectionEvent.fire(MaterialDropDown.this, child)));
for (int i = 0; i < link.getWidgetCount(); i++) {
if (link.getWidget(i) instanceof MaterialDropDown) {
registerHandler(link.addClickHandler(DomEvent::stopPropagation));
link.stopTouchStartEvent();
}
}
}
if (child instanceof HasWaves) {
li.setWaves(((HasWaves) child).getWaves());
((HasWaves) child).setWaves(null);
}
li.getElement().getStyle().setDisplay(Style.Display.BLOCK);
add(li, (Element) getElement());
}
}
代码示例来源:origin: com.extjs/gxt
public void onPreviewNativeEvent(NativePreviewEvent event) {
if (Element.is(event.getNativeEvent().getEventTarget())) {
Element target = (Element) Element.as(event.getNativeEvent().getEventTarget());
String tag = target.getTagName();
// ignore html and body because of frames
if (!resizing && !dragging && !tag.equalsIgnoreCase("html") && !tag.equalsIgnoreCase("body")
&& event.getTypeInt() != Event.ONLOAD && manager.getActive() == Window.this
&& (modalPanel == null || (modalPanel != null && !modalPanel.getElement().isOrHasChild(target)))
&& !Window.this.getElement().isOrHasChild(target) && fly(target).findParent(".x-ignore", -1) == null) {
ArrayList<Component> col = new ArrayList<Component>(ComponentManager.get().getAll());
for (Component c : col) {
if (c instanceof TriggerField<?>) {
triggerBlur((TriggerField<?>) c);
} else if (c instanceof Menu) {
((Menu) c).hide(true);
}
}
Window.this.focus();
}
}
}
代码示例来源:origin: com.extjs/gxt
if ((!"input".equalsIgnoreCase(ce.getTarget().getTagName()) && !"textarea".equalsIgnoreCase(ce.getTarget().getTagName()))
|| ce.getTarget().getPropertyBoolean("disabled")) {
ce.preventDefault();
代码示例来源:origin: com.extjs/gxt
@Override
protected void onRender(Element target, int index) {
El wrap = new El(DOM.createDiv());
wrap.addStyleName("x-form-field-wrap");
wrap.addStyleName("x-form-file-wrap");
input = new El(DOM.createInputText());
input.addStyleName(fieldStyle);
input.addStyleName("x-form-file-text");
input.setId(XDOM.getUniqueId());
if (GXT.isAriaEnabled()) {
input.setTitle("File upload field");
}
if (GXT.isIE && target.getTagName().equals("TD")) {
input.setStyleAttribute("position", "static");
}
wrap.appendChild(input.dom);
setElement(wrap.dom, target, index);
button = new Button(getMessages().getBrowseText());
button.getFocusSupport().setIgnore(true);
button.addStyleName("x-form-file-btn");
button.setIcon(buttonIcon);
button.render(wrap.dom);
createFileInput();
super.onRender(target, index);
super.setReadOnly(true);
}
代码示例来源:origin: com.extjs/gxt
eventTarget = (Element) event.getEventTarget().cast();
if ("input".equalsIgnoreCase(getElement().getTagName()) || eventTarget.getPropertyString("__eventBits") == null) {
focus();
内容来源于网络,如有侵权,请联系作者删除!