ch.sahits.codegen.wizards
Class ArtefactCodeGenerator

java.lang.Object
  extended by ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
      extended by ch.sahits.codegen.wizards.ArtefactCodeGenerator
All Implemented Interfaces:
IProcessQueuedAction

public class ArtefactCodeGenerator
extends BasicGeneralCodeGenerator

This code generator is used to perform the code generation for any artefacts. Any subclass for the UI must override the method openFile4editing(IFile)

Since:
1.2.0
Author:
Andi Hotz

Field Summary
 
Fields inherited from class ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
delegate
 
Constructor Summary
ArtefactCodeGenerator(ICodeGeneratorDelegate delegatedGenerator)
          Constructor initializing the delegated code generator
 
Method Summary
 void doFinish(IProgressMonitor monitor, int modelWorkload, IBasicDBDefinitionPage dbDefinitionPage)
          This methods initiates the generation of the code for an arbitrary artifact.
protected  void openFile4editing(IFile file)
          Placeholder.
 
Methods inherited from class ch.sahits.codegen.wizards.BasicGeneralCodeGenerator
processQueuedElements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtefactCodeGenerator

public ArtefactCodeGenerator(ICodeGeneratorDelegate delegatedGenerator)
Constructor initializing the delegated code generator

Parameters:
delegatedGenerator - instance of IOutputFileModel
Method Detail

doFinish

public final void doFinish(IProgressMonitor monitor,
                           int modelWorkload,
                           IBasicDBDefinitionPage dbDefinitionPage)
                    throws java.io.FileNotFoundException,
                           java.io.IOException,
                           java.lang.ClassNotFoundException,
                           CoreException
This methods initiates the generation of the code for an arbitrary artifact.

Specified by:
doFinish in class BasicGeneralCodeGenerator
Parameters:
monitor - IProgressMonitor to track the progress
modelWorkload - Workload for the generation
dbDefinitionPage - current DB definition page
Throws:
java.io.FileNotFoundException - File could not be found
java.io.IOException - File could not be read
java.lang.ClassNotFoundException - Class not found on the class path
CoreException - some other exception

openFile4editing

protected void openFile4editing(IFile file)
Placeholder. Any UI class overriding this one must reimplement this method to actualiy open the file in an editor.

Parameters:
file - to be opend