final IButton button = new IButton("Show Example");
button.setWidth(140);
button.setIcon("silk/layout_content.png");
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
Rectangle rect = button.getPageRect();
final Canvas animateOutline = new Canvas();
animateOutline.setBorder("2px solid black");
animateOutline.setTop(rect.getTop());
animateOutline.setLeft(rect.getLeft());
animateOutline.setWidth(rect.getLeft());
animateOutline.setHeight(rect.getHeight());
animateOutline.show();
animateOutline.animateRect(0, 0, Page.getWidth(), Page.getHeight(), new AnimationCallback() {
public void execute(boolean earlyFinish) {
animateOutline.hide();
final FullScreenApplication appWindow = new FullScreenApplication();
appWindow.addCloseClickHandler(new CloseClickHandler() {
public void onCloseClick(CloseClientEvent event) {
animateOutline.setRect(0, 0, Page.getWidth(), Page.getHeight());
animateOutline.show();
appWindow.destroy();
Rectangle targetRect = button.getPageRect();
animateOutline.animateRect(targetRect.getLeft(), targetRect.getTop(), targetRect.getWidth(),
targetRect.getHeight(), new AnimationCallback() {
public void execute(boolean earlyFinish) {
animateOutline.hide();
}
}, 500);