package org.sagebionetworks.web.client.utils;

import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Style.Direction;
import com.extjs.gxt.ui.client.fx.FxConfig;
import com.extjs.gxt.ui.client.widget.Component;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerRegistration;

public class AnimationProtectorViewImpl implements AnimationProtectorView {

	private HasClickHandlers trigger = null;
	private Component container = null;

	public AnimationProtectorViewImpl(HasClickHandlers trigger, Component container) {
		this.trigger = trigger;
		this.container = container;
	}

	@Override
	public HandlerRegistration addClickHandler(ClickHandler handler) {
		return trigger.addClickHandler(handler);
	}

	@Override
	public boolean isContainerVisible() {
		return container.isVisible();
	}

	@Override
	public boolean isContainerRendered() {
		return container.isRendered();
	}

	@Override
	public void setContainerVisible(boolean setVisible) {
		container.setVisible(setVisible);
	}

	@Override
	public void slideContainerIn(Direction direction, FxConfig config) {
		container.el().slideIn(direction, config);
	}

	@Override
	public void slideContainerOut(Direction direction, FxConfig config) {
		container.el().slideOut(direction, config);
	}
	
	@Override
	public boolean isSlideSupportedByView() {
		//slide is not supported on Chrome for GWT 2.4
		return !GXT.isChrome;
	}
}

@@ -1408,16 +1408,147 @@
 iew() %7B%0A
+%09%09//SWC-1123: high profile failure of the animator. remove animation for now (report no views support animation)%0A%09%09return false;%0A//
 %09%09//slid
@@ -1588,16 +1588,18 @@
 GWT 2.4%0A
+//
 %09%09return

remove animation for now