net.officefloor.eclipse.wizard.worksource
Class WorkSourceWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by net.officefloor.eclipse.wizard.worksource.WorkSourceWizard
All Implemented Interfaces:
WorkSourceInstanceContext, org.eclipse.jface.wizard.IWizard

public class WorkSourceWizard
extends org.eclipse.jface.wizard.Wizard
implements WorkSourceInstanceContext

IWizard to add and manage Work instances.

Author:
Daniel Sagenschneider

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
WorkSourceWizard(AbstractOfficeFloorEditPart<?,?,?> editPart)
          Initiate to create a new WorkInstance.
WorkSourceWizard(AbstractOfficeFloorEditPart<?,?,?> editPart, WorkInstance workInstance)
          Initiate.
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
static Map<String,WorkSourceInstance> createWorkSourceInstanceMap(ClassLoader classLoader, org.eclipse.core.resources.IProject project, WorkSourceInstanceContext context)
          Creates the mapping of WorkSource class name to its WorkSourceInstance.
 org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
           
 WorkInstance getWorkInstance()
          Obtains the WorkInstance.
static WorkInstance getWorkInstance(AbstractOfficeFloorEditPart<?,?,?> editPart, WorkInstance workInstance)
          Facade method to obtain the WorkInstance.
 boolean performFinish()
           
 void setErrorMessage(String message)
          Specifies an error message.
 void setTitle(String title)
          Specifies the title.
 void setWorkTypeLoaded(boolean isWorkTypeLoaded)
          Flags if WorkType is loaded.
 
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

WorkSourceWizard

public WorkSourceWizard(AbstractOfficeFloorEditPart<?,?,?> editPart)
Initiate to create a new WorkInstance.

Parameters:
editPart - AbstractOfficeFloorEditPart.

WorkSourceWizard

public WorkSourceWizard(AbstractOfficeFloorEditPart<?,?,?> editPart,
                        WorkInstance workInstance)
Initiate.

Parameters:
editPart - AbstractOfficeFloorEditPart.
workInstance - WorkInstance to be edited, or null to create a new WorkInstance.
Method Detail

getWorkInstance

public static WorkInstance getWorkInstance(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                           WorkInstance workInstance)
Facade method to obtain the WorkInstance.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the WorkSourceWizard.
workInstance - WorkInstance to based decisions. null if creating new WorkInstance.
Returns:
WorkInstance or null if cancelled.

createWorkSourceInstanceMap

public static Map<String,WorkSourceInstance> createWorkSourceInstanceMap(ClassLoader classLoader,
                                                                         org.eclipse.core.resources.IProject project,
                                                                         WorkSourceInstanceContext context)
Creates the mapping of WorkSource class name to its WorkSourceInstance.

Parameters:
classLoader - ClassLoader.
project - IProject.
context - WorkSourceInstanceContext.
Returns:
Mapping of WorkSource class name to its WorkSourceInstance.

getWorkInstance

public WorkInstance getWorkInstance()
Obtains the WorkInstance.

Returns:
WorkInstance.

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: WorkSourceInstanceContext
Specifies the title.

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

setErrorMessage

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

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

setWorkTypeLoaded

public void setWorkTypeLoaded(boolean isWorkTypeLoaded)
Description copied from interface: WorkSourceInstanceContext
Flags if WorkType is loaded.

Specified by:
setWorkTypeLoaded in interface WorkSourceInstanceContext


Copyright © 2005-2013. All Rights Reserved.