public void handleEvent(Event event) {
System.out.println("Show Menu...");
try {
Object obj = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
if(obj instanceof IContactListView) {
final IContactListView listView = (IContactListView)obj;
GOIMAccountList accountList = listView.getAccountList();
if(accountList == null) {
Menu accMenu = listView.getActiveAccountContextMenu(null);//.setVisible(true);
// menu.getParent().setMenu(accMenu);
// menu.setVisible(false);
//accMenu.getItems();
// accMenu.setVisible(true);
copyMenu(accMenu,menu);
} else {
for(GOIMAccount account : accountList) {
final GOIMAccount acc = account;
MenuItem accountItem = new MenuItem(menu,SWT.CASCADE);
accountItem.setText(account.name + " (" + account.jid + ")");
final Menu accountMenu = new Menu(accountItem);
accountItem.setMenu(accountMenu);
accountMenu.addListener(SWT.Show,new Listener() {
public void handleEvent(Event event) {
Menu accMenu = listView.getActiveAccountContextMenu(acc);
copyMenu(accMenu,accountMenu);
} });
accountMenu.addListener(SWT.Hide,new Listener() {
public void handleEvent(Event event) {
for(MenuItem item : accountMenu.getItems()) {