net.officefloor.eclipse.wizard.officesource
Class OfficeSourceWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by net.officefloor.eclipse.wizard.officesource.OfficeSourceWizard
All Implemented Interfaces:
OfficeSourceInstanceContext, org.eclipse.jface.wizard.IWizard

public class OfficeSourceWizard
extends org.eclipse.jface.wizard.Wizard
implements OfficeSourceInstanceContext

IWizard to add and manage Office instances.

Author:
Daniel Sagenschneider

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
OfficeSourceWizard(org.eclipse.core.resources.IProject project)
          Initiate to create a new OfficeInstance.
OfficeSourceWizard(org.eclipse.core.resources.IProject project, OfficeInstance officeInstance)
          Initiate.
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
static Map<String,OfficeSourceInstance> createOfficeSourceInstanceMap(ClassLoader classLoader, org.eclipse.core.resources.IProject project, OfficeSourceInstanceContext context)
          Creates the mapping of OfficeSource class name to its OfficeSourceInstance.
 org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
           
 OfficeInstance getOfficeInstance()
          Obtains the OfficeInstance.
static OfficeInstance getOfficeInstance(AbstractOfficeFloorEditPart<?,?,?> editPart, OfficeInstance officeInstance)
          Facade method to obtain the OfficeInstance.
 boolean performFinish()
           
 void setErrorMessage(String message)
          Specifies an error message.
 void setOfficeLoaded(boolean isOfficeTypeLoaded)
          Flags if OfficeType 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

OfficeSourceWizard

public OfficeSourceWizard(org.eclipse.core.resources.IProject project)
Initiate to create a new OfficeInstance.

Parameters:
project - IProject.

OfficeSourceWizard

public OfficeSourceWizard(org.eclipse.core.resources.IProject project,
                          OfficeInstance officeInstance)
Initiate.

Parameters:
project - IProject.
officeInstance - OfficeInstance to be edited, or null to create a new OfficeInstance.
Method Detail

getOfficeInstance

public static OfficeInstance getOfficeInstance(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                               OfficeInstance officeInstance)
Facade method to obtain the OfficeInstance.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the OfficeSourceWizard.
officeInstance - OfficeInstance to based decisions. null if creating new OfficeInstance.
Returns:
OfficeInstance or null if canceled.

createOfficeSourceInstanceMap

public static Map<String,OfficeSourceInstance> createOfficeSourceInstanceMap(ClassLoader classLoader,
                                                                             org.eclipse.core.resources.IProject project,
                                                                             OfficeSourceInstanceContext context)
Creates the mapping of OfficeSource class name to its OfficeSourceInstance.

Parameters:
classLoader - ClassLoader.
project - IProject.
context - OfficeSourceInstanceContext.
Returns:
Mapping of OfficeSource class name to its OfficeSourceInstance.

getOfficeInstance

public OfficeInstance getOfficeInstance()
Obtains the OfficeInstance.

Returns:
OfficeInstance.

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

setTitle

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

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

setErrorMessage

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

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

setOfficeLoaded

public void setOfficeLoaded(boolean isOfficeTypeLoaded)
Description copied from interface: OfficeSourceInstanceContext
Flags if OfficeType is loaded.

Specified by:
setOfficeLoaded in interface OfficeSourceInstanceContext


Copyright © 2005-2013. All Rights Reserved.