de.jdemo.extensions
Class SwtDemoCase

java.lang.Object
  extended by de.jdemo.framework.AbstractDemoCase
      extended by de.jdemo.extensions.SwtDemoCase
All Implemented Interfaces:
ISwtDemoCase, IDemo, IDemoCase, java.lang.Cloneable

public abstract class SwtDemoCase
extends AbstractDemoCase
implements ISwtDemoCase

Abstract superclass for all demos demonstrating SWT components.

Author:
Markus Gebhard

Constructor Summary
SwtDemoCase()
           
 
Method Summary
 void cancel()
          Give this DemoCase the chance to exit.
protected  java.lang.Object clone()
          Returns a clone of this democase, that is a new instance being the same demonstration case, but not having any listeners or other temporary fields.
 IDemoCaseRunnable createRunnable(boolean allowExternalLaunches)
          Creates a runnable for running this demo case.
protected  org.eclipse.swt.widgets.Shell createShell()
          Creates a new Shellobject that can be used for adding widgets.
 void executeTearDown()
          Called by the DemoCaseRunner to invoke the tearDown method.
protected  org.eclipse.swt.widgets.Display getDisplay()
           
 void runDemo()
          Override to run the demo and assert its state.
 
Methods inherited from class de.jdemo.framework.AbstractDemoCase
accept, after, assertNotNull, assertNull, assertTrue, before, createThreadGroup, executeSetUp, exit, fail, getClone, getIdentifier, getName, getRunnable, setName, setRunnable, setUp, tearDown, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwtDemoCase

public SwtDemoCase()
Method Detail

createRunnable

public IDemoCaseRunnable createRunnable(boolean allowExternalLaunches)
Description copied from interface: IDemoCase
Creates a runnable for running this demo case.

Specified by:
createRunnable in interface IDemoCase
Parameters:
allowExternalLaunches - indicates whether this demo is allowed e.g. to launch a file in an external software. This flag will be false if this demo is executed as test for example.

executeTearDown

public void executeTearDown()
                     throws java.lang.Exception
Description copied from class: AbstractDemoCase
Called by the DemoCaseRunner to invoke the tearDown method. Should not be called from within a demo.

Overrides:
executeTearDown in class AbstractDemoCase
Throws:
java.lang.Exception

clone

protected java.lang.Object clone()
Description copied from class: AbstractDemoCase
Returns a clone of this democase, that is a new instance being the same demonstration case, but not having any listeners or other temporary fields. This is intended for starting each demo case from scratch.

Overrides:
clone in class AbstractDemoCase

cancel

public void cancel()
Description copied from class: AbstractDemoCase
Give this DemoCase the chance to exit. Can be overriden by subclasses e.g. to dispose windows or dispose other resources. Usually invoked from an IDemoCaseRunnable when the user requests termination of the Demo. Should not be called from within a demo.

Overrides:
cancel in class AbstractDemoCase

getDisplay

protected org.eclipse.swt.widgets.Display getDisplay()

createShell

protected org.eclipse.swt.widgets.Shell createShell()
Creates a new Shellobject that can be used for adding widgets. The shell will automatically be made visible when returning from the demo... method. Not that calling this method more often than once will result in a DemoExecutionFailedError.


runDemo

public void runDemo()
             throws java.lang.Throwable
Description copied from class: AbstractDemoCase
Override to run the demo and assert its state.

Overrides:
runDemo in class AbstractDemoCase
Throws:
java.lang.Throwable - if any exception is thrown


JDemo homepage: http://www.jdemo.de
Copyright © 2003-2008 Markus Gebhard. All Rights Reserved.