com.tensegrity.gui.swt.dialog
Class AbstractOkCancelDialog

java.lang.Object
  extended byorg.eclipse.swt.widgets.Dialog
      extended bycom.tensegrity.gui.swt.dialog.AbstractOkCancelDialog
Direct Known Subclasses:
GradientDialog, PaintItemDialog

public abstract class AbstractOkCancelDialog
extends org.eclipse.swt.widgets.Dialog

This class defines an abstract dialog which contains a button panel in its lower region. This button panel consists of an ok and a cancel button.

Version:
$Id: AbstractOkCancelDialog.java,v 1.6 2005/10/05 14:26:12 ArndHouben Exp $
Author:
Arnd Houben

Field Summary
protected  UIManager uiManager
           
 
Constructor Summary
AbstractOkCancelDialog(org.eclipse.swt.widgets.Shell parent, int style, UIManager uiManager)
          Creates a new AbstractOkCancelDialog
AbstractOkCancelDialog(org.eclipse.swt.widgets.Shell parent, UIManager uiManager)
          The constructor which requires the parent shell of this dialog and an UIManager for translating the button captions.
 
Method Summary
protected  void close()
          This closes the dialog
protected abstract  void createDialogContent(org.eclipse.swt.widgets.Composite parent)
          Creates the dialog content which is shown above the button panel
protected abstract  java.lang.Object getCancelResult()
          Returns the result in case the user pressed the cancel button.
protected abstract  java.lang.String getDialogTitle()
          Returns the title text for this dialog.
protected abstract  java.lang.Object getOkResult()
          Returns the result in case the user pressed the ok button.
 java.lang.Object open()
          Opens the modal dialog and returns an object as result or null if cancel was choosen.
 void setLocation(org.eclipse.swt.graphics.Point dialogLocation)
          Sets the location of this dialog relative to the display
 
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

uiManager

protected final UIManager uiManager
Constructor Detail

AbstractOkCancelDialog

public AbstractOkCancelDialog(org.eclipse.swt.widgets.Shell parent,
                              UIManager uiManager)
The constructor which requires the parent shell of this dialog and an UIManager for translating the button captions.

Parameters:
parent - dialog's parent shell
uiManager - for localizing

AbstractOkCancelDialog

public AbstractOkCancelDialog(org.eclipse.swt.widgets.Shell parent,
                              int style,
                              UIManager uiManager)
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

open

public java.lang.Object open()
Opens the modal dialog and returns an object as result or null if cancel was choosen.

Returns:
the result object or null

setLocation

public final void setLocation(org.eclipse.swt.graphics.Point dialogLocation)
Sets the location of this dialog relative to the display

Parameters:
dialogLocation - the new location of this dialog

close

protected void close()
This closes the dialog


getDialogTitle

protected abstract java.lang.String getDialogTitle()
Returns the title text for this dialog.

Returns:
dialog's title

createDialogContent

protected abstract void createDialogContent(org.eclipse.swt.widgets.Composite parent)
Creates the dialog content which is shown above the button panel

Parameters:
parent - this dialog to which the content could be added

getOkResult

protected abstract java.lang.Object getOkResult()
Returns the result in case the user pressed the ok button.

Returns:
the result of this dialog

getCancelResult

protected abstract java.lang.Object getCancelResult()
Returns the result in case the user pressed the cancel button.

Returns:
the result of this dialog


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