KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > person > search > PersonStructFieldSearchItemEditorHelper


1 /*
2  * Created on Dec 17, 2004
3  * by alex
4  *
5  */

6 package com.nightlabs.ipanema.person.search;
7
8 import org.eclipse.swt.widgets.Composite;
9 import org.eclipse.swt.widgets.Control;
10
11 import com.nightlabs.ipanema.person.AbstractPersonStructField;
12 import com.nightlabs.jdo.search.SearchFilterItem;
13
14 /**
15  * @author Alexander Bieber <alex[AT]nightlabs[DOT]de>
16  */

17 public abstract class PersonStructFieldSearchItemEditorHelper implements
18         PersonSearchFilterItemEditorHelper {
19
20     
21     protected AbstractPersonStructField personStructField;
22     
23     
24     protected PersonStructFieldSearchItemEditorHelper() {
25         super();
26     }
27     
28     /**
29      * Constructs a new PersonStructFieldSearchItemEditorHelper
30      * and calls {@link #init(AbstractPersonStructField)}.
31      *
32      * @param personStructField
33      */

34     public PersonStructFieldSearchItemEditorHelper(AbstractPersonStructField _personStructField) {
35         super();
36         init(_personStructField);
37     }
38     
39     
40     public void init(AbstractPersonStructField personStructField) {
41         this.personStructField = personStructField;
42     }
43
44     /**
45      * @see com.nightlabs.ipanema.person.search.PersonSearchFilterItemEditorHelper#getControl(org.eclipse.swt.widgets.Composite)
46      */

47     public abstract Control getControl(Composite parent);
48
49     /**
50      * @see com.nightlabs.ipanema.person.search.PersonSearchFilterItemEditorHelper#getSearchFilterItem()
51      */

52     public abstract SearchFilterItem getSearchFilterItem();
53
54     /**
55      * @see com.nightlabs.ipanema.person.search.PersonSearchFilterItemEditorHelper#newInstance()
56      */

57     public PersonSearchFilterItemEditorHelper newInstance() {
58         PersonStructFieldSearchItemEditorHelper result;
59         try {
60             result = (PersonStructFieldSearchItemEditorHelper)this.getClass().newInstance();
61         } catch (Throwable JavaDoc t) {
62             IllegalStateException JavaDoc ill = new IllegalStateException JavaDoc("Error instatiating new PersonStructFieldSearchItemEditorHelper "+this);
63             ill.initCause(t);
64             throw ill;
65         }
66         result.init(this.personStructField);
67         return result;
68     }
69
70     /**
71      * @see com.nightlabs.ipanema.person.search.PersonSearchFilterItemEditorHelper#getDisplayName()
72      */

73     public String JavaDoc getDisplayName() {
74         return personStructField.getPersonStructBlockID()+": "+personStructField.getPersonStructFieldID();
75     }
76
77 }
78
Popular Tags