public class ModelioWizardDialog extends ModelioDialog implements org.eclipse.jface.wizard.IWizardContainer2, org.eclipse.jface.dialogs.IPageChangeProvider
WizardDialog
Modifier and Type | Class and Description |
---|---|
protected static class |
ModelioWizardDialog.PageContainerFillLayout
A layout for a container which includes several pages, like a notebook,
wizard, or preference dialog.
|
Modifier and Type | Field and Description |
---|---|
static String |
WIZ_IMG_ERROR
Image registry key for error message image (value
"dialog_title_error_image" ). |
DLG_IMG_TITLE_BANNER
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
Constructor and Description |
---|
ModelioWizardDialog(org.eclipse.swt.widgets.Shell parentShell,
org.eclipse.jface.wizard.IWizard newWizard)
Creates a new wizard dialog for the given wizard.
|
Modifier and Type | Method and Description |
---|---|
void |
addButtonsInButtonBar(org.eclipse.swt.widgets.Composite parent) |
void |
addPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener listener) |
void |
addPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener listener)
Adds a listener for page changes to the list of page changing listeners
registered for this dialog.
|
protected void |
backPressed()
The Back button has been pressed.
|
protected void |
buttonPressed(int buttonId) |
protected void |
cancelPressed() |
boolean |
close() |
protected void |
configureShell(org.eclipse.swt.widgets.Shell newShell) |
protected void |
createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
Creates the buttons for this dialog's button bar.
|
org.eclipse.swt.widgets.Control |
createContentArea(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.swt.widgets.Control |
createContents(org.eclipse.swt.widgets.Composite parent)
The
WizardDialog implementation of this
Window method calls call IWizard.addPages
to allow the current wizard to add extra pages, then
super.createContents to create the controls. |
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.jface.wizard.ProgressMonitorPart |
createProgressMonitorPart(org.eclipse.swt.widgets.Composite composite,
org.eclipse.swt.layout.GridLayout pmlayout)
Hook method for subclasses to create a custom progress monitor part.
|
protected void |
finishPressed()
The Finish button has been pressed.
|
protected void |
firePageChanged(org.eclipse.jface.dialogs.PageChangedEvent event)
Notifies any selection changed listeners that the selected page has
changed.
|
protected void |
firePageChanging(org.eclipse.jface.dialogs.PageChangingEvent event)
Notifies any page changing listeners that the currently selected dialog
page is changing.
|
protected org.eclipse.swt.widgets.Button |
getButton(int id)
Return the cancel button if the id is a the cancel id.
|
org.eclipse.jface.wizard.IWizardPage |
getCurrentPage() |
protected org.eclipse.core.runtime.IProgressMonitor |
getProgressMonitor()
Returns the progress monitor for this wizard dialog (if it has one).
|
Object |
getSelectedPage() |
protected org.eclipse.jface.wizard.IWizard |
getWizard()
Returns the wizard this dialog is currently displaying.
|
protected void |
helpPressed()
The Help button has been pressed.
|
void |
init() |
protected void |
nextPressed()
The Next button has been pressed.
|
void |
removePageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener listener) |
void |
removePageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener listener)
Removes the provided page changing listener from the list of page
changing listeners registered for the dialog.
|
void |
run(boolean fork,
boolean cancelable,
org.eclipse.jface.operation.IRunnableWithProgress runnable)
This implementation of IRunnableContext#run(boolean, boolean,
IRunnableWithProgress) blocks until the runnable has been run, regardless
of the value of
fork . |
protected void |
setButtonLayoutData(org.eclipse.swt.widgets.Button button) |
void |
setMinimumPageSize(int minWidth,
int minHeight)
Sets the minimum page size used for the pages.
|
void |
setMinimumPageSize(org.eclipse.swt.graphics.Point size)
Sets the minimum page size used for the pages.
|
void |
setPageSize(int width,
int height)
Sets the size of all pages.
|
void |
setPageSize(org.eclipse.swt.graphics.Point size)
Sets the size of all pages.
|
protected void |
setWizard(org.eclipse.jface.wizard.IWizard newWizard)
Sets the wizard this dialog is currently displaying.
|
void |
showPage(org.eclipse.jface.wizard.IWizardPage page) |
protected void |
update()
Updates this dialog's controls to reflect the current page.
|
void |
updateButtons() |
void |
updateMessage() |
void |
updateSize() |
protected void |
updateSize(org.eclipse.jface.wizard.IWizardPage page)
Computes the correct dialog size for the current page and resizes its shell if necessary.
|
void |
updateTitleBar() |
void |
updateWindowTitle() |
addDefaultButtons, getHelpId, getInitialSize, setBlockOnOpen, setErrorMessage, setLogoImage, setMessage, setMessage, setTitle, setTitleLeftImage, setWarningMessage
closeTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
applyDialogFont, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutFormData, shortenText
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
public static final String WIZ_IMG_ERROR
"dialog_title_error_image"
).public ModelioWizardDialog(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.jface.wizard.IWizard newWizard)
parentShell
- the parent shellnewWizard
- the wizard this dialog is working onprotected void backPressed()
protected void buttonPressed(int buttonId)
buttonPressed
in class org.eclipse.jface.dialogs.Dialog
protected void cancelPressed()
cancelPressed
in class org.eclipse.jface.dialogs.Dialog
public boolean close()
close
in class org.eclipse.jface.dialogs.Dialog
protected void finishPressed()
protected void helpPressed()
protected void nextPressed()
public void setMinimumPageSize(int minWidth, int minHeight)
minWidth
- the minimum page widthminHeight
- the minimum page heightsetMinimumPageSize(Point)
public void setPageSize(int width, int height)
width
- the page widthheight
- the page heightsetPageSize(Point)
protected void update()
public void updateButtons()
updateButtons
in interface org.eclipse.jface.wizard.IWizardContainer
public void updateMessage()
updateMessage
in interface org.eclipse.jface.wizard.IWizardContainer
public void updateSize()
updateSize
in interface org.eclipse.jface.wizard.IWizardContainer2
public void updateTitleBar()
updateTitleBar
in interface org.eclipse.jface.wizard.IWizardContainer
public void updateWindowTitle()
updateWindowTitle
in interface org.eclipse.jface.wizard.IWizardContainer
public Object getSelectedPage()
getSelectedPage
in interface org.eclipse.jface.dialogs.IPageChangeProvider
public void init()
init
in interface IModelioDialog
protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
configureShell
in class org.eclipse.jface.window.Window
protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
The WizardDialog
implementation of this framework method
prevents the parent composite's columns from being made equal width in
order to remove the margin between the Back and Next buttons.
createButtonsForButtonBar
in class ModelioDialog
parent
- the parent composite to contain the buttonsprotected void setButtonLayoutData(org.eclipse.swt.widgets.Button button)
setButtonLayoutData
in class org.eclipse.jface.dialogs.Dialog
protected org.eclipse.swt.widgets.Button getButton(int id)
getButton
in class org.eclipse.jface.dialogs.Dialog
id
- the button idprotected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
WizardDialog
implementation of this
Window
method calls call IWizard.addPages
to allow the current wizard to add extra pages, then
super.createContents
to create the controls. It then calls
IWizard.createPageControls
to allow the wizard to
pre-create their page controls prior to opening, so that the wizard opens
to the correct size. And finally it shows the first page.createContents
in class ModelioDialog
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea
in class ModelioDialog
protected org.eclipse.jface.wizard.ProgressMonitorPart createProgressMonitorPart(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.layout.GridLayout pmlayout)
The default implementation creates a progress monitor with a stop button will be created.
composite
- the parent compositepmlayout
- the layoutpublic org.eclipse.jface.wizard.IWizardPage getCurrentPage()
getCurrentPage
in interface org.eclipse.jface.wizard.IWizardContainer
protected org.eclipse.core.runtime.IProgressMonitor getProgressMonitor()
null
if this wizard
dialog does not have oneprotected org.eclipse.jface.wizard.IWizard getWizard()
public void run(boolean fork, boolean cancelable, org.eclipse.jface.operation.IRunnableWithProgress runnable) throws InterruptedException, InvocationTargetException
fork
. It is recommended that
fork
is set to true in most cases. If fork
is set to false
, the runnable will run in the UI thread
and it is the runnable's responsibility to call
Display.readAndDispatch()
to ensure UI responsiveness.
UI state is saved prior to executing the long-running operation and is
restored after the long-running operation completes executing. Any
attempt to change the UI state of the wizard in the long-running
operation will be nullified when original UI state is restored.run
in interface org.eclipse.jface.operation.IRunnableContext
InterruptedException
InvocationTargetException
public void setMinimumPageSize(org.eclipse.swt.graphics.Point size)
size
- the page size encoded as new Point(width,height)
setMinimumPageSize(int,int)
public void setPageSize(org.eclipse.swt.graphics.Point size)
size
- the page size encoded as new Point(width,height)
setPageSize(int,int)
protected void setWizard(org.eclipse.jface.wizard.IWizard newWizard)
newWizard
- the wizardpublic void showPage(org.eclipse.jface.wizard.IWizardPage page)
showPage
in interface org.eclipse.jface.wizard.IWizardContainer
protected void updateSize(org.eclipse.jface.wizard.IWizardPage page)
page
- the wizard page to use to resize the dialogpublic void addPageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener listener)
addPageChangedListener
in interface org.eclipse.jface.dialogs.IPageChangeProvider
public void removePageChangedListener(org.eclipse.jface.dialogs.IPageChangedListener listener)
removePageChangedListener
in interface org.eclipse.jface.dialogs.IPageChangeProvider
protected void firePageChanged(org.eclipse.jface.dialogs.PageChangedEvent event)
event
- a selection changed eventIPageChangedListener.pageChanged(org.eclipse.jface.dialogs.PageChangedEvent)
public void addPageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener listener)
listener
- a page changing listenerpublic void removePageChangingListener(org.eclipse.jface.dialogs.IPageChangingListener listener)
listener
- a page changing listenerprotected void firePageChanging(org.eclipse.jface.dialogs.PageChangingEvent event)
event
- a selection changing eventIPageChangingListener.handlePageChanging(PageChangingEvent)
public void addButtonsInButtonBar(org.eclipse.swt.widgets.Composite parent)
addButtonsInButtonBar
in interface IModelioDialog
public org.eclipse.swt.widgets.Control createContentArea(org.eclipse.swt.widgets.Composite parent)
createContentArea
in interface IModelioDialog