net.sourceforge.java.feednread.frontend.dialog
Class WatchFolderInputDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended byorg.eclipse.jface.dialogs.TrayDialog
              extended byorg.eclipse.jface.dialogs.TitleAreaDialog
                  extended bynet.sourceforge.java.feednread.frontend.dialog.WatchFolderInputDialog
All Implemented Interfaces:
IInputValidator, IShellProvider

public class WatchFolderInputDialog
extends TitleAreaDialog
implements IInputValidator

Dialog to edit the properties of a WatchFolder.

Author:
Sebastian Machhausen

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
private  LanguageResource defaultResource
           Default language resource used in the dialog
private  String dialogTitle
           The dialog title
private  WatchFolder editFolder
           The WatchFolder to be edited, null if creating a new WatchFolder
private  String folderDescription
           The description of the WatchFolder as entered by the end-user
private  Text folderDescriptionField
           The Text filed that carries the description input
private  String folderTitle
           The title of the WatchFolder as entered by the end-user
private  Text folderTitleField
           The Text field that carries the title input
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
private  WatchFolder parentFolder
           The parent WatchFolder for which to create a new WatchFolder
 
Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
 
Fields inherited from class org.eclipse.jface.dialogs.TrayDialog
 
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
WatchFolderInputDialog(MainApplicationWindow mainWindow, WatchFolder parentFolder, WatchFolder editFolder, String dialogTitle)
           Creates a new WatchFolderInputDialog using the specified dialog settings.
 
Method Summary
protected  void buttonPressed(int buttonId)
           Called whenever a button is pressed in this WatchFolderInputDialog.
protected  void configureShell(Shell shell)
           Configures the Shell representing this dialog.
protected  void createButtonsForButtonBar(Composite parent)
           Creates the buttons used in this WatchFolderInputDialog and sets up their default enabled state.
protected  Control createDialogArea(Composite parent)
           Creates the dialog area of this WatchFolderInputDialog.
 String getFolderDescription()
           Gets the WatchFolder description as entered by the end-user.
 String getFolderTitle()
           Gets the WatchFolder title as entered by the end-user.
 WatchFolder getParentFolder()
           Gets the parent WatchFolder of the edited WatchFolder.
 String isValid(String newText)
           Verifies if the given input is valid.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
createContents, getInitialSize, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
close, closeTray, createButtonBar, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, 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

mainWindow

private MainApplicationWindow mainWindow

The Feed'n Read main window


dialogTitle

private String dialogTitle

The dialog title


parentFolder

private WatchFolder parentFolder

The parent WatchFolder for which to create a new WatchFolder


editFolder

private WatchFolder editFolder

The WatchFolder to be edited, null if creating a new WatchFolder


folderTitle

private String folderTitle

The title of the WatchFolder as entered by the end-user


folderDescription

private String folderDescription

The description of the WatchFolder as entered by the end-user


folderTitleField

private Text folderTitleField

The Text field that carries the title input


folderDescriptionField

private Text folderDescriptionField

The Text filed that carries the description input


defaultResource

private LanguageResource defaultResource

Default language resource used in the dialog

Constructor Detail

WatchFolderInputDialog

public WatchFolderInputDialog(MainApplicationWindow mainWindow,
                              WatchFolder parentFolder,
                              WatchFolder editFolder,
                              String dialogTitle)

Creates a new WatchFolderInputDialog using the specified dialog settings.

Parameters:
mainWindow - the Feed'n Read main window
parentFolder - the parent WatchFolder for which to create a new WatchFolder; code if the new WatchFolder has no parent WatchFolder
editFolder - the WatchFolder to edit; null if new WatchFolder
dialogTitle - the title of this dialog
Method Detail

getFolderTitle

public String getFolderTitle()

Gets the WatchFolder title as entered by the end-user.

Returns:
the WatchFolder title

getFolderDescription

public String getFolderDescription()

Gets the WatchFolder description as entered by the end-user.

Returns:
the WatchFolder description

getParentFolder

public WatchFolder getParentFolder()

Gets the parent WatchFolder of the edited WatchFolder.

Returns:
the parent WatchFolder of the edited WatchFolder

isValid

public String isValid(String newText)

Verifies if the given input is valid. Currently only an empty input is being declined.

Specified by:
isValid in interface IInputValidator
Parameters:
newText - the text to verify
Returns:
an error message if the given input is invalid; null otherwise

configureShell

protected void configureShell(Shell shell)

Configures the Shell representing this dialog.

Parameters:
shell - the Shell to configure

createDialogArea

protected Control createDialogArea(Composite parent)

Creates the dialog area of this WatchFolderInputDialog.

Parameters:
parent - the parent component to embed the dialog area into
Returns:
the created dialog area

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

Creates the buttons used in this WatchFolderInputDialog and sets up their default enabled state.

Parameters:
parent - the parent component to embed the buttons into

buttonPressed

protected void buttonPressed(int buttonId)

Called whenever a button is pressed in this WatchFolderInputDialog.

Parameters:
buttonId - the id of the button that was pressed
See Also:
for the button ids defined in the JFace framework