ch.sahits.codegen.ui.wizards
Class JavaGenerationDefinition

java.lang.Object
  extended by CodeGenInputDefinitionPage
      extended by ch.sahits.codegen.ui.wizards.JavaGenerationDefinition

public abstract class JavaGenerationDefinition
extends CodeGenInputDefinitionPage

This abstract Generation definition class provides UI elements for database selection and generation type selection and functionality based upon this
This abstract wizard page adds the Input method selection, Input data file and Database product combo to the page.

Since:
1.1.0
Author:
Andi Hotz

Field Summary
protected  IJavaGenerationDefinition validator
          Instance of the contents validator
 
Constructor Summary
JavaGenerationDefinition(java.lang.String pageName, BasicCodeGenWizard caller, ISelection _selection)
          Constructor intialisazing this wizard
 
Method Summary
protected  void createSeparator(org.eclipse.swt.widgets.Composite composite, int nColumns)
          Creates a separator line.
protected  IJavaElement getInitialJavaElement(IStructuredSelection _selection)
          Utility method to inspect a selection to find a Java element.
 IJavaProject getJavaProject()
          Returns the Java project of the currently selected package fragment root or null if no package fragment root is configured.
 IPackageFragmentRoot getPackageFragmentRoot()
          Returns the IPackageFragmentRoot that corresponds to the current value of the source folder field.
 IProject getProject()
          Returns the project of the currently selected package fragment root or null if no package fragment root is configured.
 void initDBButton(int selection, boolean canBeModified)
          Initialize the radio buttons with a pre-selection
 void initDBProduct4Unserialize(java.lang.Class unserializingClass)
          This is a wrapper method of #initDBProduct().
protected  void initPackageFragmentRoot()
          Initialize the package fragment root
 void setDBConnectionCode(int connectionBase, java.lang.Class callingClass)
          Set the selected connection base selection.
protected  void setPackageFragmentRoot(IPackageFragmentRoot root)
          Set the package root
 void updateStatus(java.lang.String message)
          Print the status message
 void validate()
          Wrapper method for IJavaGenerationDefinition.validate()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

validator

protected IJavaGenerationDefinition validator
Instance of the contents validator

Constructor Detail

JavaGenerationDefinition

public JavaGenerationDefinition(java.lang.String pageName,
                                BasicCodeGenWizard caller,
                                ISelection _selection)
Constructor intialisazing this wizard

Parameters:
pageName - Wizard Dialog name
caller - calling wizard
_selection - current selection
Method Detail

createSeparator

protected final void createSeparator(org.eclipse.swt.widgets.Composite composite,
                                     int nColumns)
Creates a separator line. Expects a GridLayout with at least 1 column.

Parameters:
composite - the parent composite
nColumns - number of columns to span

validate

public final void validate()
Wrapper method for IJavaGenerationDefinition.validate()


initPackageFragmentRoot

protected final void initPackageFragmentRoot()
Initialize the package fragment root


getProject

public final IProject getProject()
Returns the project of the currently selected package fragment root or null if no package fragment root is configured.

Returns:
The current Java project or null.

getJavaProject

public final IJavaProject getJavaProject()
Returns the Java project of the currently selected package fragment root or null if no package fragment root is configured.

Returns:
The current Java project or null.
Since:
3.3

getPackageFragmentRoot

public final IPackageFragmentRoot getPackageFragmentRoot()
Returns the IPackageFragmentRoot that corresponds to the current value of the source folder field.

Returns:
the IPackageFragmentRoot or null if the current source folder value is not a valid package fragment root

setPackageFragmentRoot

protected final void setPackageFragmentRoot(IPackageFragmentRoot root)
Set the package root

Parameters:
root -

getInitialJavaElement

protected final IJavaElement getInitialJavaElement(IStructuredSelection _selection)
Utility method to inspect a selection to find a Java element.

Parameters:
_selection - the selection to be inspected
Returns:
a Java element to be used as the initial selection, or null, if no Java element exists in the given selection

setDBConnectionCode

public final void setDBConnectionCode(int connectionBase,
                                      java.lang.Class callingClass)
Set the selected connection base selection. This method may only be called from BasicCodeGenWizard#unserialize(String)

Parameters:
connectionBase - the selected connection
callingClass - Class object of the calling class
Since:
1.1.1

initDBButton

public final void initDBButton(int selection,
                               boolean canBeModified)
Initialize the radio buttons with a pre-selection

Parameters:
selection - Code of the selection
canBeModified - indicates if the buttons are enabled
See Also:
DynamicDBGenerationCode

initDBProduct4Unserialize

public final void initDBProduct4Unserialize(java.lang.Class unserializingClass)
This is a wrapper method of #initDBProduct(). This method may only be called from the unserialize Method BasicCodeGenWizard#unserialize(String)

Parameters:
unserializingClass - the class instance of the calling class
Since:
1.1.1

updateStatus

public final void updateStatus(java.lang.String message)
Print the status message

Parameters:
message -