net.sourceforge.rssowl.controller.dialog
Class SearchDialog

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

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.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
private  String dialogMessage
           
private static int dialogMinWidth
          Min. width of the dialog in DLUs
private  org.eclipse.swt.custom.CLabel errorMessageLabel
           
static String lastSearch
          Remember the last search
private static Vector lastSearches
          Remember all done searches in the running session
private  org.eclipse.swt.widgets.Button matchCaseSensitive
           
(package private)  org.eclipse.swt.widgets.Button okButton
           
(package private)  org.eclipse.swt.widgets.Button onlyWholeWords
           
(package private)  org.eclipse.swt.widgets.Button regExSearch
           
(package private)  org.eclipse.swt.widgets.Combo searchCombo
           
private  String title
           
private  String value
           
static boolean wasSearchCaseSensitive
          Remember if last search was case sensitive
static boolean wasSearchRegEx
          Remember if last search used RegEx
static boolean wasSearchWholeWord
          Remember if last search was on whole word
 
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
SearchDialog(org.eclipse.swt.widgets.Shell parentShell, String dialogTitle, String dialogMessage)
          Creates an input dialog with OK and Cancel buttons.
 
Method Summary
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)
           
 String getValue()
          Returns the string typed into this input dialog.
protected  void initializeBounds()
           
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.
protected  void setErrorMessage(String errorMessage)
          Set / unset the warning dialogMessage on the 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, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeDialogUnits, okPressed, setButtonLayoutFormData
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getInitialLocation, getInitialSize, 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

wasSearchCaseSensitive

public static boolean wasSearchCaseSensitive
Remember if last search was case sensitive


wasSearchRegEx

public static boolean wasSearchRegEx
Remember if last search used RegEx


wasSearchWholeWord

public static boolean wasSearchWholeWord
Remember if last search was on whole word


dialogMinWidth

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

See Also:
Constant Field Values

lastSearch

public static String lastSearch
Remember the last search


lastSearches

private static final Vector lastSearches
Remember all done searches in the running session


dialogMessage

private String dialogMessage

errorMessageLabel

private org.eclipse.swt.custom.CLabel errorMessageLabel

matchCaseSensitive

private org.eclipse.swt.widgets.Button matchCaseSensitive

title

private String title

value

private String value

okButton

org.eclipse.swt.widgets.Button okButton

onlyWholeWords

org.eclipse.swt.widgets.Button onlyWholeWords

regExSearch

org.eclipse.swt.widgets.Button regExSearch

searchCombo

org.eclipse.swt.widgets.Combo searchCombo
Constructor Detail

SearchDialog

public SearchDialog(org.eclipse.swt.widgets.Shell parentShell,
                    String dialogTitle,
                    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

getValue

public String getValue()
Returns the string typed into this input dialog.

Returns:
the input string

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)

initializeBounds

protected void initializeBounds()
See Also:
Dialog.initializeBounds()

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

setErrorMessage

protected void setErrorMessage(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