Class FormDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.jface.dialogs.TrayDialog
-
- org.eclipse.ui.forms.FormDialog
-
- All Implemented Interfaces:
IShellProvider
public class FormDialog extends TrayDialog
A general-purpose dialog that hosts a form. Clients should extend the class and overridecreateFormContent(IManagedForm)protected method.Since forms with wrapped text typically don't have a preferred size, it is important to set the initial dialog size upon creation:
MyFormDialog dialog = new MyFormDialog(shell); dialog.create(); dialog.getShell().setSize(500, 500); dialog.open();
Otherwise, the dialog may open very wide.
- Since:
- 3.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
-
-
Field Summary
-
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, resizeHasOccurred
-
-
Constructor Summary
Constructors Constructor Description FormDialog(IShellProvider parentShellProvider)Creates a new form dialog for a provided parent shell provider.FormDialog(Shell shell)Creates a new form dialog for a provided parent shell.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclose()Closes this window, disposes its shell, and removes this window from its window manager (if it has one).protected ControlcreateButtonBar(Composite parent)Creates and returns the contents of this dialog's button bar.protected ControlcreateDialogArea(Composite parent)Creates and returns the contents of the upper part of this dialog (above the button bar).protected voidcreateFormContent(IManagedForm mform)Configures the dialog form and creates form content.-
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
-
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
-
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
-
-
-
Constructor Detail
-
FormDialog
public FormDialog(Shell shell)
Creates a new form dialog for a provided parent shell.- Parameters:
shell- the parent shell
-
FormDialog
public FormDialog(IShellProvider parentShellProvider)
Creates a new form dialog for a provided parent shell provider.- Parameters:
parentShellProvider- the parent shell provider
-
-
Method Detail
-
close
public boolean close()
Description copied from class:WindowCloses this window, disposes its shell, and removes this window from its window manager (if it has one).This framework method may be extended (
super.closemust be called).Note that in order to prevent recursive calls to this method it does not call
Shell#close(). As a resultShellListeners will not receive ashellClosedevent.- Overrides:
closein classDialog- Returns:
trueif the window is (or was already) closed, andfalseif it is still open- See Also:
Window.close()
-
createDialogArea
protected Control createDialogArea(Composite parent)
Description copied from class:DialogCreates and returns the contents of the upper part of this dialog (above the button bar).The
Dialogimplementation of this framework method creates and returns a newCompositewith standard margins and spacing.The returned control's layout data must be an instance of
GridData. This method must not modify the parent's layout.Subclasses must override this method but may call
superas in the following example:Composite composite = (Composite) super.createDialogArea(parent); //add controls to composite as necessary return composite;
- Overrides:
createDialogAreain classDialog- Parameters:
parent- the parent composite to contain the dialog area- Returns:
- the dialog area control
-
createButtonBar
protected Control createButtonBar(Composite parent)
Description copied from class:DialogCreates and returns the contents of this dialog's button bar.The
Dialogimplementation of this framework method lays out a button bar and calls thecreateButtonsForButtonBarframework method to populate it. Subclasses may override.The returned control's layout data must be an instance of
GridData.- Overrides:
createButtonBarin classTrayDialog- Parameters:
parent- the parent composite to contain the button bar- Returns:
- the button bar control
-
createFormContent
protected void createFormContent(IManagedForm mform)
Configures the dialog form and creates form content. Clients should override this method.- Parameters:
mform- the dialog form
-
-