net.officefloor.eclipse.wizard.sectionsource
Class SectionSourceWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by net.officefloor.eclipse.wizard.sectionsource.SectionSourceWizard
All Implemented Interfaces:
SectionSourceInstanceContext, org.eclipse.jface.wizard.IWizard

public class SectionSourceWizard
extends org.eclipse.jface.wizard.Wizard
implements SectionSourceInstanceContext

IWizard to add and manage OfficeSection instances.

Author:
Daniel Sagenschneider

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
SectionSourceWizard(boolean isLoadType, org.eclipse.core.resources.IProject project, boolean isAutoWire)
          Initiate to create a new SectionInstance.
SectionSourceWizard(boolean isLoadType, org.eclipse.core.resources.IProject project, SectionInstance sectionInstance, boolean isAutoWire)
          Initiate.
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
static Map<String,SectionSourceInstance> createSectionSourceInstanceMap(ClassLoader classLoader, org.eclipse.core.resources.IProject project, SectionSourceInstanceContext context)
          Creates the mapping of SectionSource class name to its SectionSourceInstance.
 org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
           
 SectionInstance getSectionInstance()
          Obtains the SectionInstance.
static SectionInstance getSectionInstance(boolean isLoadType, AbstractOfficeFloorEditPart<?,?,?> editPart, SectionInstance sectionInstance, boolean isAutoWire)
          Facade method to obtain the SectionInstance.
 boolean isLoadType()
          Flags to load the SectionType rather than the OfficeSection.
static SectionInstance loadOfficeSection(AbstractOfficeFloorEditPart<?,?,?> editPart, SectionInstance sectionInstance, boolean isAutoWire)
          Facade method to obtain the SectionInstance containing the loaded OfficeSection.
static SectionInstance loadSectionType(AbstractOfficeFloorEditPart<?,?,?> editPart, SectionInstance sectionInstance, boolean isAutoWire)
          Facade method to obtain the SectionInstance containing the loaded SectionType.
 boolean performFinish()
           
 void setErrorMessage(String message)
          Specifies an error message.
 void setSectionLoaded(boolean isSectionTypeLoaded)
          Flags if SectionType or OfficeSection is loaded.
 void setTitle(String title)
          Specifies the title.
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionSourceWizard

public SectionSourceWizard(boolean isLoadType,
                           org.eclipse.core.resources.IProject project,
                           boolean isAutoWire)
Initiate to create a new SectionInstance.

Parameters:
isLoadType - Flag indicating to load SectionType rather than OfficeSection.
project - IProject.
isAutoWire - Flag indicating if configuring for auto-wire.

SectionSourceWizard

public SectionSourceWizard(boolean isLoadType,
                           org.eclipse.core.resources.IProject project,
                           SectionInstance sectionInstance,
                           boolean isAutoWire)
Initiate.

Parameters:
isLoadType - Flag indicating to load SectionType rather than OfficeSection.
project - IProject.
sectionInstance - SectionInstance to be edited, or null to create a new SectionInstance.
isAutoWire - Flag indicating if configuring for auto-wire.
Method Detail

loadSectionType

public static SectionInstance loadSectionType(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                              SectionInstance sectionInstance,
                                              boolean isAutoWire)
Facade method to obtain the SectionInstance containing the loaded SectionType.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the SectionSourceWizard.
sectionInstance - SectionInstance to based decisions. null if creating new SectionInstance.
isAutoWire - Flag indicating if configuring for auto-wire.
Returns:
SectionInstance or null if cancelled.

loadOfficeSection

public static SectionInstance loadOfficeSection(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                                SectionInstance sectionInstance,
                                                boolean isAutoWire)
Facade method to obtain the SectionInstance containing the loaded OfficeSection.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the SectionSourceWizard.
sectionInstance - SectionInstance to based decisions. null if creating new SectionInstance.
isAutoWire - Flag indicating if configuring for auto-wire.
Returns:
SectionInstance or null if cancelled.

getSectionInstance

public static SectionInstance getSectionInstance(boolean isLoadType,
                                                 AbstractOfficeFloorEditPart<?,?,?> editPart,
                                                 SectionInstance sectionInstance,
                                                 boolean isAutoWire)
Facade method to obtain the SectionInstance.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the SectionSourceWizard.
sectionInstance - SectionInstance to based decisions. null if creating new SectionInstance.
isAutoWire - Flag indicating if configuring for auto-wire.
Returns:
SectionInstance or null if cancelled.

createSectionSourceInstanceMap

public static Map<String,SectionSourceInstance> createSectionSourceInstanceMap(ClassLoader classLoader,
                                                                               org.eclipse.core.resources.IProject project,
                                                                               SectionSourceInstanceContext context)
Creates the mapping of SectionSource class name to its SectionSourceInstance.

Parameters:
classLoader - ClassLoader.
project - IProject.
context - SectionSourceInstanceContext.
Returns:
Mapping of SectionSource class name to its SectionSourceInstance.

getSectionInstance

public SectionInstance getSectionInstance()
Obtains the SectionInstance.

Returns:
SectionInstance.

addPages

public void addPages()
Specified by:
addPages in interface org.eclipse.jface.wizard.IWizard
Overrides:
addPages in class org.eclipse.jface.wizard.Wizard

getNextPage

public org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
Specified by:
getNextPage in interface org.eclipse.jface.wizard.IWizard
Overrides:
getNextPage in class org.eclipse.jface.wizard.Wizard

canFinish

public boolean canFinish()
Specified by:
canFinish in interface org.eclipse.jface.wizard.IWizard
Overrides:
canFinish in class org.eclipse.jface.wizard.Wizard

performFinish

public boolean performFinish()
Specified by:
performFinish in interface org.eclipse.jface.wizard.IWizard
Specified by:
performFinish in class org.eclipse.jface.wizard.Wizard

isLoadType

public boolean isLoadType()
Description copied from interface: SectionSourceInstanceContext
Flags to load the SectionType rather than the OfficeSection.

Specified by:
isLoadType in interface SectionSourceInstanceContext
Returns:
true to load SectionType, false to load OfficeSection.

setTitle

public void setTitle(String title)
Description copied from interface: SectionSourceInstanceContext
Specifies the title.

Specified by:
setTitle in interface SectionSourceInstanceContext
Parameters:
title - Title.

setErrorMessage

public void setErrorMessage(String message)
Description copied from interface: SectionSourceInstanceContext
Specifies an error message.

Specified by:
setErrorMessage in interface SectionSourceInstanceContext
Parameters:
message - Error message or null to indicate no error.

setSectionLoaded

public void setSectionLoaded(boolean isSectionTypeLoaded)
Description copied from interface: SectionSourceInstanceContext
Flags if SectionType or OfficeSection is loaded.

Specified by:
setSectionLoaded in interface SectionSourceInstanceContext


Copyright © 2005-2013. All Rights Reserved.