All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ioc.commons.impl.gwt.client.ui.IsWidgetImpl Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
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