public void handleEvent(Event event) {
btnHide.setEnabled(false);
btnDetails.setEnabled(false);
for (Iterator iter = viewStack.iterator(); iter.hasNext();) {
WeakReference wr = (WeakReference) iter.next();
MessagePopupShell popup = (MessagePopupShell) wr.get();
iter.remove();
if (popup == null)
return;
popup.shell.dispose();
popup.detailsShell.dispose();
if (popup.shellImg != null) {
popup.shellImg.dispose();
}
}
}
});
}
shell.layout();
shell.setTabList(new Control[] {btnDetails, btnHide});
btnHide.addListener(SWT.MouseUp, new Listener() {
public void handleEvent(Event arg0) {
btnHide.setEnabled(false);
btnDetails.setEnabled(false);
hideShell();
}
});
btnDetails.addListener(SWT.MouseUp, new Listener() {
public void handleEvent(Event arg0) {
detailsShell.setVisible(btnDetails.getSelection());
}
});
Rectangle bounds = null;
try {
UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctions != null) {
Shell mainShell = uiFunctions.getMainShell();
bounds = mainShell.getMonitor().getClientArea();
}
} catch (Exception e) {
}
if (bounds == null) {
bounds = display.getClientArea();
}
x0 = bounds.x + bounds.width - popupWidth - 5;
x1 = bounds.x + bounds.width;
y0 = bounds.y + bounds.height;
y1 = bounds.y + bounds.height - popupHeight - 5;
// currently always animate
if ( true ){
shell.setLocation(x0,y0);
viewStack.addFirst(new WeakReference(this));
detailsShell.setLocation(x1-detailsShell.getSize().x,y1-detailsShell.getSize().y);
currentAnimator = new LinearAnimator(this,new Point(x0,y0),new Point(x0,y1),20,30);
currentAnimator.start();
shell.open();
}else{
shell.setLocation(x0,y1);
viewStack.addFirst(new WeakReference(this));
detailsShell.setLocation(x1-detailsShell.getSize().x,y1-detailsShell.getSize().y);
currentAnimator = new LinearAnimator(this,new Point(x0,y1),new Point(x0,y1),20,30);
animationStarted(currentAnimator);
shell.open();
animationEnded(currentAnimator);