Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.ui.dialogs
Class SaveAsDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended byorg.eclipse.jface.dialogs.TitleAreaDialog
              extended byorg.eclipse.ui.dialogs.SaveAsDialog


public class SaveAsDialog
extends 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 may be instantiated; it is not intended to be subclassed.

See Also:
ContainerGenerator


Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.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, 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
SaveAsDialog(Shell parentShell)
          Creates a new Save As dialog for no specific file.
 
Method Summary
 boolean close()
          The SaveAsDialog implementation of this Window method disposes of the banner image when the dialog is closed.
protected  void configureShell(Shell shell)
          Configures the given shell in preparation for opening this window in it.
protected  void createButtonsForButtonBar(Composite parent)
          Adds buttons to this dialog's button bar.
protected  Control createContents(Composite parent)
          The Dialog implementation of this Window method creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size.
protected  Control createDialogArea(Composite parent)
          Creates and returns the contents of the upper part of this dialog (above the button bar).
 IPath getResult()
          Returns the full path entered by the user.
protected  void okPressed()
          Notifies that the ok button of this dialog has been pressed.
protected  void setDialogComplete(boolean value)
          Sets the completion state of this dialog and adjusts the enable state of the Ok button accordingly.
 void setOriginalFile(IFile originalFile)
          Sets the original file to use.
 void setOriginalName(String originalName)
          Set the original file name to use.
 
Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
getInitialSize, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getInitialLocation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

 

 

SaveAsDialog

public SaveAsDialog(Shell parentShell)

Creates a new Save As dialog for no specific file.

Parameters:
parentShell - the parent shell
Method Detail

 

 

configureShell

protected void configureShell(Shell shell)

Description copied from class: Window
Configures the given shell in preparation for opening this window in it.

The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement.

Overrides:
configureShell in class Window

Parameters:
shell - the shell


 

 

createContents

protected Control createContents(Composite parent)

Description copied from class: Dialog
The Dialog implementation of this Window method creates and lays out the top level composite for the dialog, and determines the appropriate horizontal and vertical dialog units based on the font size. It then calls the createDialogArea and createButtonBar methods to create the dialog area and button bar, respectively. Overriding createDialogArea and createButtonBar are recommended rather than overriding this method.

Overrides:
createContents in class TitleAreaDialog


 

 

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 Dialog

See Also:
Window.close()


 

 

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

Description copied from class: Dialog
Adds buttons to this dialog's button bar.

The Dialog implementation of this framework method adds standard ok and cancel buttons using the createButton framework method. These standard buttons will be accessible from getCancelButton, and getOKButton. Subclasses may override.

Overrides:
createButtonsForButtonBar in class Dialog

Parameters:
parent - the button bar composite


 

 

createDialogArea

protected Control createDialogArea(Composite parent)

Description copied from class: TitleAreaDialog
Creates and returns the contents of the upper part of this dialog (above the button bar).

The Dialog implementation of this framework method creates and returns a new Composite with no margins and spacing. Subclasses should override.

Overrides:
createDialogArea in class TitleAreaDialog

Parameters:
parent - The parent composite to contain the dialog area
Returns:
the dialog area control


 

 

getResult

public 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


 

 

okPressed

protected void okPressed()

Description copied from class: Dialog
Notifies that the ok button of this dialog has been pressed.

The Dialog implementation of this framework method sets this dialog's return code to Window.OK and closes the dialog. Subclasses may override.

Overrides:
okPressed in class Dialog


 

 

setDialogComplete

protected void setDialogComplete(boolean value)

Sets the completion state of this dialog and adjusts the enable state of the Ok button accordingly.

Parameters:
value - true if this dialog is compelete, and false otherwise


 

 

setOriginalFile

public void setOriginalFile(IFile originalFile)

Sets the original file to use.

Parameters:
originalFile - the original file


 

 

setOriginalName

public void setOriginalName(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


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Eclipse Platform
Release 3.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.