Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.selectors
Class DisplayPanel

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

public class DisplayPanel
extends Composite
implements ActiveControlListener

A Panel to display ActiveControls as views to fields of a single PersistentObject

Author:
gerry

Constructor Summary
DisplayPanel(Composite parent, FieldDescriptor<? extends PersistentObject>[] fields, int minCols, int maxCols, IAction... actions)
           
 
Method Summary
 void addField(ActiveControl ac)
          Add a field to the panel
 void addFields(ActiveControl... activeControls)
          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 contentsChanged(ActiveControl ac)
          Contents of field has chsnged.
 java.util.List<ActiveControl> getControls()
          Return all ActiveControls attached to this panel
 void invalidContents(ActiveControl field)
           
 void removeSelectorListener(ActiveControlListener l)
          Remove a listener from the list of SelectorListeners
 void setAutosave(boolean doSave)
          Set autosave behaviour
 void setObject(PersistentObject po)
          Set the Object to display
 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

DisplayPanel

public DisplayPanel(Composite parent,
                    FieldDescriptor<? extends PersistentObject>[] fields,
                    int minCols,
                    int maxCols,
                    IAction... actions)
Method Detail

setObject

public void setObject(PersistentObject po)
Set the Object to display

Parameters:
po - a PersistentObject that must have all fields defined, that are referenced by ActiveControls of this Panel

setAutosave

public void setAutosave(boolean doSave)
Set autosave behaviour

Parameters:
doSave - if true: changed fields are written back to the database. false: No weiting occurs

addField

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

Parameters:
ac -

addFields

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

Parameters:
activeControls -

contentsChanged

public void contentsChanged(ActiveControl ac)
Description copied from interface: ActiveControlListener
Contents of field has chsnged.

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

invalidContents

public void invalidContents(ActiveControl field)
Specified by:
invalidContents in interface ActiveControlListener

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

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

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis