net.officefloor.eclipse.wizard.governancesource
Class GovernanceSourceWizard

java.lang.Object
  extended by org.eclipse.jface.wizard.Wizard
      extended by net.officefloor.eclipse.wizard.governancesource.GovernanceSourceWizard
All Implemented Interfaces:
GovernanceSourceInstanceContext, org.eclipse.jface.wizard.IWizard

public class GovernanceSourceWizard
extends org.eclipse.jface.wizard.Wizard
implements GovernanceSourceInstanceContext

IWizard to add and manage Governance instances.

Author:
Daniel Sagenschneider

Field Summary
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
GovernanceSourceWizard(org.eclipse.core.resources.IProject project)
          Initiate to create a new GovernanceInstance.
GovernanceSourceWizard(org.eclipse.core.resources.IProject project, GovernanceInstance governanceInstance)
          Initiate.
 
Method Summary
 void addPages()
           
 boolean canFinish()
           
static Map<String,GovernanceSourceInstance> createGovernanceSourceInstanceMap(ClassLoader classLoader, org.eclipse.core.resources.IProject project, GovernanceSourceInstanceContext context)
          Creates the mapping of GovernanceSource class name to its GovernanceSourceInstance.
 GovernanceInstance getGovernanceInstance()
          Obtains the GovernanceInstance.
static GovernanceInstance getGovernanceInstance(AbstractOfficeFloorEditPart<?,?,?> editPart, GovernanceInstance governanceInstance)
          Facade method to obtain the GovernanceInstance.
 org.eclipse.jface.wizard.IWizardPage getNextPage(org.eclipse.jface.wizard.IWizardPage page)
           
 boolean performFinish()
           
 void setErrorMessage(String message)
          Specifies an error message.
 void setGovernanceTypeLoaded(boolean isGovernanceTypeLoaded)
          Flags if GovernanceType 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

GovernanceSourceWizard

public GovernanceSourceWizard(org.eclipse.core.resources.IProject project)
Initiate to create a new GovernanceInstance.

Parameters:
project - IProject.

GovernanceSourceWizard

public GovernanceSourceWizard(org.eclipse.core.resources.IProject project,
                              GovernanceInstance governanceInstance)
Initiate.

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

getGovernanceInstance

public static GovernanceInstance getGovernanceInstance(AbstractOfficeFloorEditPart<?,?,?> editPart,
                                                       GovernanceInstance governanceInstance)
Facade method to obtain the GovernanceInstance.

Parameters:
editPart - AbstractOfficeFloorEditPart to obtain necessary objects to run the GovernanceSourceWizard.
governanceInstance - GovernanceInstance to base decisions. null if creating new GovernanceInstance.
Returns:
GovernanceInstance or null if cancelled.

createGovernanceSourceInstanceMap

public static Map<String,GovernanceSourceInstance> createGovernanceSourceInstanceMap(ClassLoader classLoader,
                                                                                     org.eclipse.core.resources.IProject project,
                                                                                     GovernanceSourceInstanceContext context)
Creates the mapping of GovernanceSource class name to its GovernanceSourceInstance.

Parameters:
classLoader - ClassLoader.
project - IProject.
context - GovernanceSourceInstanceContext.
Returns:
Mapping of GovernanceSource class name to its GovernanceSourceInstance.

getGovernanceInstance

public GovernanceInstance getGovernanceInstance()
Obtains the GovernanceInstance.

Returns:
GovernanceInstance.

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

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

setErrorMessage

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

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

setGovernanceTypeLoaded

public void setGovernanceTypeLoaded(boolean isGovernanceTypeLoaded)
Description copied from interface: GovernanceSourceInstanceContext
Flags if GovernanceType is loaded.

Specified by:
setGovernanceTypeLoaded in interface GovernanceSourceInstanceContext


Copyright © 2005-2013. All Rights Reserved.