1 package com.sri.emo.wizard.creation;
2
3 import java.util.*;
4
5 import com.sri.emo.dbobj.*;
6 import com.sri.emo.wizard.defaults.*;
7
8
9 /***
10 * Constructs metadata for a custom part handler. Put in here any special
11 * data hooks needed to load the criteria.
12 *
13 * @author Larry Hamel
14 */
15 public class CustomPartHandlerMetadata extends EmoWizardMetadata implements CreationMetadata {
16
17 /***
18 * name of handler class
19 */
20 private String handlerClassName;
21
22 private List inputList;
23 private ISetting settingPrototype;
24
25 /***
26 * added by rich
27 */
28 private boolean search, browse, create, required;
29 private String searchText, browseText, createText;
30 /***
31 * Default constructor.
32 */
33 public CustomPartHandlerMetadata() {
34 }
35
36 /***
37 * Overrides the view id to return the custom handler entry.
38 * {@inheritDoc}
39 *
40 * @return 'CustomHandlerEntry'
41 */
42 public String getViewId() {
43 return "CustomHandlerEntry";
44 }
45
46 public void setCustomHandlerClassName(String handlerClass) {
47 this.handlerClassName = handlerClass;
48 }
49
50 /***
51 * create instance of custom handler; uses 'forName' and depends on no-args constructor
52 *
53 * @return instance of this custom handler; never null
54 */
55 public IPartHandler getCustomHandler()
56 throws ClassNotFoundException, IllegalAccessException, InstantiationException {
57 Class clazz = Class.forName(handlerClassName);
58 return (IPartHandler) clazz.newInstance();
59 }
60
61 public List getInputList() {
62 return inputList;
63 }
64
65 public void setInputList(List list) {
66 inputList = list;
67 }
68
69 public void setSettingPrototype(ISetting settingPrototype) {
70 this.settingPrototype = settingPrototype;
71 }
72
73 public ISetting getSettingPrototype() {
74 return settingPrototype;
75 }
76
77 public void setBrowse(boolean browse) {
78 this.browse = browse;
79 }
80
81 public void setCreate(boolean create) {
82 this.create = create;
83 }
84
85 public void setSearch(boolean search) {
86 this.search = search;
87 }
88
89 public void setRequired(boolean skip) {
90 this.required = skip;
91 }
92
93 public void setBrowseText(String browseText) {
94 this.browseText = browseText;
95 }
96
97 public void setCreateText(String createText) {
98 this.createText = createText;
99 }
100
101 public void setSearchText(String searchText) {
102 this.searchText = searchText;
103 }
104
105
106 public boolean isBrowse() {
107 return browse;
108 }
109
110 public boolean isCreate() {
111 return create;
112 }
113
114 public boolean isSearch() {
115 return search;
116 }
117
118 public boolean isRequired() {
119 return required;
120 }
121
122 public String getBrowseText() {
123 return browseText;
124 }
125
126 public String getCreateText() {
127 return createText;
128 }
129
130 public String getSearchText() {
131 return searchText;
132 }
133
134 }