hok.ui.wizard
Class ConstraintDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.TrayDialog
              extended by org.eclipse.jface.dialogs.TitleAreaDialog
                  extended by hok.ui.wizard.ConstraintDialog
All Implemented Interfaces:
IShellProvider

public class ConstraintDialog
extends TitleAreaDialog

The ConstraintDialog is used to select the predicates or - depending on the type of the dialog - concepts the user can choose from to constrain the design problem in the wizard.

Author:
holger

Nested Class Summary
static class ConstraintDialog.DialogType
          The type of the dialog.
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
protected ConstraintDialog(Shell parentShell, ConstraintDialog.DialogType type)
          The constructor needs a parent shell and the Dialogtype (either ConceptType or PredicateType).
 
Method Summary
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createContents(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
 ITreeNode getSelectedElement()
          Returns the element that is selected by the user.
 ITreeNode getTreeModel()
          Returns the tree model.
 ConstraintDialog.DialogType getType()
          Returns the type of the Dialog
 void setTreeModel(ITreeNode treeNode)
          Sets the tree model.
 void setType(ConstraintDialog.DialogType type)
          Sets the type of the Dialog.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
getInitialSize, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
close, closeTray, createButtonBar, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintDialog

protected ConstraintDialog(Shell parentShell,
                           ConstraintDialog.DialogType type)
The constructor needs a parent shell and the Dialogtype (either ConceptType or PredicateType). The DialogType decides which icon is displayed for the tree elements and the content of the title and message bar

Parameters:
parentShell - the parent shell to set.
type - the dialog type to set.
Method Detail

createContents

protected Control createContents(Composite parent)
Overrides:
createContents in class TitleAreaDialog

createDialogArea

protected Control createDialogArea(Composite parent)
Overrides:
createDialogArea in class TitleAreaDialog

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)
Overrides:
createButtonsForButtonBar in class Dialog

getType

public ConstraintDialog.DialogType getType()
Returns the type of the Dialog

Returns:
either ConceptType or PredicateType.

setType

public void setType(ConstraintDialog.DialogType type)
Sets the type of the Dialog.

Parameters:
type - either ConceptType or PredicateType.

getTreeModel

public ITreeNode getTreeModel()
Returns the tree model.

Returns:
the tree model.

setTreeModel

public void setTreeModel(ITreeNode treeNode)
Sets the tree model. This method has to be called before open().

Parameters:
treeNode - the tree model to set.

getSelectedElement

public ITreeNode getSelectedElement()
Returns the element that is selected by the user.

Returns:
the selected tree element or null.