Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.function.contribution
Class SchemaSelectionFunctionContribution

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by eu.esdihumboldt.hale.ui.function.contribution.AbstractFunctionWizardContribution
          extended by eu.esdihumboldt.hale.ui.function.contribution.SchemaSelectionFunctionContribution
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem
Direct Known Subclasses:
ReplaceFunctionWizardContribution

public class SchemaSelectionFunctionContribution
extends AbstractFunctionWizardContribution

Function wizard contribution based on SchemaSelection

Author:
Simon Templer

Constructor Summary
SchemaSelectionFunctionContribution()
           
 
Method Summary
protected  boolean checkCount(int count, Set<? extends AbstractParameter> entities, boolean isTarget)
          Checks if the given entity count is compatible with the given set of entity definitions
protected  boolean checkMandatoryConditions(Set<EntityDefinition> schemaEntities, Iterable<? extends AbstractParameter> functionEntities)
          Checks if all entities that are mandatory in the function definition and have specific attached conditions can be met by at least one of the given schema entities.
protected  boolean checkType(Iterable<?> items, Class<?> type)
          Checks if each item is of the given type
protected  AbstractWizardAction<?> createWizardAction(FunctionWizardDescriptor<?> descriptor, AlignmentService alignmentService)
          Create a wizard action for the given function wizard descriptor
 SchemaSelection getSelection()
          Get the schema selection
 boolean isActive(FunctionWizardDescriptor<?> descriptor)
          Determine if a function wizard is active for the current selection
 
Methods inherited from class eu.esdihumboldt.hale.ui.function.contribution.AbstractFunctionWizardContribution
fill, fill, getFunctionWizardDescriptors, hasActiveFunctions, isDynamic
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchemaSelectionFunctionContribution

public SchemaSelectionFunctionContribution()
Method Detail

createWizardAction

protected AbstractWizardAction<?> createWizardAction(FunctionWizardDescriptor<?> descriptor,
                                                     AlignmentService alignmentService)
Description copied from class: AbstractFunctionWizardContribution
Create a wizard action for the given function wizard descriptor

Specified by:
createWizardAction in class AbstractFunctionWizardContribution
Parameters:
descriptor - the function wizard descriptor
alignmentService - the alignment service
Returns:
the action that launches the wizard
See Also:
AbstractFunctionWizardContribution.createWizardAction(FunctionWizardDescriptor, AlignmentService)

isActive

public boolean isActive(FunctionWizardDescriptor<?> descriptor)
Description copied from class: AbstractFunctionWizardContribution
Determine if a function wizard is active for the current selection

Specified by:
isActive in class AbstractFunctionWizardContribution
Parameters:
descriptor - the function wizard descriptor
Returns:
if the function wizard is active for the current selection
See Also:
AbstractFunctionWizardContribution.isActive(FunctionWizardDescriptor)

checkMandatoryConditions

protected boolean checkMandatoryConditions(Set<EntityDefinition> schemaEntities,
                                           Iterable<? extends AbstractParameter> functionEntities)
Checks if all entities that are mandatory in the function definition and have specific attached conditions can be met by at least one of the given schema entities.

Parameters:
schemaEntities - the schema entities
functionEntities - the entities as defined in the function
Returns:
if the conditions on mandatory function entities can be met

checkType

protected boolean checkType(Iterable<?> items,
                            Class<?> type)
Checks if each item is of the given type

Parameters:
items - the items
type - the type
Returns:
true if all items are of the given type

checkCount

protected boolean checkCount(int count,
                             Set<? extends AbstractParameter> entities,
                             boolean isTarget)
Checks if the given entity count is compatible with the given set of entity definitions

Parameters:
count - the entity count
entities - the entity definitions
isTarget - if the entities are target entities
Returns:
if then entity count is compatible with the definitions

getSelection

public SchemaSelection getSelection()
Get the schema selection

Returns:
the schema selection to use

Humboldt Alignment Editor 2.5.0

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