hok.model
Class ConstraintModel

java.lang.Object
  extended by hok.model.ConstraintModel

public class ConstraintModel
extends java.lang.Object

The ConstraintModel is the model of the TableViewer of the WizardView. It contains the rows (ConstraintRow) of the table and the listeners that wish to be informed of changes in the model.

Author:
holger

Field Summary
static java.lang.String INIT_VALUE_CONCEPT
          The default value of the concept constraint part of a ConstraintRow.
static java.lang.String INIT_VALUE_PREDICATE
          The default value of the predicate constraint part of a ConstraintRow.
 
Constructor Summary
ConstraintModel()
           
 
Method Summary
 void addChangeListener(IConstraintViewer viewer)
          Adds a listener to the model.
 void addConstraint()
          Adds a new ConstraintRow to the collection of constraints.
 void constraintChanged(ConstraintRow constraint)
          Informs the listener of a change of the model.
 java.util.Vector<ConstraintRow> getConstraints()
          Returns the collection of constraints
 boolean isEmpty()
          Checks if the model contains elements.
 void removeChangeListener(IConstraintViewer viewer)
          Removes a listener from the model.
 void removeConstraint(ConstraintRow constraint)
          Removes a ConstraintRow from the collection of constraints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT_VALUE_CONCEPT

public static final java.lang.String INIT_VALUE_CONCEPT
The default value of the concept constraint part of a ConstraintRow.

See Also:
Constant Field Values

INIT_VALUE_PREDICATE

public static final java.lang.String INIT_VALUE_PREDICATE
The default value of the predicate constraint part of a ConstraintRow.

See Also:
Constant Field Values
Constructor Detail

ConstraintModel

public ConstraintModel()
Method Detail

getConstraints

public java.util.Vector<ConstraintRow> getConstraints()
Returns the collection of constraints

Returns:
the vector of SparqlConstraintRows

addConstraint

public void addConstraint()
Adds a new ConstraintRow to the collection of constraints. It also informs the listeners of the change of the model.


removeConstraint

public void removeConstraint(ConstraintRow constraint)
Removes a ConstraintRow from the collection of constraints. It also informs the listeners of the change of the model.

Parameters:
constraint - the SparqlConstraintrow to remove.

constraintChanged

public void constraintChanged(ConstraintRow constraint)
Informs the listener of a change of the model.

Parameters:
constraint - the ConstraintRow that has changed.

removeChangeListener

public void removeChangeListener(IConstraintViewer viewer)
Removes a listener from the model.

Parameters:
viewer - the listener to remove.

addChangeListener

public void addChangeListener(IConstraintViewer viewer)
Adds a listener to the model.

Parameters:
viewer - the listner to add.

isEmpty

public boolean isEmpty()
Checks if the model contains elements.

Returns:
true if the model is empty, false otherwise.