com.tensegrity.gui.swt.dialog
Class PaintItemDialog

java.lang.Object
  extended byorg.eclipse.swt.widgets.Dialog
      extended bycom.tensegrity.gui.swt.dialog.AbstractOkCancelDialog
          extended bycom.tensegrity.gui.swt.dialog.PaintItemDialog
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class PaintItemDialog
extends AbstractOkCancelDialog
implements org.eclipse.swt.events.SelectionListener

This dialog presents all available paint items and let the user choose one.

As with almost any SWT dialog use the open() method to make the instantiated dialog visible. This will block the current thread until the user either confirmed or canceled the dialog.

Internally a PatternSelectionBox is used for displaying the different paint items.

Version:
$Id: PaintItemDialog.java,v 1.9 2005/09/19 14:03:44 ArndHouben Exp $
Author:
Arnd Houben

Field Summary
 
Fields inherited from class com.tensegrity.gui.swt.dialog.AbstractOkCancelDialog
uiManager
 
Constructor Summary
PaintItemDialog(org.eclipse.swt.widgets.Shell parent, PaintItemLabel pi, UIManager uiManager)
          Constructor which requires a PaintItemLabel instance for initialization.
 
Method Summary
protected  void createDialogContent(org.eclipse.swt.widgets.Composite parent)
          Creates the dialog content which is shown above the button panel
protected  java.lang.Object getCancelResult()
          Returns the result in case the user pressed the cancel button.
protected  java.lang.String getDialogTitle()
          Returns the title text for this dialog.
protected  java.lang.Object getOkResult()
          Returns the result in case the user pressed the ok button.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
           
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
           
 
Methods inherited from class com.tensegrity.gui.swt.dialog.AbstractOkCancelDialog
close, open, setLocation
 
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
 

Constructor Detail

PaintItemDialog

public PaintItemDialog(org.eclipse.swt.widgets.Shell parent,
                       PaintItemLabel pi,
                       UIManager uiManager)
Constructor which requires a PaintItemLabel instance for initialization.

Parameters:
parent - Composite to add this PaintItemDialog to
pi - PaintItemLabel which defines the initial PaintItem as well as the initial background and foreground colors
uiManager - reference to the globally used UIManager instance
Method Detail

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener

getDialogTitle

protected final java.lang.String getDialogTitle()
Description copied from class: AbstractOkCancelDialog
Returns the title text for this dialog.

Specified by:
getDialogTitle in class AbstractOkCancelDialog
Returns:
dialog's title

createDialogContent

protected final void createDialogContent(org.eclipse.swt.widgets.Composite parent)
Description copied from class: AbstractOkCancelDialog
Creates the dialog content which is shown above the button panel

Specified by:
createDialogContent in class AbstractOkCancelDialog
Parameters:
parent - this dialog to which the content could be added

getOkResult

protected final java.lang.Object getOkResult()
Description copied from class: AbstractOkCancelDialog
Returns the result in case the user pressed the ok button.

Specified by:
getOkResult in class AbstractOkCancelDialog
Returns:
the result of this dialog

getCancelResult

protected java.lang.Object getCancelResult()
Description copied from class: AbstractOkCancelDialog
Returns the result in case the user pressed the cancel button.

Specified by:
getCancelResult in class AbstractOkCancelDialog
Returns:
the result of this dialog


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