org.eclipse.mylar.internal.monitor.usage.ui
Class FileDisplayDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.IconAndMessageDialog
              extended by org.eclipse.jface.dialogs.MessageDialog
                  extended by org.eclipse.mylar.internal.monitor.usage.ui.FileDisplayDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public class FileDisplayDialog
extends org.eclipse.jface.dialogs.MessageDialog

Dialog that displays the contents of a file to the user

Author:
Shawn Minto

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
private static java.lang.String contents
           
 
Fields inherited from class org.eclipse.jface.dialogs.MessageDialog
ERROR, INFORMATION, NONE, QUESTION, WARNING
 
Fields inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
imageLabel, message, messageLabel
 
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
FileDisplayDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String dialogTitle, org.eclipse.swt.graphics.Image dialogTitleImage, java.lang.String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex, java.lang.String contents)
           
 
Method Summary
 org.eclipse.swt.widgets.Control createCustomArea(org.eclipse.swt.widgets.Composite parent)
           
static java.lang.String getContents(java.io.File f)
          Get the contents of an InputStream
static int openShowFile(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message, java.io.File file)
           
 
Methods inherited from class org.eclipse.jface.dialogs.MessageDialog
buttonPressed, configureShell, createButton, createButtonsForButtonBar, createDialogArea, customShouldTakeFocus, getButton, getButtonLabels, getDefaultButtonIndex, getImage, getMinimumMessageWidth, handleShellCloseEvent, openConfirm, openError, openInformation, openQuestion, openWarning, setButtonLabels, setButtons
 
Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
createButtonBar, createContents, createDialogAndButtonArea, createMessageArea, getErrorImage, getInfoImage, getMessageLabelStyle, getQuestionImage, getWarningImage
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, 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, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, 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

contents

private static java.lang.String contents
Constructor Detail

FileDisplayDialog

public FileDisplayDialog(org.eclipse.swt.widgets.Shell parentShell,
                         java.lang.String dialogTitle,
                         org.eclipse.swt.graphics.Image dialogTitleImage,
                         java.lang.String dialogMessage,
                         int dialogImageType,
                         java.lang.String[] dialogButtonLabels,
                         int defaultIndex,
                         java.lang.String contents)
Method Detail

openShowFile

public static int openShowFile(org.eclipse.swt.widgets.Shell parent,
                               java.lang.String title,
                               java.lang.String message,
                               java.io.File file)
                        throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

createCustomArea

public org.eclipse.swt.widgets.Control createCustomArea(org.eclipse.swt.widgets.Composite parent)
Overrides:
createCustomArea in class org.eclipse.jface.dialogs.MessageDialog

getContents

public static java.lang.String getContents(java.io.File f)
                                    throws java.io.FileNotFoundException
Get the contents of an InputStream

Parameters:
is - The InputStream to get the contents for
Returns:
The String representing the contents
Throws:
java.io.FileNotFoundException