Maximizing, minimizing Windows, Shells (SWT)

Last edited on

Example

Here is an example of how to maximize and minimize org.eclipse.swt.widgets.Shell instances:

def main():
    # ...

    windowName = {"caption": "Address Book", "isvisible": True, "type": "org.eclipse.swt.widgets.Shell"}
    window = waitForObject(windowName)

    test.log("Setting maximized...")
    window.setMaximized(True)
    snooze(1)

    test.log("Setting normal...")
    window.setMaximized(False)
    snooze(1)

    test.log("Setting iconified...")
    window.setMinimized(True)
    snooze(1)
test.py

Note that the setMaximized() and setMinimized() methods are from the Java SWT API. Such methods can be accessed directly in Squish test scripts.