net.sourceforge.rssowl.controller.dialog
Class SearchDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by net.sourceforge.rssowl.controller.dialog.SearchDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

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

Class displays a Dialog to search for a phrase in a newsfeed or a category of newsfeeds. Search features: Entire word only, Regard case-sensitivity, Use regular expression

Version:
1.2.4
Author:
Benjamin Pasero

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
(package private)  Category category
           
private  java.lang.String dialogMessage
           
private static int dialogMinWidth
          Min. width of the dialog in DLUs
private  CLabel errorMessageLabel
           
private static java.util.ArrayList lastSearches
          Remember all done searches in the running session
private  Button matchCaseSensitive
           
(package private)  Button okButton
           
(package private)  Button onlyWholeWords
           
(package private)  Button regExSearch
           
private  Combo scopeCombo
           
(package private)  Combo searchCombo
           
private  SearchDefinition searchDefinition
           
private  Button selectCategory
           
private  java.lang.String title
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, 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
SearchDialog(Shell parentShell, Category category, java.lang.String dialogTitle, java.lang.String dialogMessage)
          Creates an input dialog with OK and Cancel buttons.
SearchDialog(Shell parentShell, java.lang.String dialogTitle, java.lang.String dialogMessage)
          Creates an input dialog with OK and Cancel buttons.
 
Method Summary
protected  void buttonPressed(int buttonId)
           
protected  void configureShell(Shell shell)
           
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
 Category getCategory()
          If this is a search on a Category, get the selected Category.
protected  int getShellStyle()
           
 SearchDefinition getValue()
          Return the Pattern and Scope of the Search.
protected  void initializeBounds()
           
protected  void setButtonLayoutData(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.
protected  void setErrorMessage(java.lang.String errorMessage)
          Set / unset the warning dialogMessage on the dialog
private  void showSearch(SearchDefinition searchDefinition)
          Reflect the state of a Search Definition in this Dialog.
 
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, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, 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

dialogMinWidth

private static final int dialogMinWidth
Min. width of the dialog in DLUs

See Also:
Constant Field Values

lastSearches

private static final java.util.ArrayList lastSearches
Remember all done searches in the running session


dialogMessage

private java.lang.String dialogMessage

errorMessageLabel

private CLabel errorMessageLabel

matchCaseSensitive

private Button matchCaseSensitive

scopeCombo

private Combo scopeCombo

searchDefinition

private SearchDefinition searchDefinition

selectCategory

private Button selectCategory

title

private java.lang.String title

category

Category category

okButton

Button okButton

onlyWholeWords

Button onlyWholeWords

regExSearch

Button regExSearch

searchCombo

Combo searchCombo
Constructor Detail

SearchDialog

public SearchDialog(Shell parentShell,
                    Category category,
                    java.lang.String dialogTitle,
                    java.lang.String dialogMessage)
Creates an input dialog with OK and Cancel buttons. Prompts for a search phrase. 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
category - If the search is running on a Category, or NULL if not.
dialogTitle - the dialog title, or null if none
dialogMessage - the dialog dialogMessage, or null if none

SearchDialog

public SearchDialog(Shell parentShell,
                    java.lang.String dialogTitle,
                    java.lang.String dialogMessage)
Creates an input dialog with OK and Cancel buttons. Prompts for a search phrase. 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
dialogMessage - the dialog dialogMessage, or null if none
Method Detail

getCategory

public Category getCategory()
If this is a search on a Category, get the selected Category.

Returns:
Category that is selected if this search is running on a Category.

getValue

public SearchDefinition getValue()
Return the Pattern and Scope of the Search.

Returns:
SearchDefinition Scope and Pattern of the Search.

showSearch

private void showSearch(SearchDefinition searchDefinition)
Reflect the state of a Search Definition in this Dialog.

Parameters:
searchDefinition - The Search Definition to display.

buttonPressed

protected void buttonPressed(int buttonId)
Overrides:
buttonPressed in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.buttonPressed(int)

configureShell

protected void configureShell(Shell shell)
Overrides:
configureShell in class org.eclipse.jface.window.Window
See Also:
Window.configureShell(org.eclipse.swt.widgets.Shell)

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)
Overrides:
createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)

createDialogArea

protected Control createDialogArea(Composite parent)
Overrides:
createDialogArea in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.createDialogArea(org.eclipse.swt.widgets.Composite)

getShellStyle

protected int getShellStyle()
Overrides:
getShellStyle in class org.eclipse.jface.window.Window
See Also:
Window.getShellStyle()

initializeBounds

protected void initializeBounds()
Overrides:
initializeBounds in class org.eclipse.jface.dialogs.Dialog
See Also:
Dialog.initializeBounds()

setButtonLayoutData

protected void setButtonLayoutData(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.

Overrides:
setButtonLayoutData in class org.eclipse.jface.dialogs.Dialog
Parameters:
button - The button to layout

setErrorMessage

protected void setErrorMessage(java.lang.String errorMessage)
Set / unset the warning dialogMessage on the dialog

Parameters:
errorMessage - The warning dialogMessage or NULL for no warning


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo