org.eclipse.emf.oda.ecore.ui.impl
Class EcoreDataSetWizardPage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by org.eclipse.datatools.connectivity.oda.design.internal.ui.DataSetWizardPageCore
              extended by org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage
                  extended by org.eclipse.emf.oda.ecore.ui.impl.EcoreDataSetWizardPage
All Implemented Interfaces:
IDialogPage, IMessageProvider, IWizardPage

public class EcoreDataSetWizardPage
extends org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage

Implementation of an EMF ODA data set designer page for a user to create or edit a data set design instance.


Nested Class Summary
protected  class EcoreDataSetWizardPage.TypeLabelProvider
          A provider of formatted labels for types.
protected static class EcoreDataSetWizardPage.Variable
          Representation of an expression variable.
protected  class EcoreDataSetWizardPage.VariableSpecificationDialog
          A dialog which prompts the user to specify a name and select a type for an expression variable.
 
Field Summary
protected  java.lang.Object[] classChoices
           
protected  java.lang.Object[] classifierChoices
           
protected  EClassifier contextType
           
protected  Text contextTypeField
           
protected static java.lang.String DEFAULT_MESSAGE
           
protected  Combo queryDelegateCombo
           
protected  Composite queryTextViewerComposite
           
protected  java.util.Map<java.lang.String,ITextViewer> queryTextViewers
           
protected  StackLayout queryTextViewerStackLayout
           
protected  EClassifier resultType
           
protected  Text resultTypeField
           
protected  java.util.List<EcoreDataSetWizardPage.Variable> variables
           
protected  TableViewer variablesViewer
           
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
EcoreDataSetWizardPage(java.lang.String pageName)
           
EcoreDataSetWizardPage(java.lang.String pageName, java.lang.String title, ImageDescriptor titleImage)
           
 
Method Summary
protected  boolean canLeave()
           
protected  void closeConnection(org.eclipse.datatools.connectivity.oda.IConnection connection)
          Attempts to close the given ODA connection.
protected  org.eclipse.datatools.connectivity.oda.design.DataSetDesign collectDataSetDesign(org.eclipse.datatools.connectivity.oda.design.DataSetDesign design)
           
protected  java.lang.String convertTypeToString(EClassifier type)
          Converts the specified type to its string representation.
protected  java.util.Map<java.lang.String,EClassifier> convertVariablesToMap(java.util.List<EcoreDataSetWizardPage.Variable> variables)
          Converts the specified expression variables to a map representation.
protected  java.lang.String convertVariablesToString(java.util.List<EcoreDataSetWizardPage.Variable> variables)
          Converts the specified expression variables to a string representation.
protected  void createContextTypeControl(Composite parent)
          Creates control for context type property.
protected  Control createPageControl(Composite parent)
          Creates custom page control for user-defined queries.
 void createPageCustomControl(Composite parent)
           
protected  void createQueryDelegateControl(Composite parent)
          Creates control for query delegate property.
protected  void createQueryTextControl(Composite parent)
          Creates control for query text.
protected  void createResultTypeControl(Composite parent)
          Creates control for result type property.
protected  void createVariablesControl(Composite parent)
          Creates control for expression variables property.
protected  java.lang.Object[] getClassChoices()
          Returns an array of classes applicable for the data source.
protected  java.lang.Object[] getClassifierChoices()
          Returns an array of classes and data types applicable for the data source.
protected  EClassifier getContextType()
          Returns the value of the context type property.
protected  java.lang.String getQueryDelegate()
          Returns the value of the query delegate property.
protected  java.lang.String getQueryText()
          Returns the value of the query text.
protected  ITextViewer getQueryTextViewer()
           
protected  EClassifier getResultType()
          Returns the value of the result type property.
protected  EClassifier getTypeFromString(java.lang.String string)
          Retrieves the type corresponding to the specified string representation.
protected  java.util.List<EcoreDataSetWizardPage.Variable> getVariables()
          Returns the value of the expression variables property.
protected  java.util.List<EcoreDataSetWizardPage.Variable> getVariablesFromString(java.lang.String string)
          Retrieves the expression variables corresponding to the specified string representation.
protected  boolean hasValidData()
          Indicates whether the custom page has valid data to proceed with defining a data set.
protected  void initializeControl()
          Initializes the page control with the last edited data set design.
protected  void promptForContextTypeSelection()
          Opens a dialog prompting the user to select a context type.
protected  void promptForResultTypeSelection()
          Opens a dialog prompting the user to select a result type.
protected  void savePage(org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
          Saves the user-defined values in this page, and updates the specified data set design with the latest design definition.
protected  void setContextType(EClassifier contextType)
          Sets the value of the context type property.
protected  void setResultType(EClassifier resultType)
          Sets the value of the result type property.
protected  void updateDesign(org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign, org.eclipse.datatools.connectivity.oda.IConnection connection, java.lang.String queryText)
          Updates the given data set design with the proeprties and derived metadata obtained from the ODA runtime connection.
protected  void updateParameterDesign(org.eclipse.datatools.connectivity.oda.IParameterMetaData parameterMetaData, org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
          Updates the specified data set design's parameter definition based on the specified runtime metadata.
protected  void updateResultSetDesign(org.eclipse.datatools.connectivity.oda.IResultSetMetaData resultSetMetaData, org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
          Updates the specified data set design's result set definition based on the specified runtime metadata.
protected  void validateData()
          Validates that the user has specified values for the properties in the page control and sets page message accordingly.
 
Methods inherited from class org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage
cleanup, collectResponseState, createControl, refresh
 
Methods inherited from class org.eclipse.datatools.connectivity.oda.design.internal.ui.DataSetWizardPageCore
dispose, finishDataSetDesign, getEditingDesign, getEditingDesignerState, getEditorContainer, getHostResourceIdentifiers, getIconDescriptor, getIconFilePath, getInitializationDesign, getInitializationDesignerState, getInitializationLocale, getOdaWizard, isSessionEditable, performHelp, setErrorMessage, setHasInitialFocus, setIconFilePath, setMessage, setPagePath, setResponseDesignerState, setResponseSessionStatus
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, getWizard, isCurrentPage, isPageComplete, setDescription, setImageDescriptor, setPageComplete, setPreviousPage, setTitle, setWizard, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getMessage, getMessageType, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setMessage, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
getControl, getDescription, getErrorMessage, getMessage, getTitle, setVisible
 

Field Detail

DEFAULT_MESSAGE

protected static java.lang.String DEFAULT_MESSAGE

queryDelegateCombo

protected Combo queryDelegateCombo

queryTextViewers

protected java.util.Map<java.lang.String,ITextViewer> queryTextViewers

queryTextViewerComposite

protected Composite queryTextViewerComposite

queryTextViewerStackLayout

protected StackLayout queryTextViewerStackLayout

variablesViewer

protected TableViewer variablesViewer

variables

protected java.util.List<EcoreDataSetWizardPage.Variable> variables

contextTypeField

protected Text contextTypeField

contextType

protected EClassifier contextType

resultTypeField

protected Text resultTypeField

resultType

protected EClassifier resultType

classChoices

protected java.lang.Object[] classChoices

classifierChoices

protected java.lang.Object[] classifierChoices
Constructor Detail

EcoreDataSetWizardPage

public EcoreDataSetWizardPage(java.lang.String pageName)

EcoreDataSetWizardPage

public EcoreDataSetWizardPage(java.lang.String pageName,
                              java.lang.String title,
                              ImageDescriptor titleImage)
Method Detail

createPageCustomControl

public void createPageCustomControl(Composite parent)
Specified by:
createPageCustomControl in class org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage

createPageControl

protected Control createPageControl(Composite parent)
Creates custom page control for user-defined queries.


createQueryDelegateControl

protected void createQueryDelegateControl(Composite parent)
Creates control for query delegate property.


promptForContextTypeSelection

protected void promptForContextTypeSelection()
Opens a dialog prompting the user to select a context type.


createContextTypeControl

protected void createContextTypeControl(Composite parent)
Creates control for context type property.


createVariablesControl

protected void createVariablesControl(Composite parent)
Creates control for expression variables property.


createQueryTextControl

protected void createQueryTextControl(Composite parent)
Creates control for query text.


promptForResultTypeSelection

protected void promptForResultTypeSelection()
Opens a dialog prompting the user to select a result type.


createResultTypeControl

protected void createResultTypeControl(Composite parent)
Creates control for result type property.


initializeControl

protected void initializeControl()
Initializes the page control with the last edited data set design.


getClassChoices

protected java.lang.Object[] getClassChoices()
Returns an array of classes applicable for the data source.

Returns:
the applicable classes

getClassifierChoices

protected java.lang.Object[] getClassifierChoices()
Returns an array of classes and data types applicable for the data source.

Returns:
the applicable classes and data types

convertTypeToString

protected java.lang.String convertTypeToString(EClassifier type)
Converts the specified type to its string representation.

Parameters:
type - the type
Returns:
the string representation

getTypeFromString

protected EClassifier getTypeFromString(java.lang.String string)
Retrieves the type corresponding to the specified string representation.

Parameters:
string - the string representation
Returns:
the type

convertVariablesToString

protected java.lang.String convertVariablesToString(java.util.List<EcoreDataSetWizardPage.Variable> variables)
Converts the specified expression variables to a string representation.

Parameters:
variables - the expression variables
Returns:
the string representation

convertVariablesToMap

protected java.util.Map<java.lang.String,EClassifier> convertVariablesToMap(java.util.List<EcoreDataSetWizardPage.Variable> variables)
Converts the specified expression variables to a map representation.

Parameters:
variables - the expression variables
Returns:
the map representation

getVariablesFromString

protected java.util.List<EcoreDataSetWizardPage.Variable> getVariablesFromString(java.lang.String string)
Retrieves the expression variables corresponding to the specified string representation.

Parameters:
string - the string representation
Returns:
the variables

getQueryDelegate

protected java.lang.String getQueryDelegate()
Returns the value of the query delegate property.

Returns:
the query delegate

getVariables

protected java.util.List<EcoreDataSetWizardPage.Variable> getVariables()
Returns the value of the expression variables property.

Returns:
the expression variables

getQueryTextViewer

protected ITextViewer getQueryTextViewer()

getQueryText

protected java.lang.String getQueryText()
Returns the value of the query text.

Returns:
the query text

getContextType

protected EClassifier getContextType()
Returns the value of the context type property.

Returns:
the context type

setContextType

protected void setContextType(EClassifier contextType)
Sets the value of the context type property.

Parameters:
contextType - the value

getResultType

protected EClassifier getResultType()
Returns the value of the result type property.

Returns:
the result type

setResultType

protected void setResultType(EClassifier resultType)
Sets the value of the result type property.

Parameters:
resultType - the value

collectDataSetDesign

protected org.eclipse.datatools.connectivity.oda.design.DataSetDesign collectDataSetDesign(org.eclipse.datatools.connectivity.oda.design.DataSetDesign design)
Overrides:
collectDataSetDesign in class org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage

canLeave

protected boolean canLeave()
Overrides:
canLeave in class org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSetWizardPage

validateData

protected void validateData()
Validates that the user has specified values for the properties in the page control and sets page message accordingly.


hasValidData

protected boolean hasValidData()
Indicates whether the custom page has valid data to proceed with defining a data set.


savePage

protected void savePage(org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
Saves the user-defined values in this page, and updates the specified data set design with the latest design definition.


updateDesign

protected void updateDesign(org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign,
                            org.eclipse.datatools.connectivity.oda.IConnection connection,
                            java.lang.String queryText)
                     throws org.eclipse.datatools.connectivity.oda.OdaException
Updates the given data set design with the proeprties and derived metadata obtained from the ODA runtime connection.

Throws:
org.eclipse.datatools.connectivity.oda.OdaException

updateResultSetDesign

protected void updateResultSetDesign(org.eclipse.datatools.connectivity.oda.IResultSetMetaData resultSetMetaData,
                                     org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
                              throws org.eclipse.datatools.connectivity.oda.OdaException
Updates the specified data set design's result set definition based on the specified runtime metadata.

Parameters:
resultSetMetaData - runtime result set metadata instance
dataSetDesign - data set design instance to update
Throws:
org.eclipse.datatools.connectivity.oda.OdaException

updateParameterDesign

protected void updateParameterDesign(org.eclipse.datatools.connectivity.oda.IParameterMetaData parameterMetaData,
                                     org.eclipse.datatools.connectivity.oda.design.DataSetDesign dataSetDesign)
                              throws org.eclipse.datatools.connectivity.oda.OdaException
Updates the specified data set design's parameter definition based on the specified runtime metadata.

Parameters:
parameterMetaData - runtime parameter metadata instance
dataSetDesign - data set design instance to update
Throws:
org.eclipse.datatools.connectivity.oda.OdaException

closeConnection

protected void closeConnection(org.eclipse.datatools.connectivity.oda.IConnection connection)
Attempts to close the given ODA connection.


Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.