Search in sources :

Example 1 with VisibilityWindowListener

use of org.eclipse.swt.browser.VisibilityWindowListener in project eclipse.platform.swt by eclipse.

the class Test_org_eclipse_swt_browser_Browser method test_VisibilityWindowListener_newListener_closeShell.

@Test
public void test_VisibilityWindowListener_newListener_closeShell() {
    Display display = Display.getCurrent();
    Shell shell = new Shell(display);
    Browser browser = new Browser(shell, SWT.NONE);
    browser.addVisibilityWindowListener(new VisibilityWindowListener() {

        @Override
        public void hide(WindowEvent event) {
        }

        @Override
        public void show(WindowEvent event) {
        }
    });
    shell.close();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) WindowEvent(org.eclipse.swt.browser.WindowEvent) VisibilityWindowListener(org.eclipse.swt.browser.VisibilityWindowListener) Display(org.eclipse.swt.widgets.Display) Browser(org.eclipse.swt.browser.Browser) Test(org.junit.Test)

Aggregations

Browser (org.eclipse.swt.browser.Browser)1 VisibilityWindowListener (org.eclipse.swt.browser.VisibilityWindowListener)1 WindowEvent (org.eclipse.swt.browser.WindowEvent)1 Display (org.eclipse.swt.widgets.Display)1 Shell (org.eclipse.swt.widgets.Shell)1 Test (org.junit.Test)1