public void addTray() {

		Tray tray = display.getSystemTray();
		if (null == trayItem || trayItem.isDisposed())
			trayItem = new TrayItem(tray, SWT.NONE);

		trayItem.setImage(ImageManager.getImage(ImageManager.MINI_QQ));
		trayItem.setText("linuxQQ");
		trayItem.setToolTipText("linuxQQ");
		trayItem.setVisible(true);

		// click tray,show a login shell if not login else show list shell
		trayItem.addSelectionListener(new SelectionAdapter() {

			@Override
			public void widgetSelected(SelectionEvent e) {
				Logger.log("click trayItem...active shell: " + openedShellCount);
				// no shell has been opened
				if (openedShellCount <= 0) {

					if (isLogin) {
						openListShell();

					} else {
						openLoginShell();
					}

				}
			}

		});
		final Shell trayShell = new Shell();
		final Menu trayMenu = new Menu(trayShell, SWT.POP_UP);

		MenuItem menuItem = new MenuItem(trayMenu, SWT.PUSH);
		menuItem.setText("quit");
		menuItem.addSelectionListener(new SelectionAdapter() {

			@Override
			public void widgetSelected(SelectionEvent e) {

				for (Shell shell : ShellManager) {
					if (shell != null && !shell.isDisposed())
						shell.dispose();

				}
				if (trayItem != null && !trayItem.isDisposed())
					trayItem.dispose();
				isLogin = false;
				Logger.log("QQ quit...active shell: " + openedShellCount);
			}

		});

		trayItem.addMenuDetectListener(new MenuDetectListener() {

			@Override
			public void menuDetected(MenuDetectEvent e) {
				trayMenu.setVisible(true);
			}
		});

	}