kaos.kpat.policyTemplates.editor
Class ReferenceableTemplateComponent

java.lang.Object
  extended by kaos.kpat.policyTemplates.editor.ReferenceableTemplateComponent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, TemplateComponent, TemplateComponentReference
Direct Known Subclasses:
CheckBoxTC, ComboBoxTC, ListPanelTC, RadioButtonTC

public abstract class ReferenceableTemplateComponent
extends java.lang.Object
implements TemplateComponent, TemplateComponentReference

Prototype of a template component which can have bindings to subtemplates. Extending subclasses should set _inclusive in its constructor.

See Also:
Serialized Form

Field Summary
protected  boolean _inclusive
          true indicates the component is inclusive: You explicitly filter out possibilities.
 
Constructor Summary
ReferenceableTemplateComponent()
           
 
Method Summary
 void addBinding(TemplateComponentBinding binding)
           
 void addBindingListener(RTCBindingListener ls)
           
protected  void addBindingPopupToDisplayComponent(java.awt.Component comp, PolicyTemplate temp)
           
protected  void addDisplayComponent(java.awt.Component comp)
           
 void addTemplateComponentReference(TemplateComponentReference tcr)
           
 void changeBinding(TemplateComponentBinding binding)
           
 java.lang.Object clone()
           
protected  void fireBindingAdded(TemplateComponentBinding binding)
           
protected  void fireBindingChanged(TemplateComponentBinding binding)
           
protected  void fireBindingRemoved(TemplateComponentBinding binding)
           
 java.util.List getBindings()
           
abstract  java.awt.Component getDisplayComponent(PolicyTemplate temp)
          Implementor of "getDisplayComponent" must do the following before returning: 1.
 java.awt.Component getEditor()
           
 java.util.List getFilterdValues()
           
 java.lang.String getLabel()
           
 java.util.List getPossibleValues()
           
 java.util.List getPossibleValuesIgnoringFilter()
           
 java.util.List getSelectedValues()
           
 java.lang.Object getState(boolean collectReferences)
           
abstract  java.lang.String getTypeLabelString()
           
protected abstract  void handleDisplayComponentSelectionChange(java.awt.Component comp)
           
 void haveFilterExclude(TemplateComponentValue value)
           
 void haveFilterInclude(TemplateComponentValue value)
           
 void haveFilterSwap(TemplateComponentValue value)
           
 boolean isInclusive()
           
 void removeBinding(TemplateComponentBinding binding)
           
 void removeBindingListener(RTCBindingListener ls)
           
 void removeTemplateComponentReference(TemplateComponentReference tcr)
           
 void setLabel(java.lang.String label)
           
 void setSelectedValues(java.util.List selection)
           
 void setSelectedValuesForAllTCRs()
          Called by EditablePolicyTemplate#editPolicy() when this is a component in a subtemplate.
 void setState(java.lang.Object state)
           
 void setTemplateComponentReferences(java.util.List refs, PolicyTemplate template)
           
static TemplateBuildingNotCompleted validate(java.util.List states, java.util.Iterator templateComponentsIt)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_inclusive

protected boolean _inclusive
true indicates the component is inclusive: You explicitly filter out possibilities. false indicates the component is exclusive: Pssibilities must be explicitly included.

Constructor Detail

ReferenceableTemplateComponent

public ReferenceableTemplateComponent()
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface TemplateComponent
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getPossibleValuesIgnoringFilter

public java.util.List getPossibleValuesIgnoringFilter()

getTypeLabelString

public abstract java.lang.String getTypeLabelString()

isInclusive

public boolean isInclusive()

setLabel

public void setLabel(java.lang.String label)

setSelectedValues

public void setSelectedValues(java.util.List selection)
Specified by:
setSelectedValues in interface TemplateComponentReference
Throws:
java.lang.IllegalArgumentException - if the selection is not a subset of selected values.

handleDisplayComponentSelectionChange

protected abstract void handleDisplayComponentSelectionChange(java.awt.Component comp)
See Also:
alertDisplayComponentsAboutSelectedValuesChange()

haveFilterInclude

public void haveFilterInclude(TemplateComponentValue value)
                       throws IntersectionEmptyXcp
Throws:
IntersectionEmptyXcp

haveFilterExclude

public void haveFilterExclude(TemplateComponentValue value)
                       throws IntersectionEmptyXcp
Throws:
IntersectionEmptyXcp

haveFilterSwap

public void haveFilterSwap(TemplateComponentValue value)

setSelectedValuesForAllTCRs

public void setSelectedValuesForAllTCRs()
Called by EditablePolicyTemplate#editPolicy() when this is a component in a subtemplate. Used to set the selected values of TemplateComponentReference objects in the supertemplate to the values they had when the supertemplate saved a policy.


getFilterdValues

public java.util.List getFilterdValues()

getEditor

public java.awt.Component getEditor()
Specified by:
getEditor in interface TemplateComponent

getDisplayComponent

public abstract java.awt.Component getDisplayComponent(PolicyTemplate temp)
Implementor of "getDisplayComponent" must do the following before returning: 1. call "addBindingPopupToDisplayComponent" 2. call "addDisplayComponent"

Specified by:
getDisplayComponent in interface TemplateComponent

addDisplayComponent

protected void addDisplayComponent(java.awt.Component comp)

addBindingPopupToDisplayComponent

protected void addBindingPopupToDisplayComponent(java.awt.Component comp,
                                                 PolicyTemplate temp)

addTemplateComponentReference

public void addTemplateComponentReference(TemplateComponentReference tcr)

removeTemplateComponentReference

public void removeTemplateComponentReference(TemplateComponentReference tcr)

setTemplateComponentReferences

public void setTemplateComponentReferences(java.util.List refs,
                                           PolicyTemplate template)

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in interface TemplateComponentReference

addBinding

public void addBinding(TemplateComponentBinding binding)
                throws IntersectionEmptyXcp
Specified by:
addBinding in interface TemplateComponentReference
Throws:
IntersectionEmptyXcp

changeBinding

public void changeBinding(TemplateComponentBinding binding)
                   throws IntersectionEmptyXcp
Specified by:
changeBinding in interface TemplateComponentReference
Throws:
IntersectionEmptyXcp

removeBinding

public void removeBinding(TemplateComponentBinding binding)
Specified by:
removeBinding in interface TemplateComponentReference

getPossibleValues

public java.util.List getPossibleValues()
Specified by:
getPossibleValues in interface TemplateComponentReference

getSelectedValues

public java.util.List getSelectedValues()
Specified by:
getSelectedValues in interface TemplateComponentReference

getBindings

public java.util.List getBindings()
Specified by:
getBindings in interface TemplateComponentReference

addBindingListener

public void addBindingListener(RTCBindingListener ls)

removeBindingListener

public void removeBindingListener(RTCBindingListener ls)

getState

public java.lang.Object getState(boolean collectReferences)

setState

public void setState(java.lang.Object state)

validate

public static TemplateBuildingNotCompleted validate(java.util.List states,
                                                    java.util.Iterator templateComponentsIt)

fireBindingAdded

protected void fireBindingAdded(TemplateComponentBinding binding)

fireBindingChanged

protected void fireBindingChanged(TemplateComponentBinding binding)

fireBindingRemoved

protected void fireBindingRemoved(TemplateComponentBinding binding)