本文整理了Java中com.google.gwt.user.client.Element.equals()
方法的一些代码示例,展示了Element.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.equals()
方法的具体详情如下:
包路径:com.google.gwt.user.client.Element
类名称:Element
方法名:equals
暂无
代码示例来源:origin: jqm4gwt/jqm4gwt
/**
* @return - true if event was initiated by passed collapsible (useful in case of nested collapsibles,
* because event is bubbling up to parent collapsibles).
*/
public boolean isInitiatedBy(JQMCollapsible collapsible) {
if (collapsible == null) return false;
return collapsible.getElement().equals(initiatedBy);
}
代码示例来源:origin: gwtbootstrap/gwt-bootstrap
private TabLink findTabLink(Element e) {
for (TabLink tabLink : tabLinkList)
if (tabLink.getAnchor().getElement().equals(e))
return tabLink;
return null;
}
代码示例来源:origin: org.overlord/overlord-commons-gwt
/**
* Remove a single row and all its widgets from the table
*
* @param rowIndex which row to add to (0 based, excluding thead)
*/
public void deleteRow(int rowIndex){
Element rowElem=rowElements.get(rowIndex);
NodeList<Node> tds= rowElem.getChildNodes();
for(int i=0;i<tds.getLength();i++){
Element td=tds.getItem(i).cast();
for(Widget widget:wrapperMap.keySet()){
if(wrapperMap.get(widget).equals(td)){
remove(widget);
break;
}
}
}
this.tbody.removeChild(rowElem);
rowElements.remove(rowIndex);
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-table
protected T getModelByRowElement(Element rowElement) {
for(RowComponent<T> row : rows) {
if(row.isRendered() && row.getWidget().getElement().equals(rowElement)) {
return row.getData();
}
}
return null;
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-table
protected int getRowIndexByElement(Element rowElement) {
for(RowComponent<T> row : rows) {
if(row.isRendered() && row.getWidget().getElement().equals(rowElement)) {
return row.getIndex();
}
}
return -1;
}
代码示例来源:origin: GwtMaterialDesign/gwt-material-table
protected int getRowIndexByElement(Element rowElement) {
for(RowComponent<T> row : rows) {
if(row.isRendered() && row.getWidget().getElement().equals(rowElement)) {
return row.getIndex();
}
}
return -1;
}
代码示例来源:origin: GwtMaterialDesign/gwt-material-table
protected T getModelByRowElement(Element rowElement) {
for(RowComponent<T> row : rows) {
if(row.isRendered() && row.getWidget().getElement().equals(rowElement)) {
return row.getData();
}
}
return null;
}
代码示例来源:origin: com.googlecode.gwt-test-utils/gwt-test-utils
@PatchMethod
static int findDividerIndex(StackPanel panel, Element child) {
WidgetCollection children = GwtReflectionUtils.getPrivateFieldValue(panel, "children");
for (int i = 0; i < children.size(); i++) {
if (children.get(i).getElement().equals(child)) {
return i;
}
}
return -1;
}
代码示例来源:origin: gwt-test-utils/gwt-test-utils
@PatchMethod
static int findDividerIndex(StackPanel panel, Element child) {
WidgetCollection children = GwtReflectionUtils.getPrivateFieldValue(panel, "children");
for (int i = 0; i < children.size(); i++) {
if (children.get(i).getElement().equals(child)) {
return i;
}
}
return -1;
}
代码示例来源: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.haulmont.cuba/cuba-web-toolkit
public void showContextMenuPopup(int left, int top) {
if (this.customContextMenu instanceof HasWidgets) {
if (!((HasWidgets) this.customContextMenu).iterator().hasNext()) {
// there are no actions to show
return;
}
}
// Store the currently focused element, which will be re-focused when
// context menu is closed
Element focusedElement = WidgetUtil.getFocusedElement();
this.customContextMenuPopup = Tools.createCubaTableContextMenu();
this.customContextMenuPopup.setOwner(table);
this.customContextMenuPopup.setWidget(this.customContextMenu);
this.customContextMenuPopup.addCloseHandler(e -> {
Element currentFocus = WidgetUtil.getFocusedElement();
if (focusedElement != null && (currentFocus == null
|| customContextMenuPopup.getElement().isOrHasChild(currentFocus)
|| RootPanel.getBodyElement().equals(currentFocus))) {
focusedElement.focus();
}
customContextMenuPopup = null;
});
Tools.showPopup(this.customContextMenuPopup, left, top);
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
public void showCustomPopup() {
if (this.customPopupWidget != null) {
if (this.customPopupWidget instanceof HasWidgets) {
if (!((HasWidgets) this.customPopupWidget).iterator().hasNext()) {
// there are no component to show
return;
}
}
// Store the currently focused element, which will be re-focused when
// context menu is closed
Element focusedElement = WidgetUtil.getFocusedElement();
this.customPopupOverlay = Tools.createCubaTablePopup(this.customPopupAutoClose);
this.customPopupOverlay.setOwner(table);
this.customPopupOverlay.setWidget(this.customPopupWidget);
this.customPopupOverlay.addCloseHandler(e -> {
Element currentFocus = WidgetUtil.getFocusedElement();
if (focusedElement != null && (currentFocus == null
|| customPopupOverlay.getElement().isOrHasChild(currentFocus)
|| RootPanel.getBodyElement().equals(currentFocus))) {
focusedElement.focus();
}
customPopupOverlay = null;
});
Tools.showPopup(this.customPopupOverlay, this.lastClickClientX, this.lastClickClientY);
}
}
代码示例来源:origin: com.allen-sauer.gwt.dnd/gwt-dnd
@Override
public void dragStart() {
if (!GWT.isScript()) {
if (DOMUtil.getClientHeight(boundaryPanel.getElement()) == 0) {
if (boundaryPanel.getElement().equals(RootPanel.getBodyElement())) {
DOMUtil.reportFatalAndThrowRuntimeException("boundary panel (= the BODY element) has zero height;"
+ " dragging cannot occur inside an AbsolutePanel that has a height of zero pixels;"
+ " you can often remedy this quite easily by adding the following line of"
+ " CSS to your application's stylesheet:" + " BODY, HTML { height: 100%; }");
}
}
}
resetCache();
if (dragHandlers != null) {
dragHandlers.fireDragStart(dragStartEvent);
dragStartEvent = null;
}
context.draggable.addStyleName(DragClientBundle.INSTANCE.css().dragging());
assert dragStartEvent == null;
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
public void showPresentationEditorPopup(Event event, Widget presentationsEditIcon) {
if (event.getEventTarget().cast() == presentationsEditIcon.getElement() && tableWidget.isEnabled()) {
this.presentationsEditorPopup = new VOverlay();
this.presentationsEditorPopup.setStyleName("c-table-prefs-editor");
this.presentationsEditorPopup.setOwner(table);
this.presentationsEditorPopup.setWidget(this.presentationsMenu);
// Store the currently focused element, which will be re-focused when
// context menu is closed
Element focusedElement = WidgetUtil.getFocusedElement();
this.presentationsEditorPopup.addCloseHandler(e -> {
Element currentFocus = WidgetUtil.getFocusedElement();
if (focusedElement != null && (currentFocus == null
|| presentationsEditorPopup.getElement().isOrHasChild(currentFocus)
|| RootPanel.getBodyElement().equals(currentFocus))) {
focusedElement.focus();
}
presentationsEditorPopup = null;
});
this.presentationsEditorPopup.setAutoHideEnabled(true);
this.presentationsEditorPopup.showRelativeTo(presentationsEditIcon);
}
}
内容来源于网络,如有侵权,请联系作者删除!