
org.ioc.commons.impl.gwt.client.ui.IsWidgetImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ioc-commons-gwt-impl Show documentation
Show all versions of ioc-commons-gwt-impl Show documentation
GWT implementation for ioc-commons artifacts.
package org.ioc.commons.impl.gwt.client.ui;
import org.ioc.commons.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;
public class IsWidgetImpl implements IsWidget {
private Widget widget;
public IsWidgetImpl(Widget widget) {
this.widget = widget;
}
@Override
public Widget asWidget() {
return widget;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((widget == null) ? 0 : widget.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof IsWidget))
return false;
IsWidget other = (IsWidget) obj;
if (widget == null) {
if (other.asWidget() != null)
return false;
} else if (!widget.equals(other.asWidget()))
return false;
return true;
}
@Override
public IsWidget getWidgetParent() {
return this.widget.getParent() != null ? new IsWidgetImpl(this.widget.getParent()) : null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy