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

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.FavoriteInputDialog
All Implemented Interfaces:
IShellProvider

public class FavoriteInputDialog
extends TitleAreaDialog

Dialog to edit the properties of a Favorite.

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 this dialog
private  String dialogTitle
           The dialog title
private  Favorite editFavorite
           The Favorite to be edited
private  String favoriteTitle
           The title of the Favorite as entered by the end-user
private  Text favoriteTitleField
           The text field that carries the Favorite title user input
private  String favoriteUrl
           The newsfeed url of of the Favorite as entered by the end-user
private  Text favoriteUrlField
           The text field that carries the Favorite url user input
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
private  Category parentCategory
           The parent Category of the edited Favorite
private  JobExecutionInterval refreshInterval
           The refresh interval of the Favorite
private  ComboViewer refreshIntervalSelectionViewer
           ComboViewer to select the update interval of the Favorite
 
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
FavoriteInputDialog(MainApplicationWindow mainWindow, Favorite editFavorite, Category parentCategory, String dialogTitle)
           Creates a new FavoriteInputDialog using the specified dialog settings.
 
Method Summary
protected  void buttonPressed(int buttonId)
           Called whenever a button is pressed in this FavoriteInputDialog.
protected  void configureShell(Shell shell)
           Configures the Shell representing this dialog.
protected  void createButtonsForButtonBar(Composite parent)
           Creates the buttons used in this FavoriteInputDialog and sets up their default enabled state.
protected  Control createDialogArea(Composite parent)
           Creates the dialog area of this FavoriteInputDialog.
private  void createRefreshIntervalContainer(Composite parent)
           Creates a container which holds all ui items to select the update interval of a Favorite.
private  void createRefreshStatusContainer(Composite parent)
           Creates a container which shows information on the current refresh status of a Favorite.
 String getFavoriteTitle()
           Gets the Favorite's title as entered by the user.
 String getFavoriteUrl()
           Gets the Favorite's newsfeed url as entered by the user.
 Category getParentCategory()
           Gets the parent Category of the edited Favorite.
 JobExecutionInterval getRefreshInterval()
           Gets the Favorite's refresh interval as selected by the user.
private  String validateInput()
           Verifies if the current dialog 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


editFavorite

private Favorite editFavorite

The Favorite to be edited


parentCategory

private Category parentCategory

The parent Category of the edited Favorite


favoriteTitle

private String favoriteTitle

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


favoriteUrl

private String favoriteUrl

The newsfeed url of of the Favorite as entered by the end-user


favoriteTitleField

private Text favoriteTitleField

The text field that carries the Favorite title user input


favoriteUrlField

private Text favoriteUrlField

The text field that carries the Favorite url user input


refreshIntervalSelectionViewer

private ComboViewer refreshIntervalSelectionViewer

ComboViewer to select the update interval of the Favorite


refreshInterval

private JobExecutionInterval refreshInterval

The refresh interval of the Favorite


defaultResource

private LanguageResource defaultResource

Default language resource used in this dialog

Constructor Detail

FavoriteInputDialog

public FavoriteInputDialog(MainApplicationWindow mainWindow,
                           Favorite editFavorite,
                           Category parentCategory,
                           String dialogTitle)

Creates a new FavoriteInputDialog using the specified dialog settings.

Parameters:
mainWindow - the Feed'n Read main window
editFavorite - the favorite to edit; null if new favorite
dialogTitle - the title of this dialog
Method Detail

getFavoriteTitle

public String getFavoriteTitle()

Gets the Favorite's title as entered by the user.

Returns:
the Favorite title; null if this FavoriteInputDialog has been canceled

getFavoriteUrl

public String getFavoriteUrl()

Gets the Favorite's newsfeed url as entered by the user.

Returns:
the Favorite's newsfeed url;null if this FavoriteInputDialog has been canceled

getParentCategory

public Category getParentCategory()

Gets the parent Category of the edited Favorite.

Returns:
the parent Category of the edited Favorite

getRefreshInterval

public JobExecutionInterval getRefreshInterval()

Gets the Favorite's refresh interval as selected by the user.

Returns:
the Favorite's refresh interval as selected by the user; null if this FavoriteInputDialog has been canceled

validateInput

private String validateInput()

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

Returns:
an error message if the 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 FavoriteInputDialog.

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 FavoriteInputDialog 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 FavoriteInputDialog.

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

createRefreshIntervalContainer

private void createRefreshIntervalContainer(Composite parent)

Creates a container which holds all ui items to select the update interval of a Favorite.

Parameters:
parent - the parent Composite to embed the refresh interval container into

createRefreshStatusContainer

private void createRefreshStatusContainer(Composite parent)

Creates a container which shows information on the current refresh status of a Favorite.

Parameters:
parent - the parent Composite to embed the refresh status container into