Humboldt Alignment Editor 2.5.0

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

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
              extended by eu.esdihumboldt.hale.ui.function.contribution.ReplaceFunctionWizardContribution
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem

public class ReplaceFunctionWizardContribution
extends SchemaSelectionFunctionContribution

Contribution item offering possibilities to replace an existing cell with another function.

Author:
Simon Templer

Constructor Summary
ReplaceFunctionWizardContribution()
          Default constructor.
ReplaceFunctionWizardContribution(Cell originalCell)
          Constructor
 
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  AbstractWizardAction<?> createWizardAction(FunctionWizardDescriptor<?> descriptor, AlignmentService alignmentService)
          Create a wizard action for the given function wizard descriptor
 void fill(org.eclipse.swt.widgets.Menu menu, int index)
           
 void fill(org.eclipse.swt.widgets.ToolBar parent, int index)
           
 Cell getOriginalCell()
          Get the cell
 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.SchemaSelectionFunctionContribution
checkType
 
Methods inherited from class eu.esdihumboldt.hale.ui.function.contribution.AbstractFunctionWizardContribution
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

ReplaceFunctionWizardContribution

public ReplaceFunctionWizardContribution(Cell originalCell)
Constructor

Parameters:
originalCell - the original cell

ReplaceFunctionWizardContribution

public ReplaceFunctionWizardContribution()
Default constructor. Uses the first cell in the current IStructuredSelection.

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

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

getSelection

public SchemaSelection getSelection()
Description copied from class: SchemaSelectionFunctionContribution
Get the schema selection

Overrides:
getSelection in class SchemaSelectionFunctionContribution
Returns:
the schema selection to use
See Also:
SchemaSelectionFunctionContribution.getSelection()

isActive

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

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

checkCount

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

Overrides:
checkCount in class SchemaSelectionFunctionContribution
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
See Also:
SchemaSelectionFunctionContribution.checkCount(int, Set, boolean)

checkMandatoryConditions

protected boolean checkMandatoryConditions(Set<EntityDefinition> schemaEntities,
                                           Iterable<? extends AbstractParameter> functionEntities)
Description copied from class: SchemaSelectionFunctionContribution
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.

Overrides:
checkMandatoryConditions in class SchemaSelectionFunctionContribution
Parameters:
schemaEntities - the schema entities
functionEntities - the entities as defined in the function
Returns:
if the conditions on mandatory function entities can be met
See Also:
SchemaSelectionFunctionContribution.checkMandatoryConditions(Set, Iterable)

fill

public void fill(org.eclipse.swt.widgets.ToolBar parent,
                 int index)
Specified by:
fill in interface org.eclipse.jface.action.IContributionItem
Overrides:
fill in class AbstractFunctionWizardContribution
See Also:
AbstractFunctionWizardContribution.fill(ToolBar, int)

fill

public void fill(org.eclipse.swt.widgets.Menu menu,
                 int index)
Specified by:
fill in interface org.eclipse.jface.action.IContributionItem
Overrides:
fill in class AbstractFunctionWizardContribution
See Also:
AbstractFunctionWizardContribution.fill(Menu, int)

getOriginalCell

public Cell getOriginalCell()
Get the cell

Returns:
the cell

Humboldt Alignment Editor 2.5.0

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