org.eclipse.mylar.internal.tasks.ui
Class ComboSelectionDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.mylar.internal.tasks.ui.ComboSelectionDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public class ComboSelectionDialog
extends org.eclipse.jface.dialogs.Dialog

General purpose dialog for selecting an item from a combo box.

Author:
This was (essentially) copied from Eclipse's internal implementation by Wesley Coelho

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
private  java.lang.String[] fAllowedStrings
           
private  int fInitialSelectionIndex
           
private  java.lang.String fLabelText
           
private  int fSelectedIndex
           
private  java.lang.String fSelection
           
private  java.lang.String fShellTitle
           
 
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
ComboSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String shellTitle, java.lang.String labelText, java.lang.String[] comboStrings, int initialSelectionIndex)
           
 
Method Summary
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
           
private  int getMaxStringLength()
           
 int getSelectedIndex()
          Returns the array index of the selected string or -1 if no string was selected.
 java.lang.String getSelectedString()
           
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, 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, getLayout, 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

fSelection

private java.lang.String fSelection

fShellTitle

private final java.lang.String fShellTitle

fLabelText

private final java.lang.String fLabelText

fAllowedStrings

private final java.lang.String[] fAllowedStrings

fInitialSelectionIndex

private final int fInitialSelectionIndex

fSelectedIndex

private int fSelectedIndex
Constructor Detail

ComboSelectionDialog

public ComboSelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
                            java.lang.String shellTitle,
                            java.lang.String labelText,
                            java.lang.String[] comboStrings,
                            int initialSelectionIndex)
Method Detail

getSelectedString

public java.lang.String getSelectedString()

createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
Overrides:
createDialogArea in class org.eclipse.jface.dialogs.Dialog

getSelectedIndex

public int getSelectedIndex()
Returns the array index of the selected string or -1 if no string was selected.


getMaxStringLength

private int getMaxStringLength()