org.eclipse.emf.emfstore.internal.client.ui.views.emfstorebrowser.views
Class ElementListSelectionDialog

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.emf.emfstore.internal.client.ui.views.emfstorebrowser.views.ElementListSelectionDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
Direct Known Subclasses:
CertificateSelectionDialog

public abstract class ElementListSelectionDialog
extends org.eclipse.jface.dialogs.TrayDialog

This is a copy of the org.eclipse.ui.dialogs.ElementListSelectionDialog with its class hierarchy flattened. This is class is meant as a replacement in order to avoid a dependency to org.eclipse.ui due to e4.


Nested Class Summary
 
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.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, 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
ElementListSelectionDialog(org.eclipse.swt.widgets.Shell parent, org.eclipse.jface.viewers.ILabelProvider renderer)
          Creates a list selection dialog.
 
Method Summary
 void create()
           
 String getFilter()
          Returns the current filter pattern.
 org.eclipse.ui.dialogs.FilteredList getFilteredList()
          Returns the filtered list.
 Object getFirstResult()
          Returns the first element from the list of results.
 Object[] getFoldedElements(int index)
          Returns all elements which are folded together to one entry in the list.
 org.eclipse.swt.widgets.Button getOkButton()
          Returns the ok button.
 Object[] getResult()
          Returns the list of selections made by the user, or null if the selection was canceled.
 boolean isCaseIgnored()
          Returns if sorting, filtering and folding is case sensitive.
 int open()
           
 void setAllowDuplicates(boolean allowDuplicates)
          Specifies whether duplicate entries are displayed or not.
 void setDialogBoundsSettings(org.eclipse.jface.dialogs.IDialogSettings settings, int strategy)
          Set the dialog settings that should be used to save the bounds of this dialog.
 void setElements(Object[] elements)
          Sets the elements of the list.
 void setEmptyListMessage(String message)
          Sets the message to be displayed if the list is empty.
 void setEmptySelectionMessage(String message)
          Sets the message to be displayed if the selection is empty.
 void setFilter(String filter)
          Sets the filter pattern.
 void setIgnoreCase(boolean ignoreCase)
          Specifies if sorting, filtering and folding is case sensitive.
 void setImage(org.eclipse.swt.graphics.Image image)
          Sets the image for this dialog.
 void setInitialElementSelections(List<Object> selectedElements)
          Sets the initial selection in this selection dialog to the given elements.
 void setInitialSelections(Object[] selectedElements)
          Sets the initial selection in this selection dialog to the given elements.
 void setMatchEmptyString(boolean matchEmptyString)
          Specifies whether everything or nothing should be filtered on empty filter string.
 void setMessage(String message)
          Sets the message for this dialog.
 void setMultipleSelection(boolean isMultipleSelectionAllowed)
          Specifies if multiple selection is allowed.
 void setSize(int width, int height)
          Sets the list size in unit of characters.
 void setStatusLineAboveButtons(boolean aboveButtons)
          Controls whether status line appears to the left of the buttons (default) or above them.
 void setTitle(String title)
          Sets the title for this dialog.
 void setValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator validator)
          Sets an optional validator to check if the selection is valid.
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, close, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getBlockedHandler, getImage, setBlockedHandler, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
getDefaultImage, getDefaultImages, getDefaultOrientation, getReturnCode, getShell, getWindowManager, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setWindowManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementListSelectionDialog

public ElementListSelectionDialog(org.eclipse.swt.widgets.Shell parent,
                                  org.eclipse.jface.viewers.ILabelProvider renderer)
Creates a list selection dialog.

Parameters:
parent - the parent widget.
renderer - the label renderer.
Method Detail

setStatusLineAboveButtons

public void setStatusLineAboveButtons(boolean aboveButtons)
Controls whether status line appears to the left of the buttons (default) or above them.

Parameters:
aboveButtons - if true status line is placed above buttons; if false to the right

getOkButton

public org.eclipse.swt.widgets.Button getOkButton()
Returns the ok button.

Returns:
the ok button or null if the button is not created yet.

getResult

public Object[] getResult()
Returns the list of selections made by the user, or null if the selection was canceled.

Returns:
the array of selected elements, or null if Cancel was pressed

setInitialSelections

public void setInitialSelections(Object[] selectedElements)
Sets the initial selection in this selection dialog to the given elements.

Parameters:
selectedElements - the array of elements to select

setInitialElementSelections

public void setInitialElementSelections(List<Object> selectedElements)
Sets the initial selection in this selection dialog to the given elements.

Parameters:
selectedElements - the List of elements to select

setMessage

public void setMessage(String message)
Sets the message for this dialog.

Parameters:
message - the message

setTitle

public void setTitle(String title)
Sets the title for this dialog.

Parameters:
title - the title

setDialogBoundsSettings

public void setDialogBoundsSettings(org.eclipse.jface.dialogs.IDialogSettings settings,
                                    int strategy)
Set the dialog settings that should be used to save the bounds of this dialog. This method is provided so that clients that directly use SelectionDialogs without subclassing them may specify how the bounds of the dialog are to be saved.

Parameters:
settings - the IDialogSettings that should be used to store the bounds of the dialog
strategy - the integer constant specifying how the bounds are saved. Specified using Dialog.DIALOG_PERSISTLOCATION and Dialog.DIALOG_PERSISTSIZE.
Since:
3.2
See Also:
Dialog.getDialogBoundsStrategy(), Dialog.getDialogBoundsSettings()

setImage

public void setImage(org.eclipse.swt.graphics.Image image)
Sets the image for this dialog.

Parameters:
image - the image.

getFirstResult

public Object getFirstResult()
Returns the first element from the list of results. Returns null if no element has been selected.

Returns:
the first result element if one exists. Otherwise null is returned.

setIgnoreCase

public void setIgnoreCase(boolean ignoreCase)
Specifies if sorting, filtering and folding is case sensitive.

Parameters:
ignoreCase - whether casing should be ignored

isCaseIgnored

public boolean isCaseIgnored()
Returns if sorting, filtering and folding is case sensitive.

Returns:
boolean

setMatchEmptyString

public void setMatchEmptyString(boolean matchEmptyString)
Specifies whether everything or nothing should be filtered on empty filter string.

Parameters:
matchEmptyString - boolean

setMultipleSelection

public void setMultipleSelection(boolean isMultipleSelectionAllowed)
Specifies if multiple selection is allowed.

Parameters:
isMultipleSelectionAllowed - whether multiple selection is allowed

setAllowDuplicates

public void setAllowDuplicates(boolean allowDuplicates)
Specifies whether duplicate entries are displayed or not.

Parameters:
allowDuplicates - whether duplicates are allowed

setSize

public void setSize(int width,
                    int height)
Sets the list size in unit of characters.

Parameters:
width - the width of the list.
height - the height of the list.

setEmptyListMessage

public void setEmptyListMessage(String message)
Sets the message to be displayed if the list is empty.

Parameters:
message - the message to be displayed.

setEmptySelectionMessage

public void setEmptySelectionMessage(String message)
Sets the message to be displayed if the selection is empty.

Parameters:
message - the message to be displayed.

setValidator

public void setValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator validator)
Sets an optional validator to check if the selection is valid. The validator is invoked whenever the selection changes.

Parameters:
validator - the validator to validate the selection.

setFilter

public void setFilter(String filter)
Sets the filter pattern.

Parameters:
filter - the filter pattern.

getFilter

public String getFilter()
Returns the current filter pattern.

Returns:
returns the current filter pattern or null if filter was not set.

getFoldedElements

public Object[] getFoldedElements(int index)
Returns all elements which are folded together to one entry in the list.

Parameters:
index - the index selecting the entry in the list.
Returns:
returns an array of elements folded together.

open

public int open()
Overrides:
open in class org.eclipse.jface.window.Window

create

public void create()
Overrides:
create in class org.eclipse.jface.dialogs.Dialog

setElements

public void setElements(Object[] elements)
Sets the elements of the list.

Parameters:
elements - the elements of the list.

getFilteredList

public org.eclipse.ui.dialogs.FilteredList getFilteredList()
Returns the filtered list.

Returns:
the FilteredList


Copyright © 2015. All Rights Reserved.