Skip to content

Instantly share code, notes, and snippets.

@branflake2267
Created May 7, 2014 22:37
Show Gist options
  • Select an option

  • Save branflake2267/19aabca3a79522fd9aac to your computer and use it in GitHub Desktop.

Select an option

Save branflake2267/19aabca3a79522fd9aac to your computer and use it in GitHub Desktop.
Window and with animated display fade in.
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.fx.client.FxElement;
import com.sencha.gxt.fx.client.animation.Fx;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
public class WindowTest {
public WindowTest() {
TextButton button = new TextButton("Open");
RootPanel.get().add(button, 50, 50);
button.addSelectHandler(new SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
displayWindow();
}
});
}
private void displayWindow() {
Window window = new Window();
window.setPixelSize(200, 200);
window.setShadow(false);
window.show();
window.getElement().getStyle().setDisplay(Display.NONE);
// use default settings
//window.getElement().<FxElement> cast().fadeToggle();
// use custom settings
Fx fx = new Fx(700);
window.getElement().<FxElement> cast().fadeToggle(fx);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment