|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSelectionAdapter
ch.elexis.util.FirstnameListener
public class FirstnameListener
class for the FocusListener, KeyListener and SelectionAdapter for the combined fields firstname and gender field. You just need to create an instance of FirstnameListener. The constructor takes the parameters and automatically adds the necessary listeners to the name- and gender fields. eg:
(new FirstnameListener(firstNameField_Text, genderCombo)).setDefaultListeners(); OR: (new FirstnameListener(firstNameField_Text, genderList)).setDefaultListeners(); OR: (new FirstnameListener(firstNameField_Text, genderRadioM, genderRadioW)).setDefaultListeners(); OR: (new FirstnameListener(firstNameField_Text, genderCheckM, genderCheckW)).setDefaultListeners(); OR: (new FirstnameListener(firstNameField_Combo, genderText)).setDefaultListeners() .setGenderStrings("münnlüsch", "wüblüsch");The items (Combo/List/Radio/CheckBox) for the controls must have already been set BEFORE calling this.
If the firstname field is a Text field, then you must call the method setGenderStrings() to tell the listeners which string means "male" and "female".
An extended example of how to do this can be found in the plugin ch.marlovits-firstnames in the view "MarlovitsFirstnameTestView.java". You must activate the view in the plugin.xml for displaying it in elexis.
Field Summary | |
---|---|
static boolean |
reReadPlugin
|
Constructor Summary | |
---|---|
FirstnameListener(java.lang.Object firstnameField,
java.lang.Object genderComboOrListOrText)
generic constructor for firstnameField having type Text, Combo or List and genderField having type Combo or List or Text |
|
FirstnameListener(java.lang.Object firstnameField,
java.lang.Object genderMaleRadioOrCheck,
java.lang.Object genderFemaleRadioOrCheck)
generic constructor for firstnameField having type Text, Combo or List and genderMaleRadioOrCheck/genderFemaleRadioOrCheck having type Radio or Checkbox |
Method Summary | |
---|---|
void |
focusGained(FocusEvent e)
FocusListener for firstname field and gender field |
void |
focusLost(FocusEvent e)
FocusListener for firstname field and gender field |
static IGenderService |
getPlugin()
We're looking for the GenderPlugin defined in the settings. |
boolean |
isDBGenderAllowed(java.lang.String gender)
test if the passed gender is allowed - just "m" and "w" and "" are allowed Empty is always allowed. |
boolean |
isGenderAllowed(java.lang.String gender)
test if the passed gender is allowed as a selection for the shown control items. |
void |
keyPressed(KeyEvent e)
KeyListener for gender field |
void |
keyReleased(KeyEvent e)
KeyListener for gender field |
int |
openFreeDialog(Shell parentShell,
java.lang.String title,
Image dialogTitleImage,
java.lang.String dialogMessage,
int dialogImageType,
java.lang.String[] dialogButtonLabels,
int defaultIndex)
displays a dialog with the given parameters |
FirstnameListener |
setDefaultListeners()
Sets the default FocusListener for the firstname field and the FocusListener/KeyListener/SelectionListener for the gender field |
void |
setGenderStrings(java.lang.String maleString,
java.lang.String femaleString)
sets the maleString and the femaleString to be used by the control. |
static void |
setReReadPlugin(boolean pReReadPlugin)
This sets if the GenderService plugin should be reread again. |
void |
widgetSelected(SelectionEvent e)
SelectionListener for gender field |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean reReadPlugin
Constructor Detail |
---|
public FirstnameListener(java.lang.Object firstnameField, java.lang.Object genderComboOrListOrText)
firstnameField
- genderComboOrListOrText
- public FirstnameListener(java.lang.Object firstnameField, java.lang.Object genderMaleRadioOrCheck, java.lang.Object genderFemaleRadioOrCheck)
firstnameField
- genderMaleRadioOrCheck
- genderFemaleRadioOrCheck
- Method Detail |
---|
public static IGenderService getPlugin()
public static void setReReadPlugin(boolean pReReadPlugin)
pReReadPlugin
- public FirstnameListener setDefaultListeners()
public void focusGained(FocusEvent e)
public void focusLost(FocusEvent e)
public void keyPressed(KeyEvent e)
public void keyReleased(KeyEvent e)
public void widgetSelected(SelectionEvent e)
public void setGenderStrings(java.lang.String maleString, java.lang.String femaleString)
maleString
- femaleString
- public boolean isGenderAllowed(java.lang.String gender)
gender
-
public boolean isDBGenderAllowed(java.lang.String gender)
gender
-
public int openFreeDialog(Shell parentShell, java.lang.String title, Image dialogTitleImage, java.lang.String dialogMessage, int dialogImageType, java.lang.String[] dialogButtonLabels, int defaultIndex)
parentShell
- title
- dialogTitleImage
- dialogMessage
- dialogImageType
- dialogButtonLabels
- defaultIndex
-
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |