Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.developer.resources.view
Class SampleView

java.lang.Object
  extended by ViewPart
      extended by ch.elexis.developer.resources.view.SampleView
All Implemented Interfaces:
GlobalEventDispatcher.IActivationListener, IPersistenceProvider

public class SampleView
extends ViewPart
implements GlobalEventDispatcher.IActivationListener, IPersistenceProvider

This is a sample view to demonstrate how to connect to elexis's event scheduler and how to display elexis's data types. We implement IActivationListener to be informed, wenn the user can see our View. All UI funktions should only be active in that case.

Author:
gerry

Field Summary
static java.lang.String ID
          We make a String constant for the ID to reference it from the perspective
 
Constructor Summary
SampleView()
           
 
Method Summary
 void activation(boolean mode)
          From IActivationListener: the view was activated or inactivated
 void createPartControl(Composite parent)
          This is the right place to create all UI elements.
 void dispose()
          On disposal,the IActivationListener MUST be unregistered.
 java.lang.String load(java.lang.Object param)
          Load the dependent data from the backing store
 void setFocus()
           
 void store(java.lang.String data, java.lang.Object param)
          Store data transparently to the IPersistenceProvider's backing store
 void visible(boolean mode)
          From IActivationListener: The View changes visibility.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
We make a String constant for the ID to reference it from the perspective

See Also:
Constant Field Values
Constructor Detail

SampleView

public SampleView()
Method Detail

createPartControl

public void createPartControl(Composite parent)
This is the right place to create all UI elements. The parent composite already has a GridLayout.


dispose

public void dispose()
On disposal,the IActivationListener MUST be unregistered. Also, our RestrictedAction must be unregistered from the AutoAdapt queue to prevent memory leaks.


setFocus

public void setFocus()

activation

public void activation(boolean mode)
From IActivationListener: the view was activated or inactivated

Specified by:
activation in interface GlobalEventDispatcher.IActivationListener
Parameters:
mode -

visible

public void visible(boolean mode)
From IActivationListener: The View changes visibility. Our listeners need only to be active, if the view is visible. So we unregister them if the view disappears to save resources. If the view becomes visible again, we must send an event, because the listeners don't know what happend before they start listening

Specified by:
visible in interface GlobalEventDispatcher.IActivationListener
Parameters:
mode - true: the view becomes visible. false: the view becomes invisible

store

public void store(java.lang.String data,
                  java.lang.Object param)
           throws PersistenceException
Description copied from interface: IPersistenceProvider
Store data transparently to the IPersistenceProvider's backing store

Specified by:
store in interface IPersistenceProvider
Parameters:
data - the data to store. The IPersistenceProvider must be able to reconstruct the data from the String retrieved by load()
param - a implememntation dependent parameter. Can be null or any arbitrary object
Throws:
PersistenceException - if the data could not be stored correctly
See Also:
store the contents of the SimpleStructuredDocument (wich is in the BaseRichTextDisplay)

load

public java.lang.String load(java.lang.Object param)
                      throws PersistenceException
Description copied from interface: IPersistenceProvider
Load the dependent data from the backing store

Specified by:
load in interface IPersistenceProvider
Parameters:
param - an implementation depoendent parameter. Can be null or any arbitrary Object
Returns:
the data read. Must be exactly the same as written by store()
Throws:
PersistenceException - if the data coulkd not be read correctly
See Also:
load text from the REMARK field into the SimpleStructuredDocument that backs the BaseRichTextDisplay

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis