org.eclipse.datatools.sqltools.common.ui.dialog
Class SaveAsDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.TrayDialog
              extended by org.eclipse.jface.dialogs.TitleAreaDialog
                  extended by org.eclipse.datatools.sqltools.common.ui.dialog.SaveAsDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public class SaveAsDialog
extends org.eclipse.jface.dialogs.TitleAreaDialog

A standard "Save As" dialog which solicits a path from the user. The getResult method returns the path. Note that the folder at the specified path might not exist and might need to be created.

This class differs from org.eclipse.ui.dialogs.SaveAsDialog in that it allows user to create a project.

Author:
Hui Cao
See Also:
ContainerGenerator

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
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.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, 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
SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell)
          Creates a new Save As dialog for no specific file.
SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell, boolean execSaveAs)
          Creates a new Save As dialog for no specific file.
SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell, java.lang.String content)
          Creates a new Save As dialog (Used to save a result set object)
 
Method Summary
 boolean close()
          The SaveAsDialog implementation of this Window method disposes of the banner image when the dialog is closed.
 org.eclipse.ui.IEditorPart getEditor()
           
 org.eclipse.core.runtime.IPath getResult()
          Returns the full path entered by the user.
 void setOpenMode(boolean openMode)
           
 void setOriginalFile(org.eclipse.core.resources.IFile originalFile)
          Sets the original file to use.
 void setOriginalName(java.lang.String originalName)
          Set the original file name to use.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, create, getBlockedHandler, getImage, setBlockedHandler, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
getDefaultImage, getDefaultImages, getDefaultOrientation, getReturnCode, getShell, getWindowManager, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setWindowManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveAsDialog

public SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell,
                    boolean execSaveAs)
Creates a new Save As dialog for no specific file.

Parameters:
parentShell - the parent shell

SaveAsDialog

public SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell)
Creates a new Save As dialog for no specific file.

Parameters:
parentShell - the parent shell

SaveAsDialog

public SaveAsDialog(org.eclipse.swt.widgets.Shell parentShell,
                    java.lang.String content)
Creates a new Save As dialog (Used to save a result set object)

Parameters:
parentShell - the parent shell
Method Detail

close

public boolean close()
The SaveAsDialog implementation of this Window method disposes of the banner image when the dialog is closed.

Overrides:
close in class org.eclipse.jface.dialogs.TrayDialog

getResult

public org.eclipse.core.runtime.IPath getResult()
Returns the full path entered by the user.

Note that the file and container might not exist and would need to be created. See the IFile.create method and the ContainerGenerator class.

Returns:
the path, or null if Cancel was pressed

setOriginalFile

public void setOriginalFile(org.eclipse.core.resources.IFile originalFile)
Sets the original file to use.

Parameters:
originalFile - the original file

setOriginalName

public void setOriginalName(java.lang.String originalName)
Set the original file name to use. Used instead of setOriginalFile when the original resource is not an IFile. Must be called before create.

Parameters:
originalName - default file name

getEditor

public org.eclipse.ui.IEditorPart getEditor()

setOpenMode

public void setOpenMode(boolean openMode)