sk.uniba.euromath.editor.dialogs
Class WidgetWrapperDialog<W extends IUserInputWidget>

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 sk.uniba.euromath.editor.dialogs.WidgetWrapperDialog<W>
Type Parameters:
W - dialog shows this kind of widget.
All Implemented Interfaces:
IShellProvider

public final class WidgetWrapperDialog<W extends IUserInputWidget>
extends TitleAreaDialog

Wraps a widget in a dialog.

Author:
Martin Vysny

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
protected  String errorMessage
          We need to remember currently shown error message.
protected  String message
          Warning or info message.
protected  int messageType
          Type of currently shown message.
 
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
WidgetWrapperDialog(Shell parent, String caption, String description, IWidgetFactory<W> factory)
          Constructor.
 
Method Summary
protected  void configureShell(Shell newShell)
           
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
 int getMessageType()
          Returns type of message currently being shown.
 W getWidget()
          Returns the widget.
 void setErrorMessage(String errorMsg)
           
 void setMessage(String msg, int type)
           
protected  void setMessages(ValidityMessages messages)
          Updates messages on this page.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
createContents, getInitialSize, getTitleArea, getTitleImageLabel, 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, 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
 

Field Detail

errorMessage

protected String errorMessage
We need to remember currently shown error message.


message

protected String message
Warning or info message.


messageType

protected int messageType
Type of currently shown message.

Constructor Detail

WidgetWrapperDialog

public WidgetWrapperDialog(Shell parent,
                           String caption,
                           String description,
                           IWidgetFactory<W> factory)
Constructor.

Parameters:
parent - parent shell. Should not be null.
caption - caption of the dialog.
factory - the factory producing a widget. Only one widget is required to be produced for one dialog.
description - Description, what this dialog intends to do.
Method Detail

createDialogArea

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

getWidget

public W getWidget()
Returns the widget.

Returns:
the widget, or null if dialog is not yet created.

configureShell

protected void configureShell(Shell newShell)
Overrides:
configureShell in class Window

setMessages

protected void setMessages(ValidityMessages messages)
Updates messages on this page.

Parameters:
messages - validity messages. If null then all messages are cleared.

getMessageType

public int getMessageType()
Returns type of message currently being shown.

Returns:
type of message currently being shown.

setErrorMessage

public void setErrorMessage(String errorMsg)
Overrides:
setErrorMessage in class TitleAreaDialog

setMessage

public void setMessage(String msg,
                       int type)
Overrides:
setMessage in class TitleAreaDialog

createButtonsForButtonBar

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


Copyright © 2003-2006 null. All Rights Reserved.