| /******************************************************************************* |
| * Copyright (c) 2000, 2008 Tasktop Technologies and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Tasktop Technologies - initial API and implementation |
| * Benjamin Pasero - initial API and contribution |
| *******************************************************************************/ |
| |
| package org.eclipse.mylyn.commons.tests.manual; |
| |
| import org.eclipse.mylyn.internal.provisional.commons.ui.AbstractNotificationPopup; |
| import org.eclipse.swt.events.ShellAdapter; |
| import org.eclipse.swt.events.ShellEvent; |
| import org.eclipse.swt.layout.FillLayout; |
| import org.eclipse.swt.widgets.Display; |
| import org.eclipse.swt.widgets.Shell; |
| |
| /** |
| * @author Benjamin Pasero |
| * @author Mik Kersten |
| */ |
| public class NoticicationPopupMain { |
| |
| public static void main(String[] args) { |
| Display display = new Display(); |
| Shell shell = new Shell(display); |
| shell.setLayout(new FillLayout()); |
| |
| shell.open(); |
| |
| final AbstractNotificationPopup popup = new SampleNotificationPopup(display); |
| |
| shell.addShellListener(new ShellAdapter() { |
| @Override |
| public void shellClosed(ShellEvent e) { |
| popup.close(); |
| } |
| }); |
| |
| popup.open(); |
| |
| while (!shell.isDisposed()) { |
| if (!display.readAndDispatch()) { |
| display.sleep(); |
| } |
| } |
| } |
| } |