portalLayout.addPortletWindow(newPortletWindow, storedPortlet.getColumn());
PortalColumn portalColumn = portalLayout.getPortalColumn(storedPortlet.getColumn());
// also insert a blank spacer element, which will trigger the built-in
// animateMembers layout animation
final LayoutSpacer placeHolder = new LayoutSpacer();
// placeHolder.setRect(newPortlet.getRect());
portalColumn.addMember(placeHolder); // add to top
// create an outline around the clicked button
final Canvas outline = new Canvas();
outline.setLeft(editForm.getAbsoluteLeft() + addPortlet.getLeft());
outline.setTop(editForm.getAbsoluteTop());
outline.setWidth(addPortlet.getWidth());
outline.setHeight(addPortlet.getHeight());
outline.setBorder("2px solid 8289A6");
outline.draw();
outline.bringToFront();
outline.animateRect(newPortletWindow.getPageLeft(), newPortletWindow.getPageTop(),
newPortletWindow.getVisibleWidth(), newPortletWindow.getViewportHeight(), new AnimationCallback() {
public void execute(boolean earlyFinish) {
// callback at end of animation - destroy placeholder and outline; show the new portlet
placeHolder.destroy();
outline.destroy();
newPortletWindow.show();
}
}, 750);
save();