org.mockcentral.editor.search
Class SelectTypeDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.ui.dialogs.SelectionDialog
              extended by org.eclipse.ui.dialogs.SelectionStatusDialog
                  extended by org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
                      extended by org.mockcentral.editor.search.SelectTypeDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider, org.mockcentral.editor.dialogs.IMockCentralDialog

public class SelectTypeDialog
extends org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
implements org.mockcentral.editor.dialogs.IMockCentralDialog

A FilteredItemsSelectionDialog used to select java elements based on the type match rule supplied to the constructor.

Author:
David Hutchinson

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
CARET_BEGINNING, FULL_SELECTION, NONE
 
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
 
Fields inherited from interface org.mockcentral.editor.dialogs.IMockCentralDialog
CANCEL, OK
 
Constructor Summary
SelectTypeDialog(java.lang.Object... args)
          Creates a new dialog used to select java elements.
 
Method Summary
protected  java.lang.String buildClassName(MatchingType matchinType)
          Builds and returns the fully-qualified class name for the type derived from the supplied MatchingType.
protected  org.eclipse.swt.widgets.Control createExtendedContentArea(org.eclipse.swt.widgets.Composite parent)
           
protected  org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter createFilter()
           
protected  void fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider contentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter typeFilter, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
           
protected  org.eclipse.jface.dialogs.IDialogSettings getDialogSettings()
           
 java.lang.String getElementName(java.lang.Object item)
           
protected  org.mockcentral.editor.search.SelectTypeDialog.TypeSelectionHistory getHistory()
           
 org.eclipse.swt.graphics.Point getInitialLocation(org.eclipse.swt.graphics.Point initialSize)
           
 org.eclipse.swt.graphics.Point getInitialSize()
           
protected  java.util.Comparator getItemsComparator()
           
 java.lang.Object[] getResult()
           
 void setDefaultValue(java.lang.Object defaultValue)
           
protected  org.eclipse.core.runtime.IStatus validateItem(java.lang.Object item)
           
 
Methods inherited from class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
accessedHistoryItem, addListFilter, applyFilter, close, computeResult, create, createDialogArea, fillViewMenu, getDialogBoundsSettings, getInitialPattern, getPatternControl, getSelectedItems, getSelectionHistory, handleDoubleClick, handleSelected, isDuplicateElement, isHistoryElement, okPressed, refresh, reloadCache, removeHistoryItem, restoreDialog, scheduleProgressMessageRefresh, scheduleRefresh, setDetailsLabelProvider, setInitialPattern, setInitialPattern, setListLabelProvider, setListSelectionLabelDecorator, setSelectionHistory, setSeparatorLabel, storeDialog, updateProgressLabel, updateStatus
 
Methods inherited from class org.eclipse.ui.dialogs.SelectionStatusDialog
configureShell, createButtonBar, getFirstResult, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState
 
Methods inherited from class org.eclipse.ui.dialogs.SelectionDialog
createButtonsForButtonBar, createMessageArea, getInitialElementSelections, getInitialSelections, getMessage, getOkButton, setInitialElementSelections, setInitialSelections, setMessage, setResult, setSelectionResult, setTitle
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, 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
 
Methods inherited from interface org.mockcentral.editor.dialogs.IMockCentralDialog
open
 

Constructor Detail

SelectTypeDialog

public SelectTypeDialog(java.lang.Object... args)
Creates a new dialog used to select java elements.

Parameters:
args - the parent Shell, the initial size for this dialog, the initial location for this dialog, the element type match rule to use during the search (one of IJavaSearchConstants.CLASS, IJavaSearchConstants.INTERFACE or IJavaSearchConstants.ENUM) and the full name of the Class, Interface or Enum used to construct the initial pattern for the user input.
Method Detail

getInitialSize

public org.eclipse.swt.graphics.Point getInitialSize()
Overrides:
getInitialSize in class org.eclipse.jface.window.Window

getInitialLocation

public org.eclipse.swt.graphics.Point getInitialLocation(org.eclipse.swt.graphics.Point initialSize)
Overrides:
getInitialLocation in class org.eclipse.jface.window.Window

getElementName

public java.lang.String getElementName(java.lang.Object item)
Specified by:
getElementName in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog

getResult

public java.lang.Object[] getResult()
Specified by:
getResult in interface org.mockcentral.editor.dialogs.IMockCentralDialog
Overrides:
getResult in class org.eclipse.ui.dialogs.SelectionDialog

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Specified by:
setDefaultValue in interface org.mockcentral.editor.dialogs.IMockCentralDialog

buildClassName

protected java.lang.String buildClassName(MatchingType matchinType)
Builds and returns the fully-qualified class name for the type derived from the supplied MatchingType.

Parameters:
matchinType - the MatchingType.
Returns:
the fully-qualified class name.

fillContentProvider

protected void fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider contentProvider,
                                   org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter typeFilter,
                                   org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                            throws org.eclipse.core.runtime.CoreException
Specified by:
fillContentProvider in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
Throws:
org.eclipse.core.runtime.CoreException

createFilter

protected org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter createFilter()
Specified by:
createFilter in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog

getDialogSettings

protected org.eclipse.jface.dialogs.IDialogSettings getDialogSettings()
Specified by:
getDialogSettings in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog

getItemsComparator

protected java.util.Comparator getItemsComparator()
Specified by:
getItemsComparator in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog

createExtendedContentArea

protected org.eclipse.swt.widgets.Control createExtendedContentArea(org.eclipse.swt.widgets.Composite parent)
Specified by:
createExtendedContentArea in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog

getHistory

protected org.mockcentral.editor.search.SelectTypeDialog.TypeSelectionHistory getHistory()

validateItem

protected org.eclipse.core.runtime.IStatus validateItem(java.lang.Object item)
Specified by:
validateItem in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog