net.sourceforge.rssowl.controller.dialog
Class SelectCategoryDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended bynet.sourceforge.rssowl.controller.dialog.SelectCategoryDialog

public class SelectCategoryDialog
extends org.eclipse.jface.dialogs.Dialog

This dialog is used to select a category from a tree that is displaying all categories, without blogrolls.

Version:
1.1.3
Author:
Benjamin Pasero

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
(package private)  org.eclipse.swt.widgets.Tree categoryTree
           
private  String catPath
           
private static org.eclipse.swt.graphics.Rectangle dialogShellSize
          Bounds of the shell
private  String title
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_LOCKED, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
SelectCategoryDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle)
          Creates an dialog with a tree filled with all categories.
 
Method Summary
(package private)  void buildCatTree()
          Recursivly write all categorys and subcategories to the tree
private  void buildCatTree(org.eclipse.swt.widgets.TreeItem parent, Category cat)
          Recursivly write all categorys and subcategories to the tree
protected  void buttonPressed(int buttonId)
           
protected  void configureShell(org.eclipse.swt.widgets.Shell shell)
           
protected  void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
           
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
           
(package private)  void createNewCategory()
          Opens the New Category dialog and prompts for a name of the new category.
 String getCatPath()
          Get the selected category as String path
private  String getCatPath(org.eclipse.swt.widgets.TreeItem treeItem)
          Get the category path beginning with the given treeitem.
protected  org.eclipse.swt.graphics.Point getInitialSize()
           
(package private)  Category getSelectedCategory()
          Get the associated Category model object for the selection in the category tree or the root category if no selection was made or the tree is empty
protected  void setButtonLayoutData(org.eclipse.swt.widgets.Button button)
          Set the layout data of the button to a GridData with appropriate widths This method was slightly modified so that it is not setting a heightHint.
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createContents, dialogFontIsDefault, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setButtonLayoutFormData
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getInitialLocation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dialogShellSize

private static final org.eclipse.swt.graphics.Rectangle dialogShellSize
Bounds of the shell


catPath

private String catPath

title

private String title

categoryTree

org.eclipse.swt.widgets.Tree categoryTree
Constructor Detail

SelectCategoryDialog

public SelectCategoryDialog(org.eclipse.swt.widgets.Shell parentShell,
                            String dialogTitle)
Creates an dialog with a tree filled with all categories. 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
dialogTitle - the dialog title, or null if none
Method Detail

getCatPath

public String getCatPath()
Get the selected category as String path

Returns:
String The selected category as category String path

buildCatTree

private void buildCatTree(org.eclipse.swt.widgets.TreeItem parent,
                          Category cat)
Recursivly write all categorys and subcategories to the tree

Parameters:
parent - The parent treeitem
cat - Current Category

getCatPath

private String getCatPath(org.eclipse.swt.widgets.TreeItem treeItem)
Get the category path beginning with the given treeitem.

Parameters:
treeItem - The entry point for the category path String
Returns:
String A String represenation of the selected category

buttonPressed

protected void buttonPressed(int buttonId)
See Also:
Dialog.buttonPressed(int)

configureShell

protected void configureShell(org.eclipse.swt.widgets.Shell shell)
See Also:
Window.configureShell(org.eclipse.swt.widgets.Shell)

createButtonsForButtonBar

protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
See Also:
Dialog.createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)

createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
See Also:
Dialog.createDialogArea(org.eclipse.swt.widgets.Composite)

getInitialSize

protected org.eclipse.swt.graphics.Point getInitialSize()
See Also:
Window.getInitialSize()

setButtonLayoutData

protected void setButtonLayoutData(org.eclipse.swt.widgets.Button button)
Set the layout data of the button to a GridData with appropriate widths This method was slightly modified so that it is not setting a heightHint.

Parameters:
button - The button to layout

buildCatTree

void buildCatTree()
Recursivly write all categorys and subcategories to the tree


createNewCategory

void createNewCategory()
Opens the New Category dialog and prompts for a name of the new category. The new category will be created as sub-category of the selected one, or in the case the tree is empty, created as child of the tree.


getSelectedCategory

Category getSelectedCategory()
Get the associated Category model object for the selection in the category tree or the root category if no selection was made or the tree is empty

Returns:
Category The selected category or the root category


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo