com.tensegrity.gui.swt.dialog
Class SwtBaseDialog

java.lang.Object
  extended byorg.eclipse.swt.widgets.Dialog
      extended bycom.tensegrity.gui.swt.dialog.SwtBaseDialog
All Implemented Interfaces:
Disposable, Evaluable, java.util.EventListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
CustomAttributesDialog, RuleEditorDialog, SwtAttributableOnSetDialog, SWTElementConflictDialog, SwtGraphCreationDialog, SwtGraphFileChooserDialog, SwtInputDialog, SwtOpenFileConflictDialog

public class SwtBaseDialog
extends org.eclipse.swt.widgets.Dialog
implements Evaluable, org.eclipse.swt.events.KeyListener, Disposable

The SwtBaseDialog is a base class for good looking dialogs in the SWT context.

The dialog displays a title string and a description paragraph. The setDefaultResourceClassAndURL() method can be used in order to display the standard Tensegrity Icon on the top right corner of the dialog. This icon can be modified by means of the setResourceClassAndURL(Class, String) method.

Subclasses of this dialog that implement the interface Evaluable must invoke

 super.applyEvList()
 
in their t()implementation.

Version:
$Id: SwtBaseDialog.java,v 1.15 2005/09/15 15:02:52 SebastienGuyon Exp $
Author:
S�bastien Guyon

Field Summary
protected static java.lang.Class resourceClass
          This is the base class to load the common image from
protected static java.lang.String resourcePath
          This is the path to the the common image, relative to resourceClass
 
Constructor Summary
SwtBaseDialog(org.eclipse.swt.widgets.Shell parent, int style, UIManager uiManager, java.lang.String keyTitle, java.lang.String keyDescription)
          Creates a new AbstractOkCancelDialog
 
Method Summary
 void applyEvList()
          Tells the component to apply its UIItemEvaluationList.
 void dispose()
           Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.
 org.eclipse.swt.widgets.Shell getDialog()
           
protected  org.eclipse.swt.layout.GridData getTextCompositeLayoutData()
           Subclasses should override this method in order to set the Layout Data Use for the text composite of the base dialog.
 UIManager getUIManager()
           
 void installEvList()
          Tells the component to setup its internal state.
 void keyPressed(org.eclipse.swt.events.KeyEvent e)
           
 void keyReleased(org.eclipse.swt.events.KeyEvent e)
           
static void setDefaultResourceClassAndURL()
          Sets the Tensegrity default resource-class and resource url for loading the common image displayed in all derived dialogs.
 void setDescriptionText(java.lang.String text)
          Sets the text to display in the description label.
static void setResourceClassAndURL(java.lang.Class resourceClass, java.lang.String resourcePath)
          Sets the resource-class and resource url for loading the common image displayed in all derived dialogs.
 void setTitleText(java.lang.String text)
          Sets the text to display in the title label.
 void show()
           Method used in order to actually create and display the dialog.
 
Methods inherited from class org.eclipse.swt.widgets.Dialog
checkSubclass, getParent, getStyle, getText, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceClass

protected static java.lang.Class resourceClass
This is the base class to load the common image from


resourcePath

protected static java.lang.String resourcePath
This is the path to the the common image, relative to resourceClass

Constructor Detail

SwtBaseDialog

public SwtBaseDialog(org.eclipse.swt.widgets.Shell parent,
                     int style,
                     UIManager uiManager,
                     java.lang.String keyTitle,
                     java.lang.String keyDescription)
Creates a new AbstractOkCancelDialog

Parameters:
parent - the parent Composite to add this dialog to
style - SWT style bits
uiManager - the UIManager instance to use for localization
Method Detail

setResourceClassAndURL

public static final void setResourceClassAndURL(java.lang.Class resourceClass,
                                                java.lang.String resourcePath)
Sets the resource-class and resource url for loading the common image displayed in all derived dialogs.

Parameters:
resourceClass - the base class to load the common image from.
resourcePath - the resource path to load the common image from.

setDefaultResourceClassAndURL

public static final void setDefaultResourceClassAndURL()
Sets the Tensegrity default resource-class and resource url for loading the common image displayed in all derived dialogs.


show

public void show()

Method used in order to actually create and display the dialog.


getDialog

public final org.eclipse.swt.widgets.Shell getDialog()

getUIManager

public final UIManager getUIManager()

installEvList

public void installEvList()
Description copied from interface: Evaluable
Tells the component to setup its internal state.

Specified by:
installEvList in interface Evaluable

applyEvList

public void applyEvList()
Description copied from interface: Evaluable
Tells the component to apply its UIItemEvaluationList.

Specified by:
applyEvList in interface Evaluable

keyPressed

public void keyPressed(org.eclipse.swt.events.KeyEvent e)
Specified by:
keyPressed in interface org.eclipse.swt.events.KeyListener

keyReleased

public void keyReleased(org.eclipse.swt.events.KeyEvent e)
Specified by:
keyReleased in interface org.eclipse.swt.events.KeyListener

dispose

public void dispose()
Description copied from interface: Disposable

Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.

Specified by:
dispose in interface Disposable

setDescriptionText

public void setDescriptionText(java.lang.String text)
Sets the text to display in the description label.

Parameters:
text - the text to display in the description label.

setTitleText

public void setTitleText(java.lang.String text)
Sets the text to display in the title label.

Parameters:
text - the text to display in the title label.

getTextCompositeLayoutData

protected org.eclipse.swt.layout.GridData getTextCompositeLayoutData()

Subclasses should override this method in order to set the Layout Data Use for the text composite of the base dialog. The text composite is a Composite containing both the title and description of the dialog. It is especially usefull to override this method when the description has to be wrapped.

Returns:
the GridData for the text composite layout


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.