Package org.csstudio.ui.util.dialogs
Class ResourceSelectionDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.csstudio.ui.util.dialogs.ResourceSelectionDialog
- All Implemented Interfaces:
IShellProvider
,Listener
This class represents a Dialog to choose a file in the workspace.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
Field Summary
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, resizeHasOccurred
-
Constructor Summary
ConstructorDescriptionResourceSelectionDialog
(Shell parentShell, String dialogMessage, String[] fileExtensions) Creates an input dialog with OK and Cancel buttons. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureShell
(Shell shell) protected Control
createDialogArea
(Composite parent) Returns the path to the selected resource.void
handleEvent
(Event event) protected void
void
setSelectedResource
(IPath path) Sets the initially selected resource.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, isResizable, 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
-
Constructor Details
-
ResourceSelectionDialog
Creates an input dialog with OK and Cancel buttons. Note that the dialog will have no visual representation (no widgets) until it is told to open.Note that the
open
method blocks for input dialogs.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shelldialogMessage
- the dialog message, ornull
if nonefileExtensions
- the file extensions of files to show in the dialog. Use an empty array ornull
to show only containers (folders).
-
-
Method Details
-
setSelectedResource
Sets the initially selected resource. Must be called before the dialog is displayed.- Parameters:
path
- the path to the initially selected resource.
-
configureShell
- Overrides:
configureShell
in classWindow
-
createDialogArea
- Overrides:
createDialogArea
in classDialog
-
okPressed
protected void okPressed() -
getSelectedResource
Returns the path to the selected resource.- Returns:
- the path to the selected resource, or
null
if no resource was selected.
-
handleEvent
- Specified by:
handleEvent
in interfaceListener
-