Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.functions.core
Class SourceListParameterPage<T>

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.wizard.WizardPage
          extended by eu.esdihumboldt.hale.ui.HaleWizardPage<AbstractGenericFunctionWizard<?,?>>
              extended by eu.esdihumboldt.hale.ui.functions.core.SourceListParameterPage<T>
Type Parameters:
T - the type of the text field/editor
All Implemented Interfaces:
ParameterPage, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.wizard.IWizardPage
Direct Known Subclasses:
SourceViewerParameterPage, TextSourceListParameterPage

public abstract class SourceListParameterPage<T>
extends HaleWizardPage<AbstractGenericFunctionWizard<?,?>>
implements ParameterPage

Base parameter page for parameter pages that contain a listing of source types which can be put together to a target value.

Author:
Kai Schwierczek

Field Summary
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
protected SourceListParameterPage(String pageName)
           
protected SourceListParameterPage(String pageName, String title, org.eclipse.jface.resource.ImageDescriptor titleImage)
           
 
Method Summary
protected  void configure(T textField)
          Subclasses can configure the text field to for example add some validation mechanism.
protected abstract  T createAndLayoutTextField(org.eclipse.swt.widgets.Composite parent)
          Create and text field and layout it.
protected  void createContent(org.eclipse.swt.widgets.Composite page)
          Create the page content
 com.google.common.collect.ListMultimap<String,String> getConfiguration()
          Returns the configuration of the parameters this page is responsible for.
protected abstract  String getParameterName()
          Should return the parameter which should be configured using all source properties.
protected abstract  String getSourcePropertyName()
          Should return the name of the source property which should be used.
protected abstract  String getText(T textField)
          Get the current text of the text field.
protected  T getTextField()
          Get the text editor/field.
protected  String getVariableName(EntityDefinition variable)
          This gets called for all variables.
Subclasses can change how they are displayed here.
The default format is like "part1.part2.name".
protected abstract  void insertTextAtCurrentPos(T textField, String insert)
          Insert a given text at the current position of the given text field.
protected  void onShowPage(boolean firstShow)
          Called when this page is shown
 void setParameter(Set<FunctionParameter> params, com.google.common.collect.ListMultimap<String,String> initialValues)
          Sets the parameters this page is responsible for and their initial values.
protected abstract  void setText(T textField, String value)
          Set the text of the text field to the given value.
protected  void sourcePropertiesChanged(EntityDefinition[] variables)
          This gets called, when the user chose other source properties.
 
Methods inherited from class eu.esdihumboldt.hale.ui.HaleWizardPage
createControl, dispose, getWizard
 
Methods inherited from class org.eclipse.jface.wizard.WizardPage
canFlipToNextPage, getContainer, getDialogSettings, getImage, getName, getNextPage, getPreviousPage, getShell, isCurrentPage, isPageComplete, setDescription, setErrorMessage, setImageDescriptor, setMessage, 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, performHelp, 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.wizard.IWizardPage
canFlipToNextPage, getName, getNextPage, getPreviousPage, getWizard, isPageComplete, setPreviousPage, setWizard
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Constructor Detail

SourceListParameterPage

protected SourceListParameterPage(String pageName,
                                  String title,
                                  org.eclipse.jface.resource.ImageDescriptor titleImage)
See Also:
HaleWizardPage.HaleWizardPage(String, String, ImageDescriptor)

SourceListParameterPage

protected SourceListParameterPage(String pageName)
See Also:
HaleWizardPage.HaleWizardPage(String)
Method Detail

getParameterName

protected abstract String getParameterName()
Should return the parameter which should be configured using all source properties.

Returns:
the parameter name

getSourcePropertyName

protected abstract String getSourcePropertyName()
Should return the name of the source property which should be used.

Returns:
the source property name

configure

protected void configure(T textField)
Subclasses can configure the text field to for example add some validation mechanism.

Parameters:
textField - the text field to configure

getVariableName

protected String getVariableName(EntityDefinition variable)
This gets called for all variables.
Subclasses can change how they are displayed here.
The default format is like "part1.part2.name".

Parameters:
variable - the variable
Returns:
the modified name

sourcePropertiesChanged

protected void sourcePropertiesChanged(EntityDefinition[] variables)
This gets called, when the user chose other source properties.

Parameters:
variables - the new source properties

setParameter

public void setParameter(Set<FunctionParameter> params,
                         com.google.common.collect.ListMultimap<String,String> initialValues)
Description copied from interface: ParameterPage
Sets the parameters this page is responsible for and their initial values. This method is called before creating the page content.
It should only handle the parameters in the given set, even if it could handle more.

Specified by:
setParameter in interface ParameterPage
Parameters:
params - the parameters this page is responsible for
initialValues - initial values of those parameters, may be null, should not be changed
See Also:
ParameterPage.setParameter(Set, ListMultimap)

getConfiguration

public com.google.common.collect.ListMultimap<String,String> getConfiguration()
Description copied from interface: ParameterPage
Returns the configuration of the parameters this page is responsible for.
It should only contain key value pairs, where key is the name of one of the parameters this page is responsible for.

Specified by:
getConfiguration in interface ParameterPage
Returns:
the configuration of the parameters
See Also:
ParameterPage.getConfiguration()

onShowPage

protected void onShowPage(boolean firstShow)
Description copied from class: HaleWizardPage
Called when this page is shown

Overrides:
onShowPage in class HaleWizardPage<AbstractGenericFunctionWizard<?,?>>
Parameters:
firstShow - specifies if it is the first time the page is shown since its creation
See Also:
HaleWizardPage.onShowPage(boolean)

createContent

protected void createContent(org.eclipse.swt.widgets.Composite page)
Description copied from class: HaleWizardPage
Create the page content

Specified by:
createContent in class HaleWizardPage<AbstractGenericFunctionWizard<?,?>>
Parameters:
page - the page composite, implementors may assign a custom layout to this composite
See Also:
HaleWizardPage.createContent(Composite)

setText

protected abstract void setText(T textField,
                                String value)
Set the text of the text field to the given value.

Parameters:
textField - the text field
value - the value to set as text

getText

protected abstract String getText(T textField)
Get the current text of the text field.

Parameters:
textField - the text field
Returns:
the current text of the text field

insertTextAtCurrentPos

protected abstract void insertTextAtCurrentPos(T textField,
                                               String insert)
Insert a given text at the current position of the given text field.

Parameters:
textField - the text field
insert - the text to insert

createAndLayoutTextField

protected abstract T createAndLayoutTextField(org.eclipse.swt.widgets.Composite parent)
Create and text field and layout it.

Parameters:
parent - the parent composite, it has a one-column grid layout
Returns:
the created text field

getTextField

protected T getTextField()
Get the text editor/field.

Returns:
the text field

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d