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

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

public class RemoveTreeElementDialog
extends TitleAreaDialog

Dialog to question the end-user if he is sure on his decision to remove a selected ITreeElement. The selection may either originate from the NewsFeedFavoritesTree or the NewsFeedWatchesTree component.

Author:
Sebastian Machhausen

Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
private  String dialogTitle
           The dialog title
private  Button dontAskAgainButton
           The Button checkbox to let the user decide if he wants this dialog to popup every time a tree element should be removed.
private  ITreeElement elementToRemove
           The questionable ITreeElement that is about to be removed
 
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
RemoveTreeElementDialog(Shell parentShell, ITreeElement elementToRemove, String dialogTitle)
           Creates a new RemoveTreeElementDialog using the specified dialog settings.
 
Method Summary
protected  void buttonPressed(int buttonId)
           Called whenever a button is pressed in this RemoveTreeElementDialog.
 boolean close()
           Called when the dialog closes.
protected  void configureShell(Shell shell)
           Configures the Shell representing this dialog.
protected  void createButtonsForButtonBar(Composite parent)
           Create the buttons used in this RemoveTreeElementDialog.
protected  Control createDialogArea(Composite parent)
           Creates the dialog area of this RemoveTreeElementDialog.
protected  void initializeBounds()
           Initializes the bounds of this RemoveTreeElementDialog by setting up its initial size and location.
private  void updateConfiguration()
           Updates the confguration according to the selections made in this RemoveTreeElementDialog.
 
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, 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

dialogTitle

private String dialogTitle

The dialog title


elementToRemove

private ITreeElement elementToRemove

The questionable ITreeElement that is about to be removed


dontAskAgainButton

private Button dontAskAgainButton

The Button checkbox to let the user decide if he wants this dialog to popup every time a tree element should be removed.

Constructor Detail

RemoveTreeElementDialog

public RemoveTreeElementDialog(Shell parentShell,
                               ITreeElement elementToRemove,
                               String dialogTitle)

Creates a new RemoveTreeElementDialog using the specified dialog settings.

Parameters:
parentShell - the parent shell of this dialog
elementToRemove - the questionable ITreeElement that is about to be removed
dialogTitle - the title of this dialog
Method Detail

close

public boolean close()

Called when the dialog closes.

Returns:
true if the dialog should close; false 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 RemoveTreeElementDialog.

Parameters:
parent - the parent component to embed the dialog area into
Returns:
the created dialog area

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

Create the buttons used in this RemoveTreeElementDialog.

Parameters:
parent - the parent component to embed the buttons into

buttonPressed

protected void buttonPressed(int buttonId)

Called whenever a button is pressed in this RemoveTreeElementDialog.

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

initializeBounds

protected void initializeBounds()

Initializes the bounds of this RemoveTreeElementDialog by setting up its initial size and location.


updateConfiguration

private void updateConfiguration()

Updates the confguration according to the selections made in this RemoveTreeElementDialog.