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

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

public class CategorySelectionDialog
extends TitleAreaDialog

Dialog to select a Category from the NewsFeedFavoritesTree.

Author:
Sebastian Machhausen

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
private  TreeViewerContentProvider contentProvider
           The TreeViewerContentProvider to act as model bridge
private  LanguageResource defaultResource
           Default language resource used in this dialog
private  String dialogTitle
           The dialog title
private  Category dummyRoot
           A dummy root Category to achive that the actual root Category which is normally invisible is displayed.
private  Category excludedCategory
          The Category to exclude from potential selections
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
private  Category selectedCategory
           The selected Category<
private  TreeViewer viewer
           The TreeViewer to use for selection
 
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
CategorySelectionDialog(MainApplicationWindow mainWindow, String dialogTitle, Category selectedCategory, Category excludedCategory)
           Creates a new CategorySelectionDialog instance.
 
Method Summary
protected  void buttonPressed(int buttonId)
           Called whenever a button is pressed in this CategorySelectionDialog.
 boolean close()
           Closes this CategorySelectionDialog.
protected  void configureShell(Shell shell)
           Configures the Shell representing this CategorySelectionDialog
protected  void createButtonsForButtonBar(Composite parent)
           Creates the buttons used in this CategorySelectionDialog and sets up their default enabled state.
protected  Control createDialogArea(Composite parent)
           Creates the dialog area of this CategorySelectionDialog.
private  void createTree(Composite parent)
           Creates the TreeViewer and Tree instance used to select a single Category from the NewsFeedFavoritesTree.
 void dispose()
           Disposes this CategorySElectionDialog.
 Category getSelection()
           Gets the selected Category.
 
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
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


contentProvider

private TreeViewerContentProvider contentProvider

The TreeViewerContentProvider to act as model bridge


viewer

private TreeViewer viewer

The TreeViewer to use for selection


selectedCategory

private Category selectedCategory

The selected Category<


excludedCategory

private Category excludedCategory
The Category to exclude from potential selections


dummyRoot

private Category dummyRoot

A dummy root Category to achive that the actual root Category which is normally invisible is displayed.


defaultResource

private LanguageResource defaultResource

Default language resource used in this dialog

Constructor Detail

CategorySelectionDialog

public CategorySelectionDialog(MainApplicationWindow mainWindow,
                               String dialogTitle,
                               Category selectedCategory,
                               Category excludedCategory)

Creates a new CategorySelectionDialog instance.

Parameters:
mainWindow - the Feed'n Read main window
dialogTitle - the title of this dialog
selectedCategory - the Category to preselect
excludedCategory - the Category to exclude from potential selections
Method Detail

dispose

public void dispose()

Disposes this CategorySElectionDialog.


close

public boolean close()

Closes this CategorySelectionDialog.

Returns:
true if this CategorySelectionDialog is (or was already) closed, and false if it is still open

getSelection

public Category getSelection()

Gets the selected Category.

Returns:
the selected Category

configureShell

protected void configureShell(Shell shell)

Configures the Shell representing this CategorySelectionDialog

Parameters:
shell - the Shell to configure

createDialogArea

protected Control createDialogArea(Composite parent)

Creates the dialog area of this CategorySelectionDialog.

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

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

createTree

private void createTree(Composite parent)

Creates the TreeViewer and Tree instance used to select a single Category from the NewsFeedFavoritesTree.

Parameters:
parent - the parent Composite to embed the created Tree into