com.tensegrity.gui.swt.dialog
Class AbstractPreviewDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended bycom.tensegrity.gui.swt.dialog.AbstractPreviewDialog
All Implemented Interfaces:
PreviewDialog
Direct Known Subclasses:
PageSetupDialog, SwtFontFormatDialog, SwtMarkerFormatDialog, SwtPaintFormatDialog, SwtStrokeFormatDialog

public abstract class AbstractPreviewDialog
extends org.eclipse.jface.dialogs.Dialog
implements PreviewDialog

Abstract base class for dialogs which have a preview component.

To create a new preview dialog instance extend this class and implement the abstract methods. To change the preview according to dialog inputs use the Preview.updatePreview(Object) method

Version:
$Id: AbstractPreviewDialog.java,v 1.6 2005/06/07 10:14:07 ArndHouben Exp $
Author:
Arnd Houben

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
protected  Preview preview
          The preview to use
protected  UIManager uiManager
          Reference to the globally used UIManager for internatiolization
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, 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 AbstractPreviewDialog(org.eclipse.swt.widgets.Shell parentShell, UIManager uiManager)
          Constructor which requires an UIManager instance.
 
Method Summary
 boolean close()
           
protected  void configureShell(org.eclipse.swt.widgets.Shell shell)
           
 void create()
           
protected abstract  void createDialog(org.eclipse.swt.widgets.Composite parent)
          Create the content of the dialog (with preview) within this method
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
           
abstract  void dialogDisposed()
          Called when the dialog is closed.
abstract  java.lang.Object getPreviewedItem()
          Return the item which is previewed
 void registerPreview(Preview preview)
          Register a preview which should be updated
 void setTitle(java.lang.String title)
          Sets the dialog title.
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
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
Reference to the globally used UIManager for internatiolization


preview

protected Preview preview
The preview to use

Constructor Detail

AbstractPreviewDialog

protected AbstractPreviewDialog(org.eclipse.swt.widgets.Shell parentShell,
                                UIManager uiManager)
Constructor which requires an UIManager instance.

Parameters:
parentShell - the parent shell
uiManager - the used UIManager for internationalization
Method Detail

createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)

create

public void create()

configureShell

protected void configureShell(org.eclipse.swt.widgets.Shell shell)

setTitle

public void setTitle(java.lang.String title)
Sets the dialog title.

Parameters:
title - the dialog title
See Also:
http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg07566.html

registerPreview

public final void registerPreview(Preview preview)
Description copied from interface: PreviewDialog
Register a preview which should be updated

Specified by:
registerPreview in interface PreviewDialog
Parameters:
preview - the preview to monitor

close

public boolean close()

getPreviewedItem

public abstract java.lang.Object getPreviewedItem()
Description copied from interface: PreviewDialog
Return the item which is previewed

Specified by:
getPreviewedItem in interface PreviewDialog
Returns:
the item which is shown in the preview

dialogDisposed

public abstract void dialogDisposed()
Called when the dialog is closed. Implementing class should free their allocated resources here.


createDialog

protected abstract void createDialog(org.eclipse.swt.widgets.Composite parent)
Create the content of the dialog (with preview) within this method

Parameters:
parent - the Composite which takes the dialog content


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