com.ibm.lab.soln.dialogs
Class StructureNewFileWizardPage

java.lang.Object
  |
  +--org.eclipse.jface.dialogs.DialogPage
        |
        +--org.eclipse.jface.wizard.WizardPage
              |
              +--org.eclipse.ui.dialogs.WizardNewFileCreationPage
                    |
                    +--com.ibm.lab.soln.dialogs.StructureNewFileWizardPage
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage, org.eclipse.swt.widgets.Listener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener

public class StructureNewFileWizardPage
extends org.eclipse.ui.dialogs.WizardNewFileCreationPage
implements org.eclipse.swt.events.SelectionListener

Wizard page designed to create new file resources as part of a continuous flow multi-page wizard as implemented by the StructureWizard. Also allows for selection of the next resource creation page, by type.

Demonstrates dynamic addition and control of wizard pages in a wizard.


Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
StructureNewFileWizardPage(java.lang.String pageName, org.eclipse.jface.viewers.IStructuredSelection selection, org.eclipse.jface.wizard.Wizard parent)
          Constructor for StructureNewFileWizardPage.
 
Method Summary
 boolean canFlipToNextPage()
          Alternate version of the canFlipToNextPage() method that only allows the Next button to be enabled if another resource creation page has been selected.
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Creates the top level dialog control under the given parent composite.
 boolean finish()
          Creates the resource if the page has not been disabled.
 org.eclipse.jface.wizard.IWizardPage getNextPage()
          Alternate version of the getNextPage() method that adds the selected new resource page as the next page.
 void setVisible(boolean visible)
          Only validate resource name entry after first entry, so as not to block page description during initial display.
protected  boolean validatePage()
          Reworked validate page logic forces true when page is to be ignored.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
           
 void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
          Identifies if another resource creation page has been requested in the wizard flow.
 
Methods inherited from class org.eclipse.ui.dialogs.WizardNewFileCreationPage
createFile, createFileHandle, createNewFile, getContainerFullPath, getFileName, getInitialContents, getNewFileLabel, handleEvent, initialPopulateContainerNameField, setContainerFullPath, setFileName
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
getContainer, getDialogSettings, getImage, getName, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, performHelp, setControl, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
dispose, getControl, getDescription, getErrorMessage, getMessage, getTitle, performHelp
 

Constructor Detail

StructureNewFileWizardPage

public StructureNewFileWizardPage(java.lang.String pageName,
                                  org.eclipse.jface.viewers.IStructuredSelection selection,
                                  org.eclipse.jface.wizard.Wizard parent)
Constructor for StructureNewFileWizardPage.
Parameters:
pageName -  
selection -  
Method Detail

canFlipToNextPage

public boolean canFlipToNextPage()
Alternate version of the canFlipToNextPage() method that only allows the Next button to be enabled if another resource creation page has been selected. This is determined by the selection event listener logic for the buttons added in createControl().
Overrides:
canFlipToNextPage in class org.eclipse.jface.wizard.WizardPage
See Also:
IWizardPage.canFlipToNextPage()

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Creates the top level dialog control under the given parent composite.

Implementors are responsible for ensuring that the created control can be accessed via getControl. This is done by identifying the main control you create using the setControl method.

Overrides:
createControl in class org.eclipse.ui.dialogs.WizardNewFileCreationPage
Parameters:
parent - the parent composite
See Also:
IDialogPage.createControl(Composite)

finish

public boolean finish()
Creates the resource if the page has not been disabled. May be called as the next page is requested, or by the wizard finish() method.

getNextPage

public org.eclipse.jface.wizard.IWizardPage getNextPage()
Alternate version of the getNextPage() method that adds the selected new resource page as the next page. Once created and added to the wizard, the next page selection options are disabled. The page can be disabled, but not removed from the current page set.
Overrides:
getNextPage in class org.eclipse.jface.wizard.WizardPage
See Also:
IWizardPage.getNextPage()

setVisible

public void setVisible(boolean visible)
Only validate resource name entry after first entry, so as not to block page description during initial display.
Overrides:
setVisible in class org.eclipse.ui.dialogs.WizardNewFileCreationPage
See Also:
IDialogPage.setVisible(boolean)

validatePage

protected boolean validatePage()
Reworked validate page logic forces true when page is to be ignored. This allows for invalid or missing resource names to be ignored when they will not be processed.
Overrides:
validatePage in class org.eclipse.ui.dialogs.WizardNewFileCreationPage
See Also:
WizardNewFolderMainPage.validatePage()

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
Identifies if another resource creation page has been requested in the wizard flow. Choice is flexible until the page has been entered.
Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
See Also:
SelectionListener.widgetSelected(SelectionEvent)