本文整理了Java中com.google.gwt.user.client.Element.as()
方法的一些代码示例,展示了Element.as()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.as()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:as
暂无
代码示例来源:origin: org.jboss.ballroom/widgets
public void onMouseDown(MouseDownEvent event) {
EventTarget target = event.getNativeEvent().getEventTarget();
com.google.gwt.dom.client.Element el = Element.as(target);
final String title = el.getInnerText();
if(el.getTagName().equalsIgnoreCase("div"))
{
applyStateChange(new StateChange()
{
public void applyTo(TreeItem treeItem) {
boolean isMatched = title.equals(treeItem.getText());
if(isMatched)
{
treeItem.setState(!treeItem.getState());
}
}
});
}
}
});
代码示例来源:origin: com.extjs/gxt
protected void onMouseOut(ComponentEvent ce) {
EventTarget eT = ce.getEvent().getRelatedEventTarget();
if ((eT == null || (Element.is(eT) && findItem((Element) Element.as(eT)) == null)) && active != null && !active.expanded) {
onDeactivate(active);
}
}
代码示例来源:origin: com.vaadin.addon/vaadin-touchkit-agpl
private Element createContainerElement() {
DivElement el = Document.get().createDivElement();
el.setClassName(CONTAINER_CLASSNAME);
moveAside(Element.as(el));
wrapper.appendChild(el);
return el.cast();
}
代码示例来源:origin: com.extjs/gxt
/**
* Returns <code>true</code> if the target of this event equals or is a child
* of the given element.
*
* @param element the element
* @param toElement true to use {@link Event#getRelatedEventTarget()}
* @return the within state
*/
public boolean within(Element element, boolean toElement) {
if (event != null && Element.is(element)) {
EventTarget target = toElement ? event.getRelatedEventTarget() : event.getEventTarget();
if (Element.is(target)) {
return DOM.isOrHasChild(element, (Element) Element.as(target));
}
}
return false;
}
}
代码示例来源:origin: com.extjs/gxt
protected void onMouseOut(ComponentEvent ce) {
EventTarget to = ce.getEvent().getRelatedEventTarget();
if (activeItem != null
&& (to == null || (Element.is(to) && !DOM.isOrHasChild(activeItem.getElement(), (Element) Element.as(to))))
&& activeItem.shouldDeactivate(ce)) {
deactiveActiveItem();
}
}
代码示例来源:origin: com.extjs/gxt
@Override
protected void onTargetOut(ComponentEvent ce) {
EventTarget to = ce.getEvent().getRelatedEventTarget();
if (to == null
|| (Element.is(target.getElement()) && Element.is(to) && !DOM.isOrHasChild(target.getElement(),
(Element) Element.as(to)))) {
super.onTargetOut(ce);
}
}
代码示例来源:origin: com.extjs/gxt
@Override
public void onBrowserEvent(Event event) {
if (disabled && event.getTypeInt() == Event.ONCLICK && Element.is(event.getEventTarget())
&& fly((Element) Element.as(event.getEventTarget())).is(checkBoxSelector)) {
event.preventDefault();
}
super.onBrowserEvent(event);
}
代码示例来源:origin: com.extjs/gxt
protected void onMouseOver(ComponentEvent ce) {
EventTarget from = ce.getEvent().getRelatedEventTarget();
if (from == null || (Element.is(from) && !DOM.isOrHasChild(getElement(), (Element) Element.as(from)))) {
Component c = findItem(ce.getTarget());
if (c != null && c instanceof Item) {
Item item = (Item) c;
if (activeItem != item && item.canActivate && item.isEnabled()) {
setActiveItem(item, true);
}
}
}
}
代码示例来源: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: net.sf.advanced-gwt/advanced-gwt
/** See class docs */
@Override
public void onPreviewNativeEvent(Event.NativePreviewEvent nativePreviewEvent) {
if (nativePreviewEvent.getTypeInt() != Event.ONCLICK) {
return;
}
Element source = (Element) Element.as(nativePreviewEvent.getNativeEvent().getEventTarget());
if (!DOM.isOrHasChild(getElement(), source)
&& !DOM.isOrHasChild(getComboBox().getElement(), source)) {
hide();
getComboBox().getChoiceButton().setDown(false);
}
}
}
代码示例来源:origin: com.extjs/gxt
EventTarget from = be.getEvent().getRelatedEventTarget();
if (from == null
|| (Element.is(source) && Element.is(from) && !DOM.isOrHasChild(source, (Element) Element.as(from)))) {
onTargetOver(be);
EventTarget to = be.getEvent().getRelatedEventTarget();
if (to == null
|| (Element.is(source) && Element.is(to) && !DOM.isOrHasChild(source, (Element) Element.as(to)))) {
onTargetOut(be);
代码示例来源:origin: com.extjs/gxt
private void replaceInputElement(Element elem) {
InputElement newInputElem = InputElement.as(elem);
int tabIndex = getTabIndex();
boolean checked = getValue();
boolean enabled = isEnabled();
String uid = input.getId();
String accessKey = InputElement.as(input.dom).getAccessKey();
int sunkEvents = Event.getEventsSunk(input.dom);
String styleName = input.getStyleName();
String valueAttribute = getValueAttribute();
getElement().replaceChild(newInputElem, input.dom);
Event.sinkEvents(elem, 0);
input = new El((Element) Element.as(newInputElem));
input.makePositionable();
Event.sinkEvents(input.dom, sunkEvents);
input.setId(uid);
if (!"".equals(accessKey)) {
InputElement.as(input.dom).setAccessKey(accessKey);
}
setTabIndex(tabIndex);
setValueAttribute(valueAttribute);
setValue(checked);
setEnabled(enabled);
input.setStyleName(styleName);
}
代码示例来源:origin: net.sf.advanced-gwt/advanced-gwt
if (nativeEvent.getEventTarget() == null)
return;
Element target = (Element) Element.as(nativeEvent.getEventTarget());
if (!DOM.isOrHasChild(getPanel().getElement(), target))
return;
内容来源于网络,如有侵权,请联系作者删除!