net.officefloor.eclipse.wizard.worksource
Class WorkSourceInstance

java.lang.Object
  extended by net.officefloor.eclipse.wizard.worksource.WorkSourceInstance
All Implemented Interfaces:
CompilerIssues, WorkSourceExtensionContext

public class WorkSourceInstance
extends Object
implements WorkSourceExtensionContext, CompilerIssues

WorkSource instance.

Author:
Daniel Sagenschneider

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.officefloor.compile.issues.CompilerIssues
CompilerIssues.LocationType
 
Method Summary
 void addIssue(CompilerIssues.LocationType locationType, String location, OfficeFloorIssues.AssetType assetType, String assetName, String issueDescription)
           
 void addIssue(CompilerIssues.LocationType locationType, String location, OfficeFloorIssues.AssetType assetType, String assetName, String issueDescription, Throwable cause)
           
 void createControls(org.eclipse.swt.widgets.Composite page)
          Creates the Control instances to populate the WorkLoaderProperty instances.
 ClassLoader getClassLoader()
          Obtains the ClassLoader for adding the WorkSource.
 org.eclipse.core.resources.IProject getProject()
          Obtains the IProject that is adding the Work.
 PropertyList getPropertyList()
          Obtains the PropertyList to source the Work from the WorkSource.
 String getSuggestedWorkName()
          Obtains the suggested name for the Work.
 String getWorkSourceClassName()
          Obtains the fully qualified class name of the WorkSource.
 String getWorkSourceLabel()
          Obtains the label for the WorkSource.
 WorkType<?> getWorkType()
          Obtains the loaded WorkType.
 void loadWorkInstance(WorkInstance workInstance)
          Loads the particular WorkInstance for this WorkSourceInstance to configure properties from.
 void loadWorkType()
          Attempts to load the WorkType.
 void notifyPropertiesChanged()
           Notifies of a change to the PropertyList.
 void setErrorMessage(String message)
          Specifies an error message.
 void setTitle(String title)
          Specifies the title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadWorkInstance

public void loadWorkInstance(WorkInstance workInstance)
Loads the particular WorkInstance for this WorkSourceInstance to configure properties from.

Parameters:
workInstance - WorkInstance.

loadWorkType

public void loadWorkType()
Attempts to load the WorkType.


getWorkSourceLabel

public String getWorkSourceLabel()
Obtains the label for the WorkSource.

Returns:
Label for the WorkSource.

getWorkSourceClassName

public String getWorkSourceClassName()
Obtains the fully qualified class name of the WorkSource.

Returns:
WorkSource class name.

getPropertyList

public PropertyList getPropertyList()
Obtains the PropertyList to source the Work from the WorkSource.

Specified by:
getPropertyList in interface WorkSourceExtensionContext
Returns:
Populated PropertyList.

getWorkType

public WorkType<?> getWorkType()
Obtains the loaded WorkType.

Returns:
Loaded WorkType or null if issue loading.

getSuggestedWorkName

public String getSuggestedWorkName()
Obtains the suggested name for the Work.

Returns:
Suggested name for the Work.

createControls

public void createControls(org.eclipse.swt.widgets.Composite page)
Creates the Control instances to populate the WorkLoaderProperty instances.

Parameters:
page - Composite to add Control instances.
context - WorkSourceInstanceContext.

setTitle

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

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

setErrorMessage

public void setErrorMessage(String message)
Description copied from interface: WorkSourceExtensionContext
Specifies an error message. Calling this after notifying of property changes allows for overriding the error message reported to the user.

Specified by:
setErrorMessage in interface WorkSourceExtensionContext
Parameters:
message - Error message. null indicating no error.

notifyPropertiesChanged

public void notifyPropertiesChanged()
Description copied from interface: WorkSourceExtensionContext

Notifies of a change to the PropertyList.

This allows for to report issues in attempting to source the WorkType from the WorkSource with the PropertyList.

Specified by:
notifyPropertiesChanged in interface WorkSourceExtensionContext

getProject

public org.eclipse.core.resources.IProject getProject()
Description copied from interface: WorkSourceExtensionContext
Obtains the IProject that is adding the Work.

Specified by:
getProject in interface WorkSourceExtensionContext
Returns:
IProject that is adding the Work.

getClassLoader

public ClassLoader getClassLoader()
Description copied from interface: WorkSourceExtensionContext
Obtains the ClassLoader for adding the WorkSource.

Specified by:
getClassLoader in interface WorkSourceExtensionContext
Returns:
ClassLoader for adding the WorkSource.

addIssue

public void addIssue(CompilerIssues.LocationType locationType,
                     String location,
                     OfficeFloorIssues.AssetType assetType,
                     String assetName,
                     String issueDescription)
Specified by:
addIssue in interface CompilerIssues

addIssue

public void addIssue(CompilerIssues.LocationType locationType,
                     String location,
                     OfficeFloorIssues.AssetType assetType,
                     String assetName,
                     String issueDescription,
                     Throwable cause)
Specified by:
addIssue in interface CompilerIssues


Copyright © 2005-2013. All Rights Reserved.