forked from edchat/dojo-generate-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateStandardEditorFactory.js
77 lines (70 loc) · 4.22 KB
/
createStandardEditorFactory.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
define([
"dojo/_base/lang",//
"./EditorFactory", //
"./AttributeFactoryFinder",//
"./group/GroupFactory",//
"./group/ListPaneGroupFactory",//
"./group/TabGroupFactory",//
"./group/TitlePaneGroupFactory",//
"./group/ListGroupFactory",//
"./list_primitive/PrimitiveListAttributeFactory",//
"./primitive/StringAttributeFactory",//
"./primitive/BooleanAttributeFactory",//
"./primitive/SelectAttributeFactory",//
"./primitive/CheckedSelectAttributeFactory",//
"./primitive/MappedCheckedMultiSelectAttributeFactory",//
"./primitive/CheckedMultiSelectAttributeFactory",//
"./primitive/MappedSelectAttributeFactory",//
"./primitive/DateAttributeFactory",//
"./primitive/TimeAttributeFactory",//
"./embedded/EmbeddedAttributeFactory",//
"./primitive/NumberAttributeFactory",//
"./primitive/CurrencyAmountAttributeFactory",//
"./primitive/MappedContentPaneFactory",//
"./group/AttributeListWidget",//
"./list_embedded/RepeatedEmbeddedAttributeFactory",//,
"./list_table/RepeatedEmbeddedAttributeFactory"
], function(lang,EditorFactory,AttributeFactoryFinder, GroupFactory, ListPaneGroupFactory, TabGroupFactory, //
TitlePaneGroupFactory, ListGroupFactory,PrimitiveListAttributeFactory,StringAttributeFactory,
BooleanAttributeFactory, SelectAttributeFactory, CheckedSelectAttributeFactory,
MappedCheckedMultiSelectAttributeFactory,
CheckedMultiSelectAttributeFactory, MappedSelectAttributeFactory, DateAttributeFactory,
TimeAttributeFactory, EmbeddedAttributeFactory, NumberAttributeFactory,
CurrencyAmountAttributeFactory, MappedContentPaneFactory,
AttributeListWidget, RepeatedEmbeddedAttributeFactory,TableListAttributeFactory) {
var editorFactory = new EditorFactory();
editorFactory.addGroupFactory("list", new GroupFactory({editorFactory:editorFactory}));
editorFactory.addGroupFactory("listpane", new ListPaneGroupFactory({editorFactory:editorFactory}));
editorFactory.addGroupFactory("listgroup", new ListGroupFactory({editorFactory:editorFactory}));
editorFactory.addGroupFactory("tab", new TabGroupFactory({editorFactory:editorFactory}));
editorFactory.addGroupFactory("titlepane", new TitlePaneGroupFactory({editorFactory:editorFactory}));
editorFactory.set("defaultGroupFactory",new GroupFactory({editorFactory:editorFactory}));
var attributeFactoryFinder = new AttributeFactoryFinder({
editorFactory : editorFactory
});
var attributeFactories = [ //
new RepeatedEmbeddedAttributeFactory({editorFactory:editorFactory}),//
new EmbeddedAttributeFactory({editorFactory:editorFactory}),//
new MappedCheckedMultiSelectAttributeFactory({editorFactory:editorFactory}), //
new CheckedMultiSelectAttributeFactory({editorFactory:editorFactory}), //
new MappedSelectAttributeFactory({editorFactory:editorFactory}),//
new PrimitiveListAttributeFactory({editorFactory:editorFactory}),//
new NumberAttributeFactory({editorFactory:editorFactory}),//
new SelectAttributeFactory({editorFactory:editorFactory}), //
new BooleanAttributeFactory({editorFactory:editorFactory}), //
new StringAttributeFactory({editorFactory:editorFactory}), //
new DateAttributeFactory({editorFactory:editorFactory}), //
new TimeAttributeFactory({editorFactory:editorFactory}), //
new MappedContentPaneFactory({editorFactory:editorFactory}) //
];
attributeFactoryFinder.addAttributeFactory("table", new TableListAttributeFactory({editorFactory:editorFactory}));
attributeFactoryFinder.addAttributeFactory("primitive_list", new PrimitiveListAttributeFactory({editorFactory:editorFactory}));
attributeFactoryFinder.addAttributeFactory("mapped_contentpane", new MappedContentPaneFactory({editorFactory:editorFactory}));
attributeFactoryFinder.addAttributeFactory("currencyamount", new CurrencyAmountAttributeFactory({editorFactory:editorFactory}));
attributeFactoryFinder.addAttributeFactory("checked_select",new CheckedSelectAttributeFactory({editorFactory:editorFactory}));
attributeFactoryFinder.set("attributeFactories",attributeFactories);
editorFactory.set("attributeFactoryFinder",attributeFactoryFinder);
return function() {
return editorFactory;
}
});