Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.selectors
Class SelectorPanel

java.lang.Object
  extended by Composite
      extended by ch.elexis.selectors.SelectorPanel
All Implemented Interfaces:
ActiveControlListener

public class SelectorPanel
extends Composite
implements ActiveControlListener

A Panel that can be used as a ControlField for a CommonViewer. Can take actions that are inserted on top right of the Panel

Author:
gerry

Constructor Summary
SelectorPanel(Composite parent, IAction... actions)
           
 
Method Summary
 void addActions(IAction... actions)
          Add Actions to display in the uper right corner of the panel
 void addField(ActiveControl ac)
          Add a field to the panel
 void addFields(ActiveControl... newControls)
          Add a number of fields to the Panel
 void addSelectorListener(ActiveControlListener l)
          Add a listener to the list of listeners that will be notified, if one of the fields has been changed
 void clearValues()
          Clear all fields to their default "empty" value
 void contentsChanged(ActiveControl field)
          From ActiveControlListener: Notify that the contents of a field has changed This will in turn notify the SelectorListeners attached to this panel
 java.util.List<ActiveControl> getControls()
          Return all ActiveControls attached to this panel
 Composite getFieldParent()
           
 java.util.HashMap<java.lang.String,java.lang.String> getValues()
          Return the values of all fields.
 void invalidContents(ActiveControl field)
          inform the user, that a field has invalid content
 void removeField(java.lang.String field)
          Remove a field from the panel
 void removeSelectorListener(ActiveControlListener l)
          Remove a listener from the list of SelectorListeners
 void setExclusive(boolean excl)
          If set, writing in one field will clear all oder fields in the panel
 void setLock(boolean bLocked)
           
 void titleClicked(ActiveControl field)
          From ActiveControlListener: Notify that the user clicked the label of a field This will in turn notify the SelectorListeners attached to this panel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectorPanel

public SelectorPanel(Composite parent,
                     IAction... actions)
Method Detail

getFieldParent

public Composite getFieldParent()

setExclusive

public void setExclusive(boolean excl)
If set, writing in one field will clear all oder fields in the panel

Parameters:
excl - true if there can only one field with text

addActions

public void addActions(IAction... actions)
Add Actions to display in the uper right corner of the panel

Parameters:
actions -

addField

public void addField(ActiveControl ac)
Add a field to the panel

Parameters:
ac -

addFields

public void addFields(ActiveControl... newControls)
Add a number of fields to the Panel

Parameters:
activeControls -

removeField

public void removeField(java.lang.String field)
Remove a field from the panel

Parameters:
field -

clearValues

public void clearValues()
Clear all fields to their default "empty" value


getValues

public java.util.HashMap<java.lang.String,java.lang.String> getValues()
Return the values of all fields.

Returns:
A HashMap with the label and the database fieldname (if any) of each field as keys and the respective field contents as values

getControls

public java.util.List<ActiveControl> getControls()
Return all ActiveControls attached to this panel

Returns:
al List that might be empty but is never null

contentsChanged

public void contentsChanged(ActiveControl field)
From ActiveControlListener: Notify that the contents of a field has changed This will in turn notify the SelectorListeners attached to this panel

Specified by:
contentsChanged in interface ActiveControlListener
Parameters:
field - the field that changed or NULL: Any of the observed field(s) have changed

addSelectorListener

public void addSelectorListener(ActiveControlListener l)
Add a listener to the list of listeners that will be notified, if one of the fields has been changed

Parameters:
l -

removeSelectorListener

public void removeSelectorListener(ActiveControlListener l)
Remove a listener from the list of SelectorListeners

Parameters:
l -

titleClicked

public void titleClicked(ActiveControl field)
From ActiveControlListener: Notify that the user clicked the label of a field This will in turn notify the SelectorListeners attached to this panel

Specified by:
titleClicked in interface ActiveControlListener

invalidContents

public void invalidContents(ActiveControl field)
inform the user, that a field has invalid content

Specified by:
invalidContents in interface ActiveControlListener

setLock

public void setLock(boolean bLocked)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis